[vlc-commits] qml: fix vertical alignment of icon font

Pierre Lamot git at videolan.org
Wed Jun 3 12:07:00 CEST 2020


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Mon Feb 24 16:00:19 2020 +0100| [5c0c34f65c673e5bdc3a9b7a4149ad0094914a44] | committer: Pierre Lamot

qml: fix vertical alignment of icon font

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5c0c34f65c673e5bdc3a9b7a4149ad0094914a44
---

 modules/gui/qt/pixmaps/makeIconFont.py | 33 +++++++++++++++++++++++++++------
 1 file changed, 27 insertions(+), 6 deletions(-)

diff --git a/modules/gui/qt/pixmaps/makeIconFont.py b/modules/gui/qt/pixmaps/makeIconFont.py
index dbd9d1c0d4..1d5e8fe018 100755
--- a/modules/gui/qt/pixmaps/makeIconFont.py
+++ b/modules/gui/qt/pixmaps/makeIconFont.py
@@ -93,10 +93,31 @@ def main(model_fd):
     font = fontforge.font()
     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
+    font.design_size = 1024.0
+
+    font.hasvmetrics = True
+
+    font.upos=0
+    font.ascent = 1024
+    font.descent = 0
+
+    font.hhea_ascent = 1024
+    font.hhea_ascent_add = False
+    font.hhea_descent = 0
+    font.hhea_descent_add = False
+    font.hhea_linegap = 0
+
+    font.os2_use_typo_metrics = True
+    font.os2_typoascent = 1024
+    font.os2_typoascent_add = False
+    font.os2_typodescent = 0
+    font.os2_typodescent_add = False
+    font.os2_typolinegap = 0
+
+    font.os2_winascent = 1024
+    font.os2_winascent_add = False
+    font.os2_windescent = 0
+    font.os2_windescent_add = False
 
     for i, glyph in enumerate(data["glyphs"]):
         charcode = UTF8_AREA + i
@@ -105,8 +126,8 @@ def main(model_fd):
         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, 200.))
-        c.vwidth = 1000
-        c.width = 1000
+        c.vwidth = 1024
+        c.width = 1024
 
     font.generate(data["font_file"])
     genQml(data)



More information about the vlc-commits mailing list