Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
font-patcher: Shift glyphs in a ScaleGlyph identically
[why] Ranges of glyphs in the ScaleGlyph shall be handles 'as one' glyph, utilizing the same scale (and new: the same shift) for each of them. The shift has been ignored until now; each glyph is shifted based on its individual bounding box and not the combined bounding box. This is needed now for Braille glyphs, where the relative position of an identical 'dot' is of significance. [how] We use the ScaleGlyph's new combined bounding box feature (previous commit) to do the shifting based on that virtual box instead of the concrete glyph's box. For this to work we always prepareScaleGlyph(); previously we only did it if we needed the scale for --mono. Because we do the shifting after the scaling the combined bounding box also needs to be scaled. Cave: The actual glyph transformation (scaling) is not exact and incurs rounding errors. To prevent that we usually first scale, then determine the new bounding box (which is slightly different from what mathe- matically would be expected), then do the shift based on the new BB. This can not be done with our 'virtual' bounding box, so we resort to the 'mathematically correct' shift, which can be off by some 0.x %. Do not use this on glyphs that shall go right to the border of the font 'cells'. To enforce this it is only active if we have a negative 'overlap' (i.e. padding) around that glyphs. Signed-off-by: Fini Jastrow <[email protected]>
- Loading branch information