-
Notifications
You must be signed in to change notification settings - Fork 51
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
Problems going from UFOs to .glyphs using v3 file format #754
Comments
thanks for reporting this. Yes, we should add an option to set format_version to 3 for ufo2glyphs. |
The original .glifs did not have public.verticalOrigin. It was added with a value of 2100 - which is the same value as ascender in fontinfo. |
I've done some further testing on this, and discovered that the addition of verticalOrigin is not connected with v3 format support - it happens round-tripping using the standard ufo2glyphs then glyphs2ufo as well. |
To reproduce the other changes I'd reported:
Note that there will be other changes to com.schriftgestaltung... values in addition to those mentioned in my original report. Those reported were just examples. |
Any news on this? We would like to be able to start using the v3 format. |
Any progress on this? The v3 support added in 6.0.0 is pretty much useless without these basic fixes. |
Just adding in my comment that I’m currently really missing support for converting GlyphsApp “Alignment Zones” into |
This is a rather dramatic statement. Files in Glyphs 3 format can now be compiled using fontmake, and they couldn't before, so I am not sure I would call it "useless". I'm seeing a similar issue with master names going missing, so I shall take a look at this. |
Thanks for looking into the reported issues. Loss of data when going from UFO > Glyphs3 does make it useless (at least to us). As we keep our sources in UFO we need to be able to roundtrip without data loss - or at least without losing data we can't reconstruct. It would also be good for ufo2glyphs to optionally set the format_version to 3. |
Was trying to understand this today (also needing those |
maybe here? glyphsLib/Lib/glyphsLib/parser.py Lines 87 to 91 in 10f1b23
|
Okay, thanks @anthrotype for the pointer. I'm slowly starting to arrive at the problem (😅). So the v3 spec defines:
GSFontMaster::_parse_alignmentZones_dict is "version 2" only; |
Having |
Tried to get the alignment Zones to work Glyphs > UFO direction. The Also, this test breaks because of the condition in the getter, I suppose... Can one somehow "hook into" those object parsers, sort of like a callback after a particular attribute (e.g. |
Sure. That's what the "converter" field on
"Read |
@simoncozens ah yes, that's better. I'm still using the
So inside the converter I'd need to know the top level Will ponder some more. Happy to idea from people more familiar with the code base. |
Hi @anthrotype Do you think @kontur change can be integrated? It will be great to be able to psauothint fonts after using glyphsLib. |
Implements part of #754 via getter/setters for proxying the file format 3 attributes
I've just revisited this in case any changes have helped, but I'm still seeing the originally reported problems testing with glyphsLib 6.2.3.dev3+g6372da0c. |
At a minimum, getting the proper style names and settings from the designspace into the Glyphs 3 file would be a great help. That's an immediate showstopper for us, whereas we can work around some of the other issues. What would be the best way to get this moving? |
Send a PR? Yes, I'm being flippant, but it's an open source project, and not a particularly pleasant codebase to work with, which means things get fixed when either the developers need it or when someone who does need it contributes a fix. I mean, there are some things I'll work on for the craic; glyphsLib is not one of them. I only use glyphsLib for Glyphs-to-UFO conversion, so I avoid touching the other side of the code. I'm kind of surprised that DaMa (who are the main users and maintainers of UFO-to-Glyphs) haven't hit this problem already. Maybe they're all still Glyphs 2? I don't know. @madig, what do you think? |
It's certainly reasonable to expect the users (us) to do the work and send pull requests. In this case we've tried to take a look at how we'd fix it, and can't seem to figure it out. Part of that is our unfamiliarity with the intricacies of how glyphsLib works internally and the significantly different family structure model of the Glyphs3 format, whose concept of masters and layers differs from Glyphs2. If DaMa is still using Glyphs2 format (like us) then it may be wise for them to switch to Glyphs3. I don't think we can reasonably expect Georg to maintain Glyphs2 format support forever, and supporting Glyphs3 leaves the door open to future improvements (like storing data for useful v3 things in UFO data libs). |
Hello, we're still on Glyphs.app 2. We're planning to move to 3 but it's a slow move to not disrupt anything in our workflows. |
The biggest differences:
|
What Jany said. I have started writing a custom ufo2glyphs2ufo tool internally (in 🦀, based on Raph's interp-toy::glyphstool parser) because I loathe touching glyphsLib and I want the pain to stop and we have a limited amount of things we blazingly fast care about. We may release it as OSS if the stars align. It was actually fairly easy to write the direct conversion, all you need to do is take dictionaries laid out one way and transform them to a different layout, with some stealing from glyphsLib. If you don't want to wait for us and don't care to store .glyphs files in version control, you may be able to bang together a u2g2u that meets your needs in a low thousands of lines, maybe directly using openstep-plist to read and write dicts. |
My other advice would be "Move to glyphspackage for storage and rewrite whatever tools you have that work on UFO to work using glyphsLib instead". Other font editors are just as good at reading Glyphs files as reading UFOs these days, and you avoid the several disadvantages of UFO format. |
The downside then is that you still have to deal with UFO |
Well, if all your tools are Glyphs-focused, you only need to care about Glyphs to UFO for compilation. Or rather, you don't need to care about it at all; you can just ignore UFO altogether and treat it as fontmake's internal representation. |
Some reasons why we use UFO are that it is open, well-documented, nicely human-editable, and long-term stable. Where is the Glyphs 3.2 file format spec? And is it complete and accurate? We'd be very hesitant to rewrite all our UFO tools to work on Glyphs files via glyphsLib. That would only make us more dependent on and vulnerable to glyphsLib changes, and we've been bitten too many times by glyphsLib. At the moment we only depend on glyphsLib to roundtrip to Glyphs. If glyphsLib disappears we can always switch to using FontLab or Robofont or whatever comes next - or depend on Glyphs' direct UFO import/export. If we switch to Glyphs format for our canonical source we become dependent on both Glyphs and glyphsLib. Given how much I hear the people who have contributed to glyphsLib complain about how much they hate working on it - and how much behind-the-scenes work seems to be happening in Rust - I hesitate to increase our dependence. |
I’m currently working on this. You can have a look at the current state in the Glyphs3 branch. Feedback is welcome. |
Thanks for working on this. Should I be able to retest to ufo > glyphs > ufo roundtrip? I've just pulled the latest code from the branch so I'm running 6.2.6.dev125+g096839f6. gylphs2ufo is failing with:
|
Please test with the Glyphs 3 branch. you might need to manually download glyphsLib to use it. |
I thought I was on the Glyphs3 branch - 096839f seems to be the latest commit on there.
|
I just saw that I didn't push all my commits. And you send me the file and the script/command for testing? |
My testing routine, on a clone of https://github.com/silnrsi/font-andika-mtihani is:
So I had run |
Can you try with the latest state of the Glyphs3 branch? There are a bunch of differences but most of them are actual a good thing. In the .glyphs file are many duplicate custom parameters on the font/masters that are not to be there (e.g. metrics relates parameters on the font or names on the master). For testing, I have used those commands:
There are some small issues, still: e.g. Where to store instances related info (styleMapStyleName, weightClass …)? Should that go to the source.ufo/fontinfo or to instance attributes/lib? the later makes more sense for me as this can handle the case when there are more instances than sources. I’m working on that. |
I've run your test commands and they work OK, but if I try to test with --format-version 3 I still get an error:
I also noticed that if I run glyphs2ufo on the original v2 .glyphs file in the repo it also fails:
|
Any progress on this? I'd be happy to do more testing if useful. |
There was a lot other stuff in the way. I’m about to continue to work on this. |
Using v6.0.0 I've been looking at Glyphs v3 file format support.
I see that ufo2glyphs does not currently have an option to output in v3 file format. I created an edited version to test with by adding
font.format_version = 3
prior to thefont.save
section and successfully created a v3 format .glyphs file from a design space file. Is that the correct approach to use to create v3 format files?Round-tripping using that and then glyphs2ufo produced many differences. Some examples are:
Note with the postscript keys, this data does end up in a .glyphs file if it is produced by saving from the Glyphs App - for example blue values end up in Alignment Zones.
The text was updated successfully, but these errors were encountered: