From 0db79a0b97bd9f9dbf4e7a1edd9813ee632458c3 Mon Sep 17 00:00:00 2001 From: Fini Jastrow Date: Thu, 12 Jan 2023 16:55:38 +0100 Subject: [PATCH] font-patcher: Fix vertical overlap [why] The vertical overlap is still not 'pixel perfect', it is off by a small amount that differs by font. [how] The reason is the wrong formula. We take the relative widths of the glyph to calculate the factor needed to add an overlap in height. Of course we need to take the relative heights *duh*. Sometimes I think how dumb can a single person be? :-} I would say this is copy-and-paste laziness. Signed-off-by: Fini Jastrow --- font-patcher | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/font-patcher b/font-patcher index 68d8210dc..e5ca0a13e 100755 --- a/font-patcher +++ b/font-patcher @@ -1130,7 +1130,7 @@ class font_patcher: if overlap: scale_ratio_x *= 1.0 + (self.font_dim['width'] / (sym_dim['width'] * scale_ratio_x)) * overlap y_overlap = min(0.01, overlap) # never aggressive vertical overlap - scale_ratio_y *= 1.0 + (self.font_dim['width'] / (sym_dim['width'] * scale_ratio_y)) * y_overlap + scale_ratio_y *= 1.0 + (self.font_dim['height'] / (sym_dim['height'] * scale_ratio_y)) * y_overlap # Size in x to size in y ratio limit (to prevent over-wide glyphs) xy_ratio_max = sym_attr['params'].get('xy-ratio')