Clone in a terminal:
Commit 0391a3d
Johan Mattsson - 2015-10-13T05:31:37+00:00
0391a3d1ac990724db213e8a0a54ec58c545f756johan.mattsson.m@gmail.com

Fix postscript names for glyphs

Changed files (1)

Diff

diff --git a/libbirdfont/OpenFontFormat/PostTable.vala b/libbirdfont/OpenFontFormat/PostTable.valaindex f0f2bdd..19011a1 100644--- a/libbirdfont/OpenFontFormat/PostTable.vala+++ b/libbirdfont/OpenFontFormat/PostTable.vala@@ -1,5 +1,5 @@ /*-    Copyright (C) 2012, 2013 Johan Mattsson+    Copyright (C) 2012 2013 2015 Johan Mattsson      This library is free software; you can redistribute it and/or modify      it under the terms of the GNU Lesser General Public License as @@ -1075,7 +1075,8 @@ public class PostTable : OtfTable { 		GlyphCollection gc; 		Glyph g; 		string ps_name;-			+		StringBuilder name;+		 		fd.add_fixed (0x00020000); // Version 		fd.add_fixed (0x00000000); // italicAngle 		@@ -1116,7 +1117,19 @@ public class PostTable : OtfTable { 				name_index = (int) names.size; // use font specific name 				fd.add_ushort ((uint16) name_index); 				-				ps_name = create_ps_name (g.get_name ());+				name = new StringBuilder ();+				if (gc.is_unassigned ()) {+					name.append (g.get_name ());+				} else {+					unichar c = gc.get_unicode_character ();+					if (c < 0xFFFF) {+						name.printf ("uni%04x", c);+					} else {+						name.printf ("u%05x", c);+					}+				}+				+				ps_name = create_ps_name (name.str); 				names.add (ps_name); 			} 			

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112