The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Make sure windescent is a positive value

These changes was commited to the Birdfont repository Sat, 12 Dec 2015 05:33:11 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Sat, 12 Dec 2015 05:33:11 +0000]

Updated Files

libbirdfont/OpenFontFormat/HheaTable.vala
--- a/libbirdfont/OpenFontFormat/HheaTable.vala +++ b/libbirdfont/OpenFontFormat/HheaTable.vala @@ -70,7 +70,7 @@ foreach (GlyfData glyph in glyf_table.glyf_data) { if (glyph.bounding_box_ymin < winDescent) { - winDescent = glyph.bounding_box_ymin; + winDescent = -glyph.bounding_box_ymin; } } @@ -122,10 +122,10 @@ descender -= (int16) rint (font.base_line * HeadTable.UNITS); upm = HeadTable.units_per_em; - total_height = get_winascent () - get_windescent (); + total_height = get_winascent () + get_windescent (); ascender = (int16) rint (upm * get_winascent () / (double) total_height); descender = (int16) (ascender - upm); - line_gap = (int16) rint (ascender + descender - upm); + line_gap = (int16) rint (total_height - upm); fd.add_16 (ascender); // Ascender fd.add_16 (descender); // Descender