The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Old vertical metrics code

These changes was commited to the Birdfont repository Sun, 13 Dec 2015 17:48:19 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Sun, 13 Dec 2015 17:48:19 +0000]

Updated Files

libbirdfont/OpenFontFormat/HheaTable.vala
libbirdfont/OpenFontFormat/Os2Table.vala
--- a/libbirdfont/OpenFontFormat/HheaTable.vala +++ b/libbirdfont/OpenFontFormat/HheaTable.vala @@ -120,16 +120,10 @@ descender = (int16) rint (font.bottom_limit * HeadTable.UNITS); descender -= (int16) rint (font.base_line * HeadTable.UNITS); - - upm = HeadTable.units_per_em; - total_height = get_winascent () + get_windescent (); - ascender = (int16) rint (upm * get_winascent () / (double) total_height); - descender = (int16) (ascender - upm); - line_gap = (int16) rint (total_height - upm); - + fd.add_16 (ascender); // Ascender fd.add_16 (descender); // Descender - fd.add_16 (line_gap); // LineGap + fd.add_16 (0); // LineGap fd.add_u16 (hmtx_table.max_advance); // maximum advance width value in 'hmtx' table.
--- a/libbirdfont/OpenFontFormat/Os2Table.vala +++ b/libbirdfont/OpenFontFormat/Os2Table.vala @@ -130,10 +130,13 @@ fd.add_u16 (glyf_table.get_first_char ()); // usFirstCharIndex fd.add_u16 (glyf_table.get_last_char ()); // usLastCharIndex - - fd.add_16 (hhea_table.ascender); // sTypoAscender - fd.add_16 (hhea_table.descender); // sTypoDescender - fd.add_16 (hhea_table.line_gap); // sTypoLineGap + + int16 ascender = (int16) rint (font.top_limit * HeadTable.UNITS); + int16 descender = (int16) rint (font.bottom_limit * HeadTable.UNITS); + + fd.add_16 (ascender); // sTypoAscender + fd.add_16 (descender); // sTypoDescender + fd.add_16 (100); // sTypoLineGap // usWinAscent fd.add_u16 (hhea_table.get_winascent ());