Skip to content
This repository has been archived by the owner on Nov 7, 2021. It is now read-only.

Fix undersized glyph bounding boxes for click support #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lostfictions
Copy link
Contributor

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.

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 problem
discussed in Chman#11.
@gnustoboz
Copy link
Contributor

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.

@lostfictions
Copy link
Contributor Author

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.

@Chman
Copy link
Owner

Chman commented Oct 16, 2015

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 ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants