Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jk/tex gyre heros #1897

Merged
merged 7 commits into from
May 16, 2022
Merged

jk/tex gyre heros #1897

merged 7 commits into from
May 16, 2022

Conversation

jkrumbiegel
Copy link
Member

@jkrumbiegel jkrumbiegel commented May 8, 2022

This PR adds four fonts to Makie, TeX Gyre Heros Regular, Bold, Italic and Bold Italic. It also sets the default font to Heros Regular. TeX Gyre Heros is a free Arial / Helvetica lookalike.

These fonts are not exactly the originals from https://ctan.org/pkg/tex-gyre-heros but slightly modified with www.glyphrstudio.com. The issue with the original fonts was that they have an unusually high ascender which causes problems with vertical centering, default line heights and boundingbox sizes. Our current logic determines glyph boundingboxes from font descender to ascender. Therefore, characters are centered too low visually if the ascender is very large. Rather than overhaul the whole layout system to deal with these peculiarities, it seemed simpler to just create modified fonts that have less extreme descenders and ascenders. I set the descender to the small g extent and the ascender to the mirror of that above the cap height of M. That naturally centers the font correctly for numbers when centering with the boundingbox and generally looks good in legends as well.

Also I set the titles to bold font because that tends to be easier to parse visually in facet plots and in the future, subtitles should be optional and both title and subtitle in regular font looks bad.

@jkrumbiegel jkrumbiegel reopened this May 16, 2022
@MakieBot
Copy link
Collaborator

MakieBot commented May 16, 2022

Compile Times benchmark

Note, that these numbers may fluctuate on the CI servers, so take them with a grain of salt.

using time

master:  14.96 < 15.03 > 15.09, 0.05+-
pr:      14.96 < 15.06 > 15.17, 0.08+-
speedup: 0.99 < 1.00 > 1.01, 0.01+-
median:  +0.21% => invariant

This PR does not change the using time.

ttfp time

master   31.39 < 31.54 > 31.88, 0.16+-
pr       30.77 < 31.47 > 31.55, 0.27+-
speedup: 1.00 < 1.00 > 1.04, 0.01+-
median:  -0.24% => invariant

This PR does not change the ttfp time.

@jkrumbiegel jkrumbiegel merged commit f0ad032 into master May 16, 2022
@jkrumbiegel jkrumbiegel deleted the jk/tex-gyre-heros branch May 16, 2022 13:52
kunzaatko pushed a commit to kunzaatko/Makie.jl that referenced this pull request May 16, 2022
* add edited tex gyre heros makie fonts
* change title defaults to bold
* change font in layout tutorial
* add news entry
* fix test against floating point inaccuracy
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.

None yet

3 participants