Skip to content
Snippets Groups Projects
Commit 20fefd3e authored by Pierre Lamot's avatar Pierre Lamot Committed by Jean-Baptiste Kempf
Browse files

qml: fix icon misaligned with on some systems


  Defining the scale transform within the font resulted in vertical misalignment
  on some systems.

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 51adabad
No related branches found
No related tags found
No related merge requests found
Pipeline #13913 passed with stage
in 15 minutes and 2 seconds
......@@ -25,7 +25,7 @@ import "qrc:///style/"
Label {
color: VLCStyle.colors.buttonText
font.pixelSize: VLCStyle.icon_medium
font.pixelSize: VLCIcons.pixelSize(VLCStyle.icon_medium)
font.family: VLCIcons.fontFamily
verticalAlignment: Text.AlignVCenter
......
No preview for this file type
......@@ -56,6 +56,10 @@ Item {
property string fontFamily: "{{font_name}}"
function pixelSize(size) {
return size * 0.6
}
// Icons
{% for f in glyphs %} property string {{f.key}} : "{{f.charcode}}"
{% endfor %}
......@@ -90,13 +94,17 @@ def main(model_fd):
font.familyname = data["font_name"]
font.fontname = data["font_name"]
font.design_size = 1000.0
font.ascent = 800
font.descent = 200
#we might need to specify ascent/descent of hhea_ os2_typo os2_win
for i, glyph in enumerate(data["glyphs"]):
charcode = UTF8_AREA + i
c = font.createChar(charcode)
glyph["charcode"] = "\\u{:x}".format(charcode)
c.importOutlines(glyph["path"])
#scale glyph to fit between 200 (base line) and 800 (x 0.6)
c.transform((0.6, 0.0, 0.0, 0.6, 200.0, 200.0))
#c.transform((0.6, 0.0, 0.0, 0.6, 200, 200.))
c.vwidth = 1000
c.width = 1000
......
......@@ -372,7 +372,7 @@ Item{
anchors.centerIn: parent
font.pixelSize: VLCStyle.icon_medium
font.pixelSize: VLCIcons.pixelSize(VLCStyle.icon_medium)
font.family: VLCIcons.fontFamily
verticalAlignment: Text.AlignVCenter
......@@ -399,7 +399,7 @@ Item{
anchors.centerIn: parent
font.pixelSize: VLCStyle.icon_medium
font.pixelSize: VLCIcons.pixelSize(VLCStyle.icon_medium)
font.family: VLCIcons.fontFamily
verticalAlignment: Text.AlignVCenter
......
......@@ -12,6 +12,10 @@ Item {
property string fontFamily: "VLCIcons"
function pixelSize(size) {
return size * 0.6
}
// Icons
property string eject : "\ue000"
property string stop : "\ue001"
......
......@@ -28,7 +28,7 @@ Button {
height: VLCStyle.icon_normal
text: VLCIcons.ellipsis
font.family: VLCIcons.fontFamily
font.pointSize: VLCStyle.icon_small
font.pixelSize: VLCIcons.pixelSize(VLCStyle.icon_medium)
property alias color: contextButtonContent.color
property alias backgroundColor: contextButtonBg.color
......
......@@ -46,7 +46,7 @@ ToolButton {
anchors.centerIn: parent
font.pixelSize: control.size
font.pixelSize: VLCIcons.pixelSize(control.size)
font.family: VLCIcons.fontFamily
font.underline: control.font.underline
......@@ -61,7 +61,7 @@ ToolButton {
anchors.centerIn: parent
font.pixelSize: control.size
font.pixelSize: VLCIcons.pixelSize(control.size)
font.family: VLCIcons.fontFamily
verticalAlignment: Text.AlignVCenter
......@@ -78,7 +78,7 @@ ToolButton {
anchors.centerIn: parent
font.pixelSize: control.size
font.pixelSize: VLCIcons.pixelSize(control.size)
font.family: VLCIcons.fontFamily
verticalAlignment: Text.AlignVCenter
......
......@@ -75,7 +75,7 @@ T.TabButton {
text: control.iconTxt
color: VLCStyle.colors.buttonText
font.pixelSize: VLCStyle.icon_topbar
font.pixelSize: VLCIcons.pixelSize(VLCStyle.icon_topbar)
font.family: VLCIcons.fontFamily
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment