The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Language fix

These changes was commited to the Birdfont repository Wed, 18 Nov 2015 11:03:55 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Wed, 18 Nov 2015 11:03:55 +0000]

Updated Files

libbirdfont/Font.vala
libbirdfont/OpenFontFormat/CmapSubtableFormat0.vala
libbirdfont/OpenFontFormat/CmapSubtableFormat12.vala
libbirdfont/OpenFontFormat/CmapSubtableFormat4.vala
libbirdfont/OpenFontFormat/CodePageBits.vala
libbirdfont/OpenFontFormat/GlyfTable.vala
libbirdfont/OpenFontFormat/GposTable.vala
libbirdfont/OpenFontFormat/UnicodeRangeBits.vala
libbirdfont/OverView.vala
libbirdfont/OverviewTools.vala
libbirdfont/SvgFontFormatWriter.vala
libbirdfont/TestCases.vala
--- a/libbirdfont/Font.vala +++ b/libbirdfont/Font.vala @@ -622,8 +622,8 @@ } // FIXME: the order of ligature substitutions - public GlyphCollection? get_ligature (uint indice) { - return ligature.nth (indice); + public GlyphCollection? get_ligature (uint index) { + return ligature.nth (index); } /** Obtain all versions and alterntes for this glyph. */ @@ -666,18 +666,18 @@ return ((!)gc).get_current (); } - public GlyphCollection? get_glyph_collection_indice (unichar glyph_indice) { - if (!(0 <= glyph_indice < glyph_name.length ())) { + public GlyphCollection? get_glyph_collection_index (unichar glyph_index) { + if (!(0 <= glyph_index < glyph_name.length ())) { return null; } - return glyph_name.nth (glyph_indice); + return glyph_name.nth (glyph_index); } - public Glyph? get_glyph_indice (unichar glyph_indice) { + public Glyph? get_glyph_index (unichar glyph_index) { GlyphCollection? gc; - gc = get_glyph_collection_indice (glyph_indice); + gc = get_glyph_collection_index (glyph_index); if (gc != null) { return ((!) gc).get_current ();
--- a/libbirdfont/OpenFontFormat/CmapSubtableFormat0.vala +++ b/libbirdfont/OpenFontFormat/CmapSubtableFormat0.vala @@ -35,12 +35,12 @@ } uint8 get_gid_for_unichar (unichar c, GlyfTable glyf_table) { - uint32 indice = 0; + uint32 index = 0; foreach (GlyphCollection g in glyf_table.glyphs) { if (g.get_unicode_character () == c && !g.is_unassigned ()) { - return (indice <= uint8.MAX) ? (uint8) indice : 0; + return (index <= uint8.MAX) ? (uint8) index : 0; } - indice++; + index++; } return 0; }
--- a/libbirdfont/OpenFontFormat/CmapSubtableFormat12.vala +++ b/libbirdfont/OpenFontFormat/CmapSubtableFormat12.vala @@ -25,7 +25,7 @@ Gee.ArrayList<UniRange> ranges; FontData fd = new FontData (); uint32 first_assigned; - uint32 indice; + uint32 index; first_assigned = 1; @@ -45,7 +45,7 @@ fd.add_u32 (0); // Language fd.add_u32 ((uint32) ranges.size); // Number of groupings - indice = first_assigned; + index = first_assigned; foreach (UniRange u in ranges) { if (u.start >= 0xFFFFFFFF || u.stop >= 0xFFFFFFFF) { @@ -53,9 +53,9 @@ } else { fd.add_u32 (u.start); fd.add_u32 (u.stop); - fd.add_u32 (indice); + fd.add_u32 (index); - indice += u.length (); + index += u.length (); } }
--- a/libbirdfont/OpenFontFormat/CmapSubtableFormat4.vala +++ b/libbirdfont/OpenFontFormat/CmapSubtableFormat4.vala @@ -29,21 +29,21 @@ return table.size (); } - public unichar get_char (uint32 indice) { - int64? c = table.lookup (indice); + public unichar get_char (uint32 index) { + int64? c = table.lookup (index); - if (c == 0 && indice == 0) { + if (c == 0 && index == 0) { return 0; } if (c == 0) { - while (table.lookup (--indice) == 0) { - if (indice == 0) { + while (table.lookup (--index) == 0) { + if (index == 0) { return 0; } } - warning (@"There is no character for glyph number $indice in cmap table. table.size: $(table.size ()))"); + warning (@"There is no character for glyph number $index in cmap table. table.size: $(table.size ()))"); return 0; } @@ -131,7 +131,7 @@ } // map all values in a hashtable - int indice = 0; + int index = 0; unichar character = 0; uint32 id; for (uint16 i = 0; i < seg_count && start_char[i] != 0xFFFF; i++) { @@ -141,10 +141,10 @@ uint16 j = 0; do { character = start_char[i] + j; - indice = start_char[i] + id_delta[i] + j; + index = start_char[i] + id_delta[i] + j; if (id_range_offset[i] == 0) { - table.insert (indice, character); + table.insert (index, character); } else { // the indexing trick: id = id_range_offset[i] / 2 + j + i - seg_count; @@ -154,12 +154,12 @@ break; } - indice = glyph_id_array [id] + id_delta[i]; + index = glyph_id_array [id] + id_delta[i]; StringBuilder s = new StringBuilder (); s.append_unichar (character); - table.insert (indice, character); + table.insert (index, character); } j++; @@ -187,7 +187,7 @@ uint16 gid_length = 0; - uint32 indice; + uint32 index; uint32 first_assigned; first_assigned = 1; @@ -220,13 +220,13 @@ fd.add_ushort (range_shift); // end codes - indice = first_assigned; + index = first_assigned; foreach (UniRange u in ranges) { if (u.stop >= 0xFFFF) { warning ("Not implemented yet."); } else { fd.add_ushort ((uint16) u.stop); - indice += u.length (); + index += u.length (); } } fd.add_ushort (0xFFFF); @@ -234,25 +234,25 @@ fd.add_ushort (0); // Reserved // start codes - indice = first_assigned; // since first glyph are notdef, null and nonmarkingreturn + index = first_assigned; // since first glyph are notdef, null and nonmarkingreturn foreach (UniRange u in ranges) { if (u.start >= 0xFFFF) { warning ("Not implemented yet."); } else { fd.add_ushort ((uint16) u.start); - indice += u.length (); + index += u.length (); } } fd.add_ushort (0xFFFF); // delta - indice = first_assigned; + index = first_assigned; foreach (UniRange u in ranges) { - if ((u.start - indice) > 0xFFFF && u.start > indice) { + if ((u.start - index) > 0xFFFF && u.start > index) { warning ("Need range offset."); } else { - fd.add_ushort ((uint16) (indice - u.start)); - indice += u.length (); + fd.add_ushort ((uint16) (index - u.start)); + index += u.length (); } } fd.add_ushort (1);
--- a/libbirdfont/OpenFontFormat/CodePageBits.vala +++ b/libbirdfont/OpenFontFormat/CodePageBits.vala @@ -37,14 +37,14 @@ } public void get_pages (Font font, out uint32 p0, out uint32 p1) { - uint32 indice, a0, a1; + uint32 index, a0, a1; GlyphCollection? gl; GlyphCollection g; p0 = 0; p1 = 0; - for (indice = 0; (gl = font.get_glyph_collection_indice (indice)) != null; indice++) { + for (index = 0; (gl = font.get_glyph_collection_index (index)) != null; index++) { g = (!) gl; if (!g.is_unassigned ()) {
--- a/libbirdfont/OpenFontFormat/GlyfTable.vala +++ b/libbirdfont/OpenFontFormat/GlyfTable.vala @@ -139,7 +139,7 @@ GlyphCollection gc; GlyphCollection? gcn; Font font = OpenFontFormatWriter.get_current_font (); - uint32 indice; + uint32 index; Gee.ArrayList<GlyphCollection> unassigned_glyphs; bool unassigned; @@ -151,12 +151,12 @@ unassigned_glyphs = new Gee.ArrayList<GlyphCollection> (); - if (font.get_glyph_indice (0) == null) { + if (font.get_glyph_index (0) == null) { warning ("No glyphs in font."); } // add glyphs - for (indice = 0; (gcn = font.get_glyph_collection_indice (indice)) != null; indice++) { + for (index = 0; (gcn = font.get_glyph_collection_index (index)) != null; index++) { gc = (!) gcn; gc = gc.copy_deep (); g = gc.get_current ();
--- a/libbirdfont/OpenFontFormat/GposTable.vala +++ b/libbirdfont/OpenFontFormat/GposTable.vala @@ -64,7 +64,7 @@ fd.add_ushort (0); // feature prameters (null) fd.add_ushort (1); // number of lookups - fd.add_ushort (0); // lookup indice + fd.add_ushort (0); // lookup index // lookup table fd.add_ushort (1); // number of lookups
--- a/libbirdfont/OpenFontFormat/UnicodeRangeBits.vala +++ b/libbirdfont/OpenFontFormat/UnicodeRangeBits.vala @@ -23,7 +23,7 @@ } public void get_ranges (Font font, out uint32 r0, out uint32 r1, out uint32 r2, out uint32 r3) { - uint32 indice; + uint32 index; GlyphCollection? gl; GlyphCollection g; int bit; @@ -33,7 +33,7 @@ r2 = 0; r3 = 0; - for (indice = 0; (gl = font.get_glyph_collection_indice (indice)) != null; indice++) { + for (index = 0; (gl = font.get_glyph_collection_index (index)) != null; index++) { g = (!) gl; if (!g.is_unassigned ()) { bit = get_bit (g.get_unicode_character ());
--- a/libbirdfont/OverView.vala +++ b/libbirdfont/OverView.vala @@ -137,7 +137,7 @@ f = BirdFont.get_current_font (); for (int index = 0; index < f.length (); index++) { - glyphs = f.get_glyph_collection_indice ((uint32) index); + glyphs = f.get_glyph_collection_index ((uint32) index); return_if_fail (glyphs != null); selected_items.add ((!) glyphs); @@ -537,7 +537,7 @@ break; } - glyphs = f.get_glyph_collection_indice ((uint32) index); + glyphs = f.get_glyph_collection_index ((uint32) index); return_if_fail (glyphs != null); glyph = ((!) glyphs).get_current (); @@ -819,7 +819,7 @@ if (all_available) { f = BirdFont.get_current_font (); - g = f.get_glyph_indice (selected); + g = f.get_glyph_index (selected); return_val_if_fail (g != null, "".dup ()); return ((!) g).get_name (); } @@ -1120,7 +1120,7 @@ // FIXME: too slow for (r = 0; r < font.length (); r += items_per_row) { for (i = 0; i < items_per_row; i++) { - glyphs = font.get_glyph_collection_indice ((uint32) r + i); + glyphs = font.get_glyph_collection_index ((uint32) r + i); return_if_fail (glyphs != null); glyph = ((!) glyphs).get_current (); @@ -1499,7 +1499,7 @@ copied_glyphs.get (i).is_unassigned (), copied_glyphs.get (i).get_name ()); } else { - c = f.get_glyph_collection_indice ((uint32) index); + c = f.get_glyph_collection_index ((uint32) index); } if (c == null) {
--- a/libbirdfont/OverviewTools.vala +++ b/libbirdfont/OverviewTools.vala @@ -187,7 +187,7 @@ Font font = BirdFont.get_current_font (); int i = 0; GlyphCollection glyph_collection; - GlyphCollection? gc = font.get_glyph_collection_indice (i); + GlyphCollection? gc = font.get_glyph_collection_index (i); Glyph g; while (gc != null) { @@ -201,7 +201,7 @@ glyph_collection.set_selected_master (master); i++; - gc = font.get_glyph_collection_indice (i); + gc = font.get_glyph_collection_index (i); } MainWindow.get_overview ().update_item_list ();
--- a/libbirdfont/SvgFontFormatWriter.vala +++ b/libbirdfont/SvgFontFormatWriter.vala @@ -45,7 +45,7 @@ Glyph? g; Glyph glyph; - unichar indice = 0; + unichar index = 0; string uni; @@ -66,7 +66,7 @@ // regular glyphs while (true) { - g = font.get_glyph_indice (indice++); + g = font.get_glyph_index (index++); if (g == null) { break;
--- a/libbirdfont/TestCases.vala +++ b/libbirdfont/TestCases.vala @@ -141,7 +141,7 @@ for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++) { - g = font.get_glyph_indice (Random.int_range (0, (int) font.length () - 1)); + g = font.get_glyph_index (Random.int_range (0, (int) font.length () - 1)); return_if_fail (g != null); if (Random.int_range (1, 9) % 3 == 0) { k.add_kerning_class (Random.int_range (0, 9));