Skip to content

Atkinson hyperlegible mono #1802

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

Merged
merged 12 commits into from
Apr 16, 2025

Conversation

joshestein
Copy link
Contributor

@joshestein joshestein commented Feb 20, 2025

Description

Adds Atkinson Hyperlegible Mono font.

Requirements / Checklist

  • Read the Contributing Guidelines
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan.
    Issue number where discussion took place: #xxx
  • If this contains a font/glyph add its origin as background info below (e.g. URL)
  • Verified the license of any newly added font, glyph, or glyph set. License is: SIL 1.1

What does this Pull Request (PR) do?

Adds new font. I've only patched the mono font. Source: https://www.brailleinstitute.org/freefont/

How should this be manually tested?

Run gotta-patch-em-all-font-patcher!.sh and inspect the fonts.

When I open the patched fonts in FontForge I am seeing this error:

The glyph named heart is mapped to U+F08D0.
But its name indicates it should be mapped to U+2665

I'm not sure if this is something to worry about?

Fixes: #1799

Edit Finii: Add fix link

Copy link
Collaborator

@Finii Finii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes: #1799

Weights are ExtraLight / Light / Regular / Medium / SemiBold / Bold / ExtraBold; as usual I would try to reduce the set and not include weights that are rather unlikely in terminal use.

Nice PR!

@Finii
Copy link
Collaborator

Finii commented Feb 21, 2025

I'm not sure if this is something to worry about?

No that is a fontforge message we can not suppress.

joshestein and others added 9 commits February 21, 2025 08:21
Remove `Extra*` and `Semi*` fonts
Avoid errors due to font name length
[why]
Not sure we need this, but if we have it it should be up to date.

[how]
Update from fonts.json and also add instructions for update for future
reference.

Signed-off-by: Fini Jastrow <[email protected]>
@Finii
Copy link
Collaborator

Finii commented Feb 21, 2025

Checking...

$ fontforge font-patcher --debug 2 --dry ~/Downloads/AtkinsonHyperlegibleMono-ExtraLightItalic.otf 2>/dev/null
Nerd Fonts Patcher v3.3.0-75 (4.18.1) (ff 20230101)
DEBUG: Naming mode 1
DEBUG: Monospace check: Panose is invalid ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); glyph-width-mono True
INFO: Setting Panose 'Family Kind' to 'Latin Text and Display' (was 'Any')
INFO: Setting Panose 'Proportion' to 'Monospaced' (was 'Any')
WARNING: Font vertical metrics inconsistent (HHEA 1157 / TYPO 1197 / WIN 1407), using WIN
DEBUG: Font has negative right side bearing in extended glyphs
DEBUG: Final font cell dimensions 632 w x 1407 h
Done with Patch Sets, generating font...
DEBUG: Weight approximations: OS2/PS/Name: 200/200/200 (from 200/'ExtraLight'/'ExtraLight')
ERROR: ====-< Family (ID 1)      too long (33 > 31): AtkynsonMono Nerd Font ExtraLight
DEBUG: =====> SubFamily (ID 2)   ok       ( 6 <=31): Italic
DEBUG: =====> Fullname (ID 4)    ok       (40 <=63): AtkynsonMono Nerd Font ExtraLight Italic
DEBUG: =====> PSN (ID 6)         ok       (31 <=63): AtkynsonMonoNF-ExtraLightItalic
DEBUG: =====> PrefFamily (ID 16) ok       (22 <=31): AtkynsonMono Nerd Font
DEBUG: =====> PrefStyles (ID 17) ok       (17 <=31): ExtraLight Italic
DEBUG: =====> Filename 'AtkynsonMonoNerdFont-ExtraLightItalic.otf'

Ok, --makegroups 4 is probably right, it would not be needed anymore, but keeping it for futureproof name handling.

Metrics needs investigation. Why is it using WIN, I have forgotten everything, but this feels wrong. Results in next comment.

@Finii
Copy link
Collaborator

Finii commented Feb 21, 2025

Metrics

$ ttx -o - AtkinsonHyperlegibleMono-ExtraLightItalic.otf 2>/dev/null | grep '[xy]M[ai][xn] '
    <xMin value="-66"/>
    <yMin value="-231"/>
    <xMax value="1223"/>
    <yMax value="872"/>

