-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
font-patcher: Remove CV lookups in Iosevka #750
Conversation
[why] For some reason fontforge is unable to pack all the lookup tables of Iosevka back into the generated font, although they fit obviously in the source font. The lookup tables will become garbled and fontforge says something like: Attempt to output 67666 into a 16-bit field. It will be truncated and the file may not be useful. As this also happens if we do nothing, just open and generate the font without touching, there is not much we can do. [how] The only thing we can do is reduce the number of lookup tables that are in the font file. This is somewhat brute, but at least we end up with a usable font, albeit with a little bit less features. Unfortunately the SS (Style Set) tables are not enough, but the CV (Character Variants) suffice. So all CV lookups are riped out. Fixes: #694 Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
It can be discussed if that is the right soluion, or if CV is used by anyone (urgently needed). Maybe we could remove other tables instead. But it's hard to decide on which and make the decision future proof. |
Used number of lookup tables to identify Iosevka... For comparison here the number of lookup of all fonts in
So that is obviously not a good metrics for total lookup size. But ok-ish for our purpose? |
Iosevka can be manually compiled with cv's selected. So a manual patch is always possible. |
#717 ... it\s ready albeit the not-ready state ;) No wait, WWS you say? Normally 717 should be enough, no? |
WWS family has to have Nerd Font appended to it, or Iosevka nerd font will be treated as a variant of Iosevka rather than a seperate font. |
But you did have a look at 717? It sets ID 1 & 2 (Family and SubFamily) and 16 & 17 (Typographic Family and Typographic Subfamily/Style). WWS Family ... normally is not set:
And 717 is specifically designed to make 16/17 (and 1/2) to obey the customary rules) That is why I ask. Did you try 717 and still need WWS? What constellation? |
On my systems it seems that WWS is overriding typographic family. And let's move this to 717 |
Does this work for the ss0x ttfs? |
I do not understand the question? Stylistic Sets are untouched. Only Iosevka has that many tables. Hmm. ?? |
I was talking about Iosevka's ttfs that have ss pre-applied. Because their file size is much smaller I wasn't sure if detecting via look up table size would work. I tried this branch on them and it still removes the cv's though, so there is no concern. |
Oh. In It detects the number of lookup tables, not size (which is much more involved to determine). :-) |
Seems you are on Or am I wrong? |
Oh my bad, i forget that the fix is still in pull request. I will try with switching branch soon. |
I'm still use font patcher in master branch, and try to use other Iosevka variant called "Iosevka Fixed" that contain no built in ligature and no built in glyph. Here is newest screenshot with "Iosevka Fixed" variant And here package list link for description about Iosevka Fixed. https://github.com/be5invis/Iosevka/blob/v11.2.4/doc/PACKAGE-LIST.md I think font patcher will get error if there's some built in ligation and glyph, especially in Iosevka |
No idea if the ligation is the real issue. There are some ligatures that have CVs as well. |
Trying font patcher from branch "bugfix/Iosevka-lookups" , still not successful to patch Iosevka Font with custom build. Still showing "Done with Patch Sets, generating font...
Internal Error: Attempt to output 65574 into a 16-bit field. It will be truncated and the file may not be useful." Here i attach Iosevka custom build in this comment, maybe you can try to patch and debugging font patcher with it. |
Ligatures are no problem, and I persoanlly like the 'programming' ligatures - and use Nerd Fonts with ligatures ever since. The problem is that Iosevka has a lot lookup tables, and when we (i.e. |
Hmm, patching is no problem with Regular. And that files has only 157 tables, so it would not need the Dropping of tables would be shown where the red arrow is: and comes out without error: I tried with
and HEAD (self built). Ah, you have Italic in the name, so you probably did this? which also has no issues here |
Can reproduce. |
I more and more think this is a The GSUB table is big, one can not use
GPOS is even bigger, is processed before GSUB, and has no issue although it is generated by the same function! Continuing to examine whilst doing Zoom 🥱 |
Found. Creating patch over there. |
I'm not sure what we should do with this issue. This PR does not work reliably, maybe I can come up with an intermediate solution. |
Fontforge merged the bugfix into MASTER, so in principle we could generate the patched Iosevka with a self-build But somehow we need a solution for self patcher that use an older |
Fixed via #884 |
[why]
For some reason
fontforge
is unable to pack all the lookup tables ofIosevka back into the generated font, although they fit obviously in the
source font.
The lookup tables will become garbled and
fontforge
says something like:As this also happens if we do nothing, just open and generate the font
without touching, there is not much we can do.
[how]
The only thing we can do is reduce the number of lookup tables that are
in the font file. This is somewhat brute, but at least we end up with a
usable font, albeit with a little bit less features.
Unfortunately the SS (Style Set) tables are not enough, but the CV
(Character Variants) suffice. So all CV lookups are riped out.
Fixes: #694
Requirements / Checklist
What does this Pull Request (PR) do?
Remove the CV lookup tables from all Iosevka variants.
Other fonts in the
src/unpatched-fonts/
are not affected/changed.How should this be manually tested?
Any background context you can provide?
Fontforge
bugunexpected behavior. Even in interactive mode we can not open and directly (unmodified) the Iosevka fonts in opentype format. See #694What are the relevant tickets (if any)?
#694 and possibly #742
Thanks @xsrvmy for the hint in #742 (comment)
Screenshots (if appropriate or helpful)