-
Notifications
You must be signed in to change notification settings - Fork 103
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
Rewrote small_caps check (and a minor case_mapping improvement) #4721
base: main
Are you sure you want to change the base?
Conversation
Anything using |
@dscorbett Excellent catch; I added that. @simoncozens Getting extended character metadata is probably the reason you implemented Update: looking at |
Since unicodedataplus has no external dependencies, I've refactored |
The failed check says it can't import |
Once, and then stores them. I'm not convinced of the need to add another Unicode library to avoid a single network access. |
FWIW,
Yeah, that's the question. Aren't there maybe scenarios in |
OK, yeah, not explicitly but it was a transitive dependency of stuff on the shaping profile.
This is true, and more to the point the filesystem isn't available either. So maybe it's OK. |
|
Is that a deal-breaker? I'm not a Python pro |
What do you guys think about bundling the Unicode file with Fontbakery for youseedee? My guess is that Simon didn't want to have to make new packages for every Unicode update. Or are there licensing reasons? |
note: I have posted the comment below by mistake as an edit of the original post by @simoncozens. I apologize for that. I have already edited back the post to its original contents and here's my reply:
That's an interesting aspect of dependency management. I would say that if our code uses the dep's API, then we should explicitly list the dependency, even if it would already be installed as a "dep of a dep". My reasoning is that one does not necessarily know what are the deps of the deps, as this can be considered an implementation detail of the dependency, and it would be more robust to treat the deps as black-boxes, from the point of view of dependency management. |
I'm also interested in hearing what @simoncozens thinks about this. |
Yes, my idea was to have a Python package which would always install the latest Unicode version. I genuinely didn't have WASM on my radar when I wrote it. :-) Now I see that for that environment, something which bundles the data might be better. |
Some lowercase letters don’t have uppercase counterparts or vice versa, in which case 'smcp' and 'c2sc' can’t be assumed to be meaningful. Instead of checking a character’s general category, you should check that lowercasing or uppercasing it produces a different string. I only brought up the |
'case_mapping' check on Universal profile. (PR #4721)
af1532b
to
a53a88c
Compare
'case_mapping' check on Universal profile. (PR #4721)
a53a88c
to
4e3f48c
Compare
'case_mapping' check on Universal profile. (PR #4721)
4e3f48c
to
1079d1b
Compare
'case_mapping' check on Universal profile. (PR #4721)
1079d1b
to
fdc2ae9
Compare
'case_mapping' check on Universal profile. (PR #4721)
fdc2ae9
to
4ed04f9
Compare
4ed04f9
to
bb2f185
Compare
@yanone, I've just squashed it all into a couple commits, rebased it to latest main branch and fixed all conflicts. The unicodedataplus problem with the CI job not finding the script sub-module was related to the lack of type hints for this library. So I placed a comment deactivating type checks on that import line. |
Description
(Issue #4713)
Rewrote the entirely useless
small_caps
check (0 FAILs on GF library) from scratch. It now yields for GF:Indeed, missing
smcp
orc2sc
substitutions are very common. Only 2.5% of fonts with those features are completely defined. I manually cross-checked some of the fonts. In many cases, the glyphs are present but missing from the feature code.Still, marked the check as experimental for good measure (especially since we may need a few more hard-coded exceptions here and there).
Also, moved the check from GF to universal profile.
Since I'm now excluding incomplete legacy Greek (
mu
,Ohm
, etc.) dynamically, I implemented the same for thecase_mapping
check. Hard-coding exceptions for Greek will automatically exclude them from being checked for fonts that actually support Greek. The basic Greek alphabet is 24+24 characters, so as soon as Greek support is below 24, it's now being excluded dynamically (= whatever Greek is in the font).Checklist
CHANGELOG.md
Closes #4713