1223 + 66 = 1289 😬

$ font-line report AtkinsonHyperlegibleMono-ExtraLightItalic.otf
=== AtkinsonHyperlegibleMono-ExtraLightItalic.otf ===
Version 2.001;Glyphs 3.2.3 (3260)
SHA1: 1c575120b410da299e4f70d99bce1e68c6ba6af7

::::::::::::::::::::::::::::::::::::::::::::::::::
  Metrics
::::::::::::::::::::::::::::::::::::::::::::::::::
[head] Units per Em:   1000
[head] yMax:           872
[head] yMin:          -231
[OS/2] CapHeight:      668
[OS/2] xHeight:        496
[OS/2] TypoAscender:   796
[OS/2] TypoDescender: -251
[OS/2] WinAscent:      996
[OS/2] WinDescent:     411
[hhea] Ascent:         796
[hhea] Descent:       -161

[hhea] LineGap:        200
[OS/2] TypoLineGap:    150

::::::::::::::::::::::::::::::::::::::::::::::::::
  Ascent to Descent Calculations
::::::::::::::::::::::::::::::::::::::::::::::::::
[hhea] Ascent to Descent:              957
[OS/2] TypoAscender to TypoDescender:  1047
[OS/2] WinAscent to WinDescent:        1407

::::::::::::::::::::::::::::::::::::::::::::::::::
  Delta Values
::::::::::::::::::::::::::::::::::::::::::::::::::
[hhea] Ascent to [OS/2] TypoAscender:       0
[hhea] Descent to [OS/2] TypoDescender:     -90
[OS/2] WinAscent to [OS/2] TypoAscender:    200
[OS/2] WinDescent to [OS/2] TypoDescender:  160

::::::::::::::::::::::::::::::::::::::::::::::::::
  Baseline to Baseline Distances
::::::::::::::::::::::::::::::::::::::::::::::::::
hhea metrics: 1157
typo metrics: 1197
win metrics:  1407

[OS/2] fsSelection USE_TYPO_METRICS bit set: True

::::::::::::::::::::::::::::::::::::::::::::::::::
  Ratios
::::::::::::::::::::::::::::::::::::::::::::::::::
hhea metrics / UPM:  1.16
typo metrics / UPM:  1.2
win metrics  / UPM:  1.41

😭

Even the gap differs. Examining which looks best, as we can not achieve identical look on all-platforms with this metrics (the unpatched font will look already different on different platforms) 😒

Probably we should go with TYPO, as it is only slightly bigger than HHEA, and WIN is clearly wrong.

Then we have these comments in the code

        if not self.args.metrics:
            # We use either TYPO (1) or WIN (2) and compare with HHEA
            # and use HHEA (0) if the fonts seems broken - no WIN, see #1056
            our_btb = typo_btb if use_typo else win_btb
            if our_btb == hhea_btb:
                metrics = Metric.TYPO if use_typo else Metric.WIN # conforming font
            elif abs(our_btb - hhea_btb) / our_btb < 0.03:
                logger.info("Font vertical metrics slightly off (%.1f%%)", (our_btb - hhea_btb) / our_btb * 100.0)
                metrics = Metric.TYPO if use_typo else Metric.WIN
            else:
                # Try the other metric
                our_btb = typo_btb if not use_typo else win_btb
                if our_btb == hhea_btb:
                    use_typo = not use_typo   
                    logger.warning("Font vertical metrics probably wrong USE TYPO METRICS, assume opposite (i.e. %s)", repr(use_typo))
                    self.sourceFont.os2_use_typo_metrics = 1 if use_typo else 0
                    metrics = Metric.TYPO if use_typo else Metric.WIN
                else:
                    # We trust the WIN metric more, see experiments in #1056
                    logger.warning("Font vertical metrics inconsistent (HHEA %d / TYPO %d / WIN %d), using WIN", hhea_btb, typo_btb, win_btb)
                    our_btb = win_btb
                    metrics = Metric.WIN

Ah, abs(1197 - 1157) / 1197 < 0.03 but it is 0.033 😬

