The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Better parsing of TrueType outlines

These changes was commited to the Birdfont repository Sun, 31 May 2015 20:01:24 +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, 31 May 2015 20:01:24 +0000]

Updated Files

libbirdfont/BirdFontFile.vala
libbirdfont/OverViewItem.vala
libbirdfont/Renderer/FallbackFont.vala
--- a/libbirdfont/BirdFontFile.vala +++ b/libbirdfont/BirdFontFile.vala @@ -738,6 +738,7 @@ if (t.get_name () == "weight") { font.weight = int.parse (t.get_content ()); } + if (t.get_name () == "images") { parse_images (t); } @@ -1391,7 +1392,7 @@ } public static void close (Path path) { - EditPoint ep1, ep2; + EditPoint ep1, ep2, last; if (path.points.size < 2) { warning ("Less than two points in path."); @@ -1404,10 +1405,12 @@ path.points.remove_at (path.points.size - 1); - ep2.tie_handles = ep1.tie_handles; - ep2.left_handle.angle = ep1.left_handle.angle; - ep2.left_handle.length = ep1.left_handle.length; - ep2.left_handle.type = ep1.left_handle.type; + if (ep1.type != PointType.QUADRATIC || ep2.type != PointType.QUADRATIC) { + ep2.tie_handles = ep1.tie_handles; + ep2.left_handle.angle = ep1.left_handle.angle; + ep2.left_handle.length = ep1.left_handle.length; + ep2.left_handle.type = ep1.left_handle.type; + } path.close (); }
--- a/libbirdfont/OverViewItem.vala +++ b/libbirdfont/OverViewItem.vala @@ -48,8 +48,7 @@ this.y = y; this.character = character; this.glyphs = glyphs; - this.info = new CharacterInfo (character, glyphs); - info.set_position (x + width - 17, y + height - 22.5); + this.info = new CharacterInfo (character, glyphs); label = new Text ((!) character.to_string (), 17); truncate_label (); @@ -110,10 +109,9 @@ bool a; GlyphCollection g; bool s = (x <= px <= x + width) && (y <= py <= y + height); - + if (has_icons () && glyphs != null) { g = (!) glyphs; - version_menu.set_position (x + width - 21, y + height - 18); a = version_menu.menu_item_action (px, py); // select one item on the menu if (a) { @@ -123,6 +121,7 @@ version_menu.menu_icon_action (px, py); // click in the open menu } + info.set_position (x + width - 17, y + height - 22.5); if (has_icons () && info.is_over_icon (px, py)) { MainWindow.get_overview ().set_character_info (info); }
--- a/libbirdfont/Renderer/FallbackFont.vala +++ b/libbirdfont/Renderer/FallbackFont.vala @@ -151,9 +151,6 @@ if (glyph_data == null) { font_file = find_font (font_config, (!) c.to_string ()); if (font_file != null) { - printd ((!) font_file); // FIXME: DELETE - printd ("\n"); - font = open_font ((!) font_file); glyph_data = get_glyph_in_font (font, c); close_font (font);