Italic correction heuristics (mainly for text fontfaces in math) #148
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Concerning #9
In
horizontal_layout, implement a heuristic for italic correction.Inspecting elements pairwise. For pairs of
TeXChar, look atis_slantedproperty to determine rules and addSpacesimilar to whatsiledoes.There is an additional rule for transition from upright to italic: NewComputerModern has large positile bearing for some italic glyphs that don't go under the baseline. We reduce this bearing, but don't set it to zero, which could make some letter combinations look too squished.
For this to work,
TeXCharconstructor now sets.is_slantedbased onfont_id, otherwise changes due to\mathrm& similar are not propagated correctly.With some trickery the correction seems to work in
:delimitedgroups as well :)BTW, I changed the y-position computation for
:delimitedto better center parentheses.To test #110 I made the changes in e66cce5 and it looks good:
This pull request is a bit all over the place, but if you want to I can separate the italic correction heuristic from the parentheses computations...