Clone in a terminal:
Commit 43af5b6
Johan Mattsson - 2014-07-06T20:52:38+00:00
43af5b61a0fca710e68ba81103b5204baa7ad098johan.mattsson.m@gmail.com

Cache code pages

Changed files (2)

Diff

diff --git a/fonts/Decibel.bf b/fonts/Decibel.bfindex bf9de76..e5c36f0 100644--- a/fonts/Decibel.bf+++ b/fonts/Decibel.bf@@ -212,7 +212,7 @@ 		<path stroke="0" data="S 33.8122968329,7.8652131513 Q 29.8169735279,5.2431772601 25.8647484630,3.7676298946 Q 15.7579355985,-0.0057081239 8.0728105728,0.0908670399 Q -3.8482188894,0.5608679328 -11.9879490313,5.0019753403 Q -26.9941554382,13.1894917898 -28.0302482989,35.9922328452 Q -28.2838067513,62.5490385608 -7.5997581238,71.6130543249 Q 1.7866862959,75.7263148243 17.8092783505,73.6193229312 Q 23.3414915136,72.5422210612 31.3097891706,69.0030881397 L 29.3941905823,54.7869647999 Q 23.0820108744,59.2415617030 17.4877867558,60.6491130306 Q -8.5522807228,66.3579525117 -8.0626347330,33.9753021820 Q -7.1301552709,15.5459600800 11.9016392259,15.4063372648 Q 16.7374616885,15.4261400576 20.0570493174,17.3230472741 L 20.0338865837,32.0006915629 L 7.9453665284,32.0006915629 L 7.9453665284,43.9619640387 L 34.0311203320,43.9619640387 L 33.8122968329,7.8652131513" /> 	</glyph> 	<glyph id="2" left="-28" right="44">-		<path stroke="0" data="S 10.5710338673,73.7017685738 Q 24.7182593641,73.6238273665 31.0226237322,71.3796911174 L 30.0743208307,58.4753807359 Q 20.3930505433,61.3607890328 10.3105545524,60.7566913909 Q -9.1986620104,60.4821383336 -8.0626347330,33.9753021820 Q -7.2725067945,15.5393084171 11.9016392259,15.4063372648 Q 16.7374616885,15.4261400576 20.0570493174,17.3230472741 L 19.9291321934,33.1529898560 L 7.8406121381,33.1529898560 L 8.0501209186,43.5429464776 L 34.1358747222,43.5429464776 L 33.8122968329,7.8652131513 Q 29.8169735279,5.2431772601 25.8647484630,3.7676298946 Q 15.7579355985,-0.0057081239 8.0728105728,0.0908670399 Q -3.8482188894,0.5608679328 -11.9879490313,5.0019753403 Q -27.5333231473,13.1713749855 -28.0302482989,35.9922328452 Q -28.8586676176,73.9189983437 10.5710338673,73.7017685738 T" />+		<path stroke="0" data="S 10.5710338673,72.9075239695 Q 24.7444218685,73.0481294939 31.0226237322,69.9235760095 L 30.0743208307,57.0192656280 Q 20.3929455246,60.0363074218 10.3105545524,59.9624467866 Q -9.2000702850,59.8195176790 -8.0626347330,33.9753021820 Q -7.2725067945,15.5393084171 11.9016392259,15.4063372648 Q 16.7374616885,15.4261400576 20.0570493174,17.3230472741 L 19.9291321934,33.1529898560 L 7.8406121381,33.1529898560 L 8.0501209186,43.5429464776 L 34.1358747222,43.5429464776 L 33.8122968329,7.8652131513 Q 29.8169735279,5.2431772601 25.8647484630,3.7676298946 Q 15.7579355985,-0.0057081239 8.0728105728,0.0908670399 Q -3.8482188894,0.5608679328 -11.9879490313,5.0019753403 Q -27.5333231473,13.1713749855 -28.0302482989,35.9922328452 Q -28.7187430408,72.5177540934 10.5710338673,72.9075239695" /> 	</glyph> </collection> <collection unicode="U+48">diff --git a/libbirdfont/OpenFontFormat/CodePageBits.vala b/libbirdfont/OpenFontFormat/CodePageBits.valaindex c012534..fd4042e 100644--- a/libbirdfont/OpenFontFormat/CodePageBits.vala+++ b/libbirdfont/OpenFontFormat/CodePageBits.vala@@ -19,11 +19,17 @@ public class CodePageBits : GLib.Object { 	/** The first characters in all code pages. */ 	PageBit default_range; 	-	List<PageBit> codepages = new List<PageBit> (); +	static bool has_codepages = false;+	static Gee.ArrayList<PageBit> codepages;  	 	public CodePageBits () { 		default_range = new PageBit (-1, "null-");-		create_codepage_list ();+		+		if (!has_codepages) {+			codepages = new Gee.ArrayList<PageBit> ();+			create_codepage_list ();+			has_codepages = true;+		} 	} 	 	public void get_pages (Font font, out uint32 p0, out uint32 p1) {@@ -149,7 +155,7 @@ public class CodePageBits : GLib.Object {  	void create_codepage (int bit, string ranges) { 		PageBit b = new PageBit (bit, ranges);-		codepages.append (b);+		codepages.add (b); 	}  	private class PageBit : GLib.Object {

Contact

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