-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[twin-font] Clean up font data by joining lines and closing paths
Two changes here: * Replace move_to;line_to;move_to;line_to sequences with move_to;line_to;line_to when feasible. * Close paths for round glyphs. Both improve the stroke rendering of the joint. The first change also saves 3 bytes per joint (33 such joints). Which we have just left unused for now. To reclaim them one need to update the charset table. Something for a lazy Sunday afternoon scripting task. In the saving department, we can save further by: - Getting rid of the left/ascent/descent values as we compute glyph bounding box automatically. Then we can liberally use the right value to adjust glyph advance width. Saves three bytes per glyph (there's 96 glyphs in the font). - First operation is always a move_to. So we can remove the 'm' for that. Ugly though. And the charset has zeros for the first 32 entries. Can get rid of that too at the expense of handling it in the code... In total, combining the above we can save some 500 bytes. The font currently takes about 3.7kb.
- Loading branch information
Behdad Esfahbod
committed
Sep 25, 2008
1 parent
d5a9983
commit f8542dc
Showing
2 changed files
with
91 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.