Skip to content

Improve the bounding box around r and g, reducing the need for kerning#88

Merged
pelson merged 3 commits intoipython:masterfrom
pelson:fix/bboxes
May 7, 2026
Merged

Improve the bounding box around r and g, reducing the need for kerning#88
pelson merged 3 commits intoipython:masterfrom
pelson:fix/bboxes

Conversation

@pelson
Copy link
Copy Markdown
Member

@pelson pelson commented May 4, 2026

Improve the bounding box around r and g, reducing the need for kerning (especially no need for kerning all letters)

I think we need to do the same for e and j. The spacing between gj is particularly large.

Comment thread xkcd-script/generator/pt7_font_properties.py
Comment thread xkcd-script/generator/pt7_font_properties.py
@pelson pelson force-pushed the fix/bboxes branch 2 times, most recently from 4eb1a0e to 4dee7e0 Compare May 5, 2026 03:41
@pelson pelson requested review from Carreau and rgbkrk May 5, 2026 03:42
@dummy-index
Copy link
Copy Markdown
Contributor

I don't think it's smart to adjust things so that certain letters can avoid kerning settings. If you're going to adjust the left bearing of 'g' until the bowl sticks out, are you also planning to do the same for the left side of 'o'?

For example, if you perform proactive width adjustments only on the right side, and handle processing for tails of letters like 'g' and 'j' on the left side, could autokern be unified in the form of (xxx, all_chars, 'x')... I wonder.

@pelson
Copy link
Copy Markdown
Member Author

pelson commented May 6, 2026

I don't think it's smart to adjust things so that certain letters can avoid kerning settings. If you're going to adjust the left bearing of 'g' until the bowl sticks out, are you also planning to do the same for the left side of 'o'?

I think you're misunderstanding my intent - I believe that kerning is acceptable and necessary to make the font clean and convincing, however I also believe that if we are applying kerning to all letter pairs for a given letter, then we have the bounding box wrong in the first place. With your example, I would adapt the bounding box for o until it fits well next to B, and then kern when it needs it for a pair such as To.

@dummy-index
Copy link
Copy Markdown
Contributor

I agree with that way of thinking. If that's the case, isn't the g curve sticking out by about 20 units a sign that we need to reconsider space = 20 in the first place? Actively incorporating ligatures from handwriting_minimal inevitably means aiming to reproduce the spacing of handwriting_minimal. First, change the right side bearing from space * 2 to space…

Please continue with this PR as is.

@Carreau Carreau removed their request for review May 6, 2026 08:39
@pelson pelson merged commit 8584d7a into ipython:master May 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants