Fix outline of gamma, fix pad_glyph(), add more kernings with smarter operation#97
Conversation
dummy-index
commented
May 29, 2026
- The gamma outline was broken, caused by combination of the wavy outline and changeWeight(). (a part of Minor kerning improvements #70)
- If you align positions using the values from boundingBox() without having called addExtrema() and then round them, the extrema end up in positions that are difficult to round, making it hard to converge. It's better to call addExtrema() first. (However, it seems that for a few characters, the positions of the extrema are still changing)
- Due to the above changes, the effect of automatic hinting changed, so I adjusted the BlueValues and the y-direction positions of A and N. Also, while I was at it, I corrected the lifting of j that had occurred in 3dbc5d1.
- Regarding pad_glyph(), I modified the algorithm and added comments. Due to this bug, the letter-spacing of some characters had become excessively tight.
- Added numerous kernings. Improved processing.
pelson
left a comment
There was a problem hiding this comment.
Do you think it is possible to separate the kerning changes proposed from the non-kerning changes that are here? The latter are ready to merge 👍, but I think the kerning changes need us to be on the same page, and for us to individually asses the merit of each full-set kerning change.
|
|
||
| # Expand the broad letter lists to include accented variants from the outset, | ||
| # so every rule that references `caps`, `lower`, or `all_chars` covers them too. | ||
| caps = _expand_with_variants(font, list('ABCDEFGHIJKLMNOPQRSTUVWXYZ') + upper_ligatures) |
There was a problem hiding this comment.
I'm worried we don't have much visual test coverage of the kerning between accented variants, and therefore want to be sure how how this lands for those characters, even though I can see that the expand call is done within the kern function.
Perhaps we need another sample which covers a bunch of the different languages that we have added support for?
There was a problem hiding this comment.
Yes, taking that point into consideration, in my previous fork, individual kerning was applied only to basic_latin.
| # separation required by the glyphs on the left and right.) | ||
| kern(80+a, set(lower) - {'i', 'j'}, ['f', 't', 'x'], onlyCloser=True) | ||
| # x has diagonal strokes that leave visual space on its right side. (glyph changed in 3dbc5d1) | ||
| kern(80+a, ['x'], set(lower) - {'i', 'j'}, onlyCloser=True) |
There was a problem hiding this comment.
I'm not keen to add kerning for all letter combinations, and think we should start with changing the bounding box of the character in the first instance.
Kerning should then be used when we need specific tweaks between pairs of letters because of the letter forms.
There was a problem hiding this comment.
Kerning originally refers to the process of tightening the space between characters, and by combining the width adjusted to the bounding box with onlyCloser=True, kerning settings remain only for the pairs that really need kerning.
You could say that the CPU is being made to work unnecessarily, but I think it's more reliable than a human constantly keeping all combinations in mind while checking.
That said, it caught my attention when it was mentioned, so I checked the kern table, and it turns out that *j is kerned across the board (except for gj, jj, and the like). The LSB could probably be tightened by about 20–30. Formula (capxrange[0] + bbox[0])/2 was roughly created based on the idea that 'fonts with a less curved lower part of j tend to have tighter spacing between i and j,' so it can be adjusted freely. If tightened, onlyCloser=True will take effect and automatically reduce the kerning settings.
|
I will organize d033979 and the subsequent ones, add the functions of |
398e894 to
fd32443
Compare
…ems with changeWeight()) (ipython#70)
Reduce lsb of j
Disable duplicated handling of variants
Apply the new parameter as fixed as possible to reproduce the current kerning (so as not to confuse the font designer with the added freedom)
Under the damper function, the combinations of caps-f no longer need to be excluded
bfd51a1 to
23c2ec9
Compare