Will add a commit that switches to TYPO.

joshestein and others added 2 commits February 21, 2025 09:12
[why]
The automatic metrics chooser comes up with the wrong metric (WIN)
because the allowed difference of TYPO and HHEA (which is 3%) is
slightly missed here with 3.3%.

[how]
Manually select TYPO metrics.

[note]
See discussion in ryanoasis#1802

Signed-off-by: Fini Jastrow <[email protected]>
@Finii
Copy link
Collaborator

Finii commented Feb 21, 2025

Hmm, Atkinson is missing from reservedFontNameReplacements, but then, there are also others missing like Anonymous Pro which is really old.

Maybe we should finally drop the old stuff and use the new renaming table also for the legacy naming mode. 🤔

I'll do a force push now, to get rid of the fonts you removed (squashing bot commits). Because otherwise the removed fonts will be in the repo still, adding to the size. You know how to get your local repo in sync? (No need to answer with: yes ;)

@Finii Finii force-pushed the atkinson-hyperlegible-mono branch from 3314e56 to 6e74c18 Compare February 21, 2025 08:31
@Finii
Copy link
Collaborator

Finii commented Feb 21, 2025

Is there a specific reason you use the otf variants? Or just because they are in the 'root' directory of the release archive?

The ttfs are in For Professional Use Only/Web Fonts/TTF/ 😬

Will check the feature set.

@joshestein
Copy link
Contributor Author

No, it was just because they were in the root directory.

@Finii
Copy link
Collaborator

Finii commented Feb 21, 2025

ttf vs otf comparison

image
Font-diff with hint differences suppressed

The differences are not visible.
Strange that the D-caron is a composite in ttf but not in otf 🤔 🤷‍♀️

@Finii
Copy link
Collaborator

Finii commented Feb 21, 2025

$ ./gotta-patch-em-all-font-patcher\!.sh -j Atkinson
# [Nerd Fonts]  Filter given, limiting search and patch to filename pattern 'Atkinson'
# [Nerd Fonts]  Total source fonts found: 8
# [Nerd Fonts]  Release timestamp is Fri, 21 Feb 2025 10:13:31 +0100
# [Nerd Fonts]  Processing font 1/8
# [Nerd Fonts]  Processing font 2/8
# [Nerd Fonts]  Processing font 3/8
# [Nerd Fonts]  Processing font 4/8
# [Nerd Fonts]  Processing font 5/8
# [Nerd Fonts]  Processing font 6/8
# [Nerd Fonts]  Processing font 7/8
# [Nerd Fonts]  Processing font 8/8
Nerd Fonts Patcher v3.3.0-77 (4.18.1) (ff 20230101)
INFO: Adding config commandline options: --makegroups 4 --metrics TYPO
...

Well, the cell center is about the x-height-center, which is ok I guess.

image

🤔 Would be a nice new debug value, x-height-center, cell-center, cap-center

@Finii Finii added this to the v3.4.0 milestone Feb 21, 2025
@Finii Finii added the Ready ⛱ Ready to merge but waiting to be merged near a release label Feb 21, 2025
@Finii
Copy link
Collaborator

Finii commented Feb 21, 2025

Will pull shortly before the release, as the website is updated instantly and that would point to a non-existing release file 😬

Thanks again

@Finii
Copy link
Collaborator

Finii commented Feb 21, 2025

@allcontributors please add @joshestein for code

Copy link
Contributor

@Finii

I've put up a pull request to add @joshestein! 🎉

@Finii
Copy link
Collaborator

Finii commented Feb 21, 2025

🤔 Would be a nice new debug value, x-height-center, cell-center, cap-center

Implemented and merged in 1462317

[why]
This flag has been introduced meanwhile, so all new fonts should set it.

Signed-off-by: Fini Jastrow <[email protected]>
@zurdala
Copy link

zurdala commented Apr 4, 2025

Can't wait to have this! Thank you, guys, for putting the time. I love this font

@Finii Finii merged commit c6ecdac into ryanoasis:master Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❲Aa❳ new font Ready ⛱ Ready to merge but waiting to be merged near a release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the Braille Institute's Atkinson Hyperlegible™ font
3 participants