The Birdfont Source Code


All Repositories / birdfont.git / commit – 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
author Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 13 Dec 2015 17:48:19 +0000 (18:48 +0100)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 13 Dec 2015 17:49:21 +0000 (18:49 +0100)
commit 646ae1de0c99744f3f7fc2297f9d372afe1f8962
tree a4ab75b55c611783412ab11966659528d155eba4
parent c5a0f468d3468202d879550ff3b065a1fc546623
Old vertical metrics code

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 ());