Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
font-patcher: Add ratio limit to xy scale
[why] The powerline glyphs (and only them) undergo a xy scaling, where both dimensions are maximized into the 'cell'. Normally cells are taller than wide, and everyting looks fine. But we have square cells (e.g. 2048 * 2048) with the SymbolsOnly font, and there might be some self patched font that has similar very-wide (in comparison to hight) cells. In these fonts some powerline glyphs look rather ugly. For example the 'half cicles' become very wide and un-round, the triangulars become very pointy. [how] Add a new patch-set attribute 'xy-ratio'. When that is set the vertical (y) scaling is done as usual but the horizontal (x) scaling is limited such that the width/height ratio is maximally the attributes value. For example setting it to 0.75 the height is maximized (as usual) but the width is maximized to be less then 0.75 times the hight (or as wide as the cell is, whatever is smaller). It will work with both, 'xy' and 'pa' scaling, at least theoretically. It has been only checked where it is used now, i.e. with 'xy'. A possible overlap is not taken into account. [note] The values are taken for this reasons: - 0.59: This is the original half-circle ratio, higher values make them loose the (half) circular appearance - 0.5: The half circle lines are more shallow - 0.7: The triangulars should not be too pointy (random number) Fixes: ryanoasis#658 Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
- Loading branch information