-
Notifications
You must be signed in to change notification settings - Fork 94
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
Couldn't merge the fonts (GPOS.table.FeatureList.FeatureCount) #894
Comments
Trying to bisect my way to the culprit, I find that if I remove the following glyphs from
|
thanks for the report and for the reproducer. |
I fixed the confusing error message in fonttools/fonttools@8d99250 it now looks like below when building your Intra.designspace with fontmake:
|
Ah! Thank you. |
Hi @rsms, @anthrotype
|
@emmamarichal which version of ufo2ft have you got installed? Try The issue seems to be that some masters ends up with an additional We need to debug why this happens. Do you have any manually written kern feature code in any of the master's We can try to export the masters to UFO with $ python -m ufo2ft.featureWriters KernFeatureWriter --output master_ufo/Fontexample-Regular_modified.ufo master_ufo/Fontexample-Regular.ufo
$ python -m ufo2ft.featureWriters KernFeatureWriter --output master_ufo/Fontexample-Bold_modified.ufo master_ufo/Fontexample-Bold.ufo
# ... Then diff the respective features.fea files of the thus modified UFOs and see if you spot anything that signals that one font would end up with GPOS table with 5 feature records instead of 4... |
I use 2.28.0 version. Thank you, I'll try that and tell you what I get! |
@anthrotype I understood the whole process you explain, but I never used ufo2ft, my question will sound stupid, but how to run ufo2ft kernFeatureWriter on ufos? I didn't find a --help that explains how to use this |
no worries! Don't the commands I wrote in my earlier comment (#894 (comment)) work? One can run one or more feature writers on a UFO from the console by running the command |
oh looks like I messed up the order of the arguments in the commands above, you're right. The first argument is the path to the input UFO, then any following arguments are the names of feature writer classes. $ python -m ufo2ft.featureWriters --output master_ufo/Fontexample-Regular_modified.ufo master_ufo/Fontexample-Regular.ufo KernFeatureWriter
$ python -m ufo2ft.featureWriters --output master_ufo/Fontexample-Bold_modified.ufo master_ufo/Fontexample-Bold.ufo KernFeatureWriter
# ... |
I used |
Maybe I missed something? I'm not very good using the command line haha
|
defcon-like Font(path) doesn't work anymore googlefonts/fontmake#894 (comment)
oops you're right, there's a bug sorry! LOL |
@emmamarichal please try again after installing ufo2ft from that
|
No problem, thanks a lot for your help! |
yes, it looks like
It's ufo2ft's kernFeatureWriter that is producing the kern feature from the kerning data in the master UFO's What does the |
Hi @anthrotype ! |
I just got the following on a font that was able to compile using an older version of fontmake.
I tried building using --feature-writer KernFeatureWriter but same result. I wonder how can I debug this on a font with 16 masters 😬 Any help it’s appreaciated |
@guidoferreyra If you're using ufo2ft 2.31.0, you are likely running into the exacerbated problem of missing kerning in at least one of your sources. The new kerning feature writer splits kerning into different lookups by script, which means that if one source has kerning for all scripts, but a fresh new source without full kerning coverage yet will get fewer lookups, and then merging fails. Try inserting empty glyph-to-glyph kerns for each script in your new source, or copy-paste existing kerning pairs over and set them all to zero. The real solution is either googlefonts/ufo2ft#635 or a change in varLib or ufo2ft to insert empty kerns or lookups, but I still don't understand what varLib does while merging, so that effort has stalled so far. |
Hi @madig Thanks for you detailed reply I will try what you said. |
cc @m4rc1e @simoncozens
I don't have the part concerning the kern features
I still tried to add kerning just in case, thanks to this script: If someone has any clue it would be awesome! |
some masters end up with more kern lookups than others. the new kern feature writer splits kerning lookups by script, if you have kerning for some scripts but not in others you may end up with master GPOS with different number of kerning lookups. Another source of discrepancy might be the fact that the kern writer may generate distinct lookups (one with and other without try compiling each individual master UFOs and passing |
Great, thank you, I'll try that! |
Alternatively, run the script from https://gist.github.com/madig/76567a9650de639bbff51ce010783790 on the offending Designspace. It will fill in the kerning. Don't commit the changes though 😬 |
If you're using GlyphsApp, here's a terrible script to pad the kerning, https://gist.github.com/m4rc1e/999669c69fe8e7c16997bbdd21ed89af. Copy and paste it into your macro window. I've padded the missing kerns with -1 because 0 doesn't seem to work (cba to look into this). |
After upgrading to fontmake 3.6 from 3.5 my build fails with a similar message as discussed here. If I downgrade fontmake to 3.5, it works as expected.
If I run fontmake with
There are no warnings. Here's a complete transcript: https://gist.github.com/rsms/1685cb4e86982851e39261e075dd66d1 Reproduction: git clone https://github.com/rsms/inter.git
cd inter
git checkout --detach 11c9e05d7f1642e818634976f4db03fa6e612455
patch -p1 <<PATCH
diff --git a/Pipfile b/Pipfile
index 2a3e3a96d..62f85699d 100644
--- a/Pipfile
+++ b/Pipfile
@@ -7,2 +7 @@ name = "pypi"
-ufo2ft = "==2.30.0"
-fontmake = "==3.5.*"
+fontmake = "==3.6.*"
PATCH
make DEBUG=1 var |
@rsms I suspect this might have been caused by the following change in ufo2ft kernFeatureWriter googlefonts/ufo2ft#720. Note I'm not 100% sure as I haven't tested my assumption but you may wish to try revert that PR and see if it fixes your issue. /cc @simoncozens |
Yeah, this is the cause of the failure. The simple solution is to zero the width of the commabelowcomb in all masters. Currently they're treated as zero-width marks in some masters but not in others. |
filed separate issue #1036 |
Here's a script which should help further debug merger issues: https://gist.github.com/simoncozens/35fc0f75993673ae38b1f1179c7e35f6 |
While building a relatively small and simple variable font without features, I'm getting an error "Couldn't merge the fonts, because some values were different, but should have been the same." The UFOs are generated from a .glyphs file by glyphsLib. If I export the font inside Glyphs it works just fine (and the resulting ttf is good.)
However, if I remove all glyphs except /.undef /a and /A the build succeeds. So I'm guessing this is an issue related to anchor data in
*.ufo/glyphs/*.glif
files (which I guess is used to construct mark tables.)I'm included a copy of the source files to be used for debugging and repro:
src.zip
Example:
Versions:
fontmake --version # = 3.3.0
python --version # = Python 3.9.12
The text was updated successfully, but these errors were encountered: