sorry to bother you. I have recently started devolping in Kivy and i am trying to show a scrollable text file in a window. The text comes from a .txt file, and a use the id of the label to put the string obtained from the file into the text field in the Label.
The problem i am having is that, althouugh kivy documentation firmely states that the label has no lines limit (by default), when i pass a certain number the text starts to be showed all in black as the picture i will attached. Before adding one more line to the .txt, the text can be read just fine but after adding the line the problem starts.
After adding the line
Before adding the line
Here is my code, the id of the label i am having troubles with is called "documento". Can some please tell me if there is some error in my label configuration or something else?
from kivy.lang import Builder
Builder.load_string('''
<RootWidget>:
canvas.before:
Color:
rgba: 1, 1, 1, 1
Rectangle:
pos: self.pos
size: self.size
color: (0, 0, 0, 1.0)
background_color: (255, 255, 255, 1.0)
carousel: carousel
Carousel:
on_index: root.on_index(*args)
id: carousel
ignore_perpendicular_swipes: True
FloatLayout:
id: tab1
Label:
id: identification
text: ''
markup: True
color: (0, 0, 0, 1.0)
halign: 'left'
valign: 'top'
font_size: '18pt'
x: 100
y: -80
opacity: 0
Image:
id: avatar
source: 'assets/avatar.png'
keep_ratio: True
size_hint_x: 0.3
x: 60
y: -70
opacity: 0
Image:
id: banner
source: 'assets/banner.png'
keep_ratio: True
size_hint_x: 1
x: 0
y: 160
opacity: 0
Image:
id: lock
source: 'assets/lock.png'
FloatLayout:
id: tab2
Label:
id: asunto
text: 'Asunto: [b] Expdte. 234/98634987/54[/b]'
markup: True
color: (0, 0, 0, 1.0)
halign: 'left'
valign: 'top'
font_size: '18pt'
x: 40
y: 170
opacity: 0
Image:
id: votacion
size_hint_x: 0.2
x: 20
y: 80
opacity: 1
Label:
id: voto_text
text: '[b]VOTO POSITIVO[/b]'
markup: True
color: (0, 0, 0, 1.0)
halign: 'left'
valign: 'top'
font_size: '40pt'
y: 90
x: 40
opacity: 1
Image:
id: biometric_icon
source: 'assets/biometric.png'
keep_ratio: False
size_hint_x: 0.2
y: -90
x: 320
opacity: 1
Label:
id: confirm_label
text: 'CONFIRMACI\xc3\x93N BIOM\xc3\x89TRICA'
markup: True
color: (0, 0, 0, 1.0)
halign: 'center'
valign: 'top'
font_size: '10pt'
y: -190
x: 00
opacity: 1
FloatLayout:
id: tab3
ScrollView:
on_scroll_start: print("arranque")
on_scroll_move: print("me muevo")
on_scroll_stop: print("pare")
Label:
id: documento
text_size:700, None
size_hint_y: None
height: self.texture_size[1]
color: (0, 0, 0, 1.0)
Label:
id: debugger
text: ''
color: (0, 0, 0, 1.0)
halign: 'left'
valign: 'top'
width: 200
''')
I continue my search for a solution to this problem only to discover there was a limitation in my gpu for rendering the text, so the problem was that. So to sum-up and help everyone who is having the same problem, the limitation is not from kivy but from the gpu
Related
I try to create some object that a user could able by mouse rotate use Three.js and webgl. It's displaying fine when a screen has a full HD resolution (1960x1080) but when a user screen had resolution roughly 1366x768 object is ugly (blurred). Most notably text on the image.
Originally image has the resolution 1024x748 and the scene has a size roughly 530x270.
Clear - https://ibb.co/0s7W2hk
Blurred - https://ibb.co/tzCkq6W (in some cases blur corruption have more influence)
I connect the model to the scene by next code
// ...
scene.add({
genotype: VOLUMETRIC_OBJECT,
phenotype: MODELLED_MESH,
data: {
model: 'assets/FBX 2013/model.FBX',
position: {
x: 0,
y: isMobile ? 0.05 : 0.375,
z: 0,
},
scale: isMobile ? {
x: 70e-3,
y: 70e-3,
z: 70e-3,
} : {
x: 75e-3,
y: 75e-3,
z: 75e-3,
},
name: 'model',
material: {
hb_03_label1Model: {
map: 'assets/mm1.jpg',
alphaMap: 'assets/mam1.jpg',
color: 0xffffff,
specular: new Color(0xffffff),
shininess: 5,
transparent: true,
opacity: 1,
needsUpdate: true,
},
body_hb_03Model: {
normalMap: 'assets/mnm2.jpg',
color: 0xaaaaaa,
specular: new Color(0xFFFFFF),
opacity: 0.35,
shininess: 100,
transparent: true,
needsUpdate: true,
normalScale: {
x: 1,
y: 1,
},
},
hb_03_leqidoModel: {
type: MATERIAL__SHADER,
map: 'assets/mm3.jpg',
thicknessMap: 'assets/mtm3.jpg',
specularMap: 'assets/msm3.jpg',
normalMap: 'assets/mnm3.jpg',
repeat: [10, 10],
color: 0xffffff,
refractionRatio: 0.985,
reflectivity: 0.15,
diffuse: new Vector3(1, 0.3, 0.3),
thicknessColor: new Vector3(0.11, 0.11, 0.11),
needsUpdate: true,
uniformsNeedUpdate: true,
},
hb_03_cappaModel: {
color: 0x00AD16,
needsUpdate: true,
},
},
},
},
(model) => {
// ...
},
)
Update 1:
In my case when I change mag and min filters to Linear, I have strong sharpness and text not readable, again.
I think, for the best result, I need to use mag filter as Linear and min filter as LinearMipMapLinearFilter with the generated by myself mipmap.
But, currently, generate custom mipmap so strong for me. I did increase anisotropy for texture, and text is displayed acceptable
I didn't manage to change the color of the line .
By default, it's orange ...
https://jsfiddle.net/z7xo8thx/
$("#temp-range").kendoSparkline({
type: "bullet",
data: [21, 23],
valueAxis: {
min: 0,
max: 50,
plotBands: [{
from: 0,
to: 15,
color: "#787878",
opacity: 0.15
}, {
from: 16,
to: 50,
color: "#787878",
opacity: 0.15
}]
},
tooltip: {
visible: true
}
});
Thanks for your help !
You can set the seriesColors property:
seriesColors: ["#558B9B"],
Updated FIDDLE
I'm trying to position qTips under a div, as shown above. The tips are the same width as the container that holds the targets (A, B, C). I'm trying to get the tip to position itself directly below the container, but I want the corner to position itself relative to the target.
How do I configure qTip2 to get this alignment?
Target B is straightforward...
position: {
my: 'top center',
at: 'bottom center'
},
style: {
width: 350,
tip: {
height: 10,
width: 12
}
},
but Targets A and C are giving me trouble
If I add some style.tip configs for Target A:
position: {
my: 'top center',
at: 'bottom center'
},
style: {
width: 350,
tip: {
height: 10,
width: 12,
corner: 'top left',
mimic: 'center'
}
},
the corner is not positioned under the center of the target... it's off to the left side
If I add a tip.offset, then the corner appears to be offset correctly, but the entire tip is shifted by an equal amount, no longer aligned with the container.
position: {
my: 'top center',
at: 'bottom center'
},
style: {
width: 350,
tip: {
height: 10,
width: 12,
corner: 'top left',
mimic: 'center',
offset: 60 // about half the width of Target A
}
},
How do I configure qTip2 to get this tip aligned with the container, and the corner aligned with the target?
Here's how I solved it:
for Target A
position: {
my: 'top center',
at: 'bottom center'
},
style: {
width: 350,
tip: {
height: 10,
width: 12,
offset: -120 // offset from the center
}
},
for Target B
position: {
my: 'top center',
at: 'bottom center'
},
style: {
width: 350,
tip: {
height: 10,
width: 12,
offset: 120 // offset from the center
}
},
Currently, it seems that CanvasJS only supports angling labels in one direction (with the baseline on the left), as shown in the image below. I would like to rotate the text in the opposite direction (With the baseline for the text being on the right), as shown by the arrows.
So far, I have tried setting the axisX labelAngle to 90, 270, -45, -90, and -270. None of these have resulted in shifting the baseline to the right like I want, and have all forced the text to a max of 90 degrees with the baseline on the left.
Is this possible in the current version? #Devs: If not available in current version, would it be possible to add in support for this?
You can set angle to negative value to make it rotated the other way-round, as shown in this screenshot.
Here is an example.
var chart = new CanvasJS.Chart("chartContainer",
{
axisX:{
title: "labels at -45 deg",
labelAngle: -45
},
data: [
{
type: "column",
dataPoints: [
{ x: 10, y: 71, label: "cat 1" },
{ x: 20, y: 55, label: "cat 2" },
{ x: 30, y: 50, label: "cat 3" },
{ x: 40, y: 65, label: "cat 4" },
{ x: 50, y: 95, label: "cat 5" },
{ x: 60, y: 68, label: "cat 6" },
{ x: 70, y: 28, label: "cat 7" },
{ x: 80, y: 34, label: "cat 8" },
{ x: 90, y: 14, label: "cat 9" }
]
}
]
});
chart.render();
<script src="http://canvasjs.com/assets/script/canvasjs.min.js"></script>
<div id="chartContainer" style="height: 360px; width: 100%;"></div>
I am trying to get Squib to embed images. I have an excel doc (totm.xlsx) that has fields for Title, Gold, Description, etc. In the Excel doc, most of the cards have :A: or :M: in the description and I would like to replace those with a small SVG icon.
The following code coughs up 'unidentified local method [embed]' and a litany of other errors:
require 'squib'
Squib::Deck.new(cards: 54) do
background color: :white
data = xlsx file: 'totm.xlsx'
text str: data['Title'], x: 250, y: 55, font: 'Arial 12'
text str: data['Gold'], x: 65, y: 65, font: 'Arial 12'
text(str: data['Description'], x: 65, y: 600, font: 'Arial 12') do [embed]
embed.svg key: ':A:', width: 28, height: 28, file: 'battle-axe.svg'
embed.svg key: ':M:', width: 28, height: 28, file: 'burning-meteor.svg'
end
text str: data['Flavortext'], x: 65, y: 100, font: 'Arial 12'
text str: data['Type'], x: 65, y: 400, font: 'Arial 12'
save_sheet prefix: 'totm_sheet_', margin: 75, gap: 5, trim: 37
end
In the examples with embedding text, the code always uses a single named string, embed_text, but I would like to call an array of strings.
embed_text = 'Take 1 :tool: and gain 2 :health:.'
text(str: embed_text, font: 'Sans', font_size: [18, 32, 45],
x: 0, y: 0, width: 180, height: 300, valign: :bottom,
align: :left, ellipsize: false, justify: false, hint: :cyan) do |embed|
embed.svg key: ':tool:', width: 28, height: 28, file: 'spanner.svg'
embed.svg key: ':health:', width: 28, height: 28, file: 'glass-heart.svg'
end
You have brackets around your [embed]; as the code example shows, it should be using vertical bars, like |embed|.