Typogenic icon indicating copy to clipboard operation
Typogenic copied to clipboard

Fix undersized glyph bounding boxes for click support

Open lostfictions opened this issue 8 years ago • 3 comments

The removed line of code doesn't actually prevent unclickable dead zones, but it DOES sometimes lead to the generated per-glyph bounding boxes used for click support to be too small (the demo's Arial letter 'j' is a good example.) This should alleviate the third problem discussed in #11.

lostfictions avatar Sep 19 '15 20:09 lostfictions

Works for me, although one thing that probably does need to happen there instead of the removed line is

r.width += Tracking;

to extend each glyph's click bounds out to cover the space between glyphs if character spacing / tracking is set to > 0 (actually removing the resulting unclickable dead zones within words), and also reduce the degree of bounds overlap if tracking is < 0.

For the xAdvance logic I could have just been working with some screwy font data previously or something but I'll see what I can dig up later.

gnustoboz avatar Sep 21 '15 15:09 gnustoboz

Adding the tracking makes a lot of sense to me -- I'll try it to make sure it doesn't do anything unexpected and amend this PR.

Yeah, not too sure what the xAdvance stuff would have been doing previously -- I can try it with a few alternate fonts to double-check that it's not correcting wonky behaviour under different circumstances.

lostfictions avatar Sep 22 '15 02:09 lostfictions

Hey guys, sorry I've been quite busy these days so I'm just getting up to speed here and I unfortunately don't have much time to test this one extensively, but as @gnustoboz noted, how does it work with Tracking != 0 ?

Chman avatar Oct 16 '15 07:10 Chman