Clone in a terminal:
Commit 898f008
Johan Mattsson - 2015-10-04T08:26:27+00:00
898f0083a74738d705699f2070d45697770a0f9cjohan.mattsson.m@gmail.com

Put ligatures last in TTF fonts

Changed files (4)

Diff

diff --git a/libbirdfont/ExportTool.vala b/libbirdfont/ExportTool.valaindex c5b02d8..45fc686 100644--- a/libbirdfont/ExportTool.vala+++ b/libbirdfont/ExportTool.vala@@ -384,7 +384,7 @@ os.put_string ( 		<span class="capstosmallcaps">OTF</span> features,  		<span class="swashes">like swashes </span> 		<span class="alternates">alternates & </span>-		<span class="smallcaps">small caps</span>, can be been added +		<span class="smallcaps">small caps</span>, can be added  		to the font.</span> 	</p> </div>diff --git a/libbirdfont/OpenFontFormat/CmapSubtableFormat12.vala b/libbirdfont/OpenFontFormat/CmapSubtableFormat12.valaindex ff4a415..e3d00d4 100644--- a/libbirdfont/OpenFontFormat/CmapSubtableFormat12.vala+++ b/libbirdfont/OpenFontFormat/CmapSubtableFormat12.vala@@ -24,9 +24,16 @@ public class CmapSubtableFormat12 : GLib.Object { 		GlyphRange glyph_range = new GlyphRange (); 		Gee.ArrayList<UniRange> ranges; 		FontData fd = new FontData ();-		uint32 first_assigned = 1 + glyf_table.number_of_unassigned_glyphs;+		uint32 first_assigned; 		uint32 indice; 		+		first_assigned = 0;+		foreach (GlyphCollection g in glyf_table.glyphs) {+			if (!g.is_unassigned () && g.get_unicode_character () == '\0') {+				first_assigned++;+			}+		}+		 		foreach (GlyphCollection g in glyf_table.glyphs) { 			if (!g.is_unassigned () && g.get_unicode_character () < 0xFFFFFFFF) { 				glyph_range.add_single (g.get_unicode_character ());diff --git a/libbirdfont/OpenFontFormat/CmapSubtableFormat4.vala b/libbirdfont/OpenFontFormat/CmapSubtableFormat4.valaindex 0e0f8de..6db5d18 100644--- a/libbirdfont/OpenFontFormat/CmapSubtableFormat4.vala+++ b/libbirdfont/OpenFontFormat/CmapSubtableFormat4.vala@@ -188,7 +188,14 @@ public class CmapSubtableFormat4 : GLib.Object { 		uint16 gid_length = 0; 		 		uint32 indice;-		uint32 first_assigned = 1 + glyf_table.number_of_unassigned_glyphs;+		uint32 first_assigned;+		+		first_assigned = 0;+		foreach (GlyphCollection g in glyf_table.glyphs) {+			if (!g.is_unassigned () && g.get_unicode_character () == '\0') {+				first_assigned++;+			}+		} 		 		foreach (GlyphCollection g in glyf_table.glyphs) { 			if (!g.is_unassigned () && g.get_unicode_character () < 0xFFFF) {diff --git a/libbirdfont/OpenFontFormat/GlyfTable.vala b/libbirdfont/OpenFontFormat/GlyfTable.valaindex 2108cfc..8e33a07 100644--- a/libbirdfont/OpenFontFormat/GlyfTable.vala+++ b/libbirdfont/OpenFontFormat/GlyfTable.vala@@ -44,7 +44,6 @@ public class GlyfTable : OtfTable { 	// sorted array of glyphs 	public Gee.ArrayList<GlyphCollection> glyphs; 	public Gee.ArrayList<GlyfData> glyf_data;-	public uint number_of_unassigned_glyphs = 0; 	 	uint16 max_points = 0; 	uint16 max_contours = 0;@@ -185,9 +184,15 @@ public class GlyfTable : OtfTable { 			} 		} 		+		glyphs.sort ((a, b) => {+			GlyphCollection g1, g2;+			g1 = (GlyphCollection) a;+			g2 = (GlyphCollection) b;+			return (int) (g1.get_unicode_character () - g2.get_unicode_character ());+		});+		 		foreach (GlyphCollection ug in unassigned_glyphs) {-			glyphs.insert (1, ug);-			number_of_unassigned_glyphs++;+			glyphs.add (ug); 		} 	} 

Contact

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