File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 11birdfont (2.30.0) stable;
22
33 * Smaller .birdfont files
4+ * Make sure only one copy of a background image is stored in the font file.
45
56 -- Johan Mattsson <johan.mattsson.m@gmail.com> Tue Feb 8 03:03:27 CET 2022
67
Original file line number Diff line number Diff line change @@ -24,12 +24,14 @@ class BirdFontFile : GLib.Object {
2424 Font font;
2525
2626 public const int FORMAT_MAJOR = 2 ;
27- public const int FORMAT_MINOR = 2 ;
27+ public const int FORMAT_MINOR = 3 ;
2828
2929 public const int MIN_FORMAT_MAJOR = 0 ;
3030 public const int MIN_FORMAT_MINOR = 0 ;
3131
3232 public bool has_svg_glyphs = false ;
33+
34+ Gee . ArrayList<string> written_images = new Gee .ArrayList<string> ();
3335
3436 public BirdFontFile (Font f ) {
3537 font = f;
@@ -252,6 +254,16 @@ class BirdFontFile : GLib.Object {
252254 }
253255
254256 public void write_image (DataOutputStream os , string sha1 , string data ) throws GLib .Error {
257+ if (written_images. contains (sha1)) {
258+ warning (" Font file already contains " + sha1);
259+ return ;
260+ }
261+
262+ if (sha1 == " " || data == " " ) {
263+ warning (" No data in background image." );
264+ return ;
265+ }
266+
255267 os. put_string (@" <background-image sha1=\" " );
256268 os. put_string (sha1);
257269 os. put_string (" \" " );
You can’t perform that action at this time.
0 commit comments