-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
font-patcher: Redesign ScaleGlyph parameter
[why] While patching for --mono with Font Awesome we get glyphs that are too wide, for example '_520' (0xF22B). In the symbol font original it is about 1918 wide. According to ScaleGlyph FONTA_SCALE_LIST it shall be scaled as 0xF17A - which is only 1664 wide. This results in too wide symbols in the patched font. [how] The ScaleGlyph dict works like this: - 'ScaleGlyph' Lead glyph, which scaling factor is taken - 'GlyphsToScale': List of (glyph code) or (list of two glyph codes that form a closed range)) that shall be scaled Note that this allows only one group for the whole symbol font, and that the scaling factor is defined by a specific character, which needs to be manually selected (on each symbol font update). The redesign drops 'ScaleGlyph' and changes the glyph list to: - 'GlyphsToScale': List of ((lists of glyph codes) or (ranges of glyph codes)) that shall be scaled Each item in 'GlyphsToScale' (a range or an explicit list) forms a group of glyphs that shall be as rescaled all with the same and maximum possible (for the included glyphs) factor. The old data structure is automatically rewritten to new entries. [note] This commit just changes the algorithm. As the new ScaleGlyph is not used for any font, there is no change in the patched fonts. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
- Loading branch information
Showing
1 changed file
with
69 additions
and
29 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