-
Notifications
You must be signed in to change notification settings - Fork 8
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
Updating the build system and fonts #16
Conversation
Split sources apart to create common / differentiated sets. Implemented compression / extraction functionality for ufoz. Implemented glyph merger to create ready-to-build UFOs. First pass at build system. TO DO - Test build system. Update .fea code to resolve oddities. Re-implement avg character width fix. Double check vs original UFOs.
Existing feature code is broken. Reworked build system to implement cohesive feature code across all UFOs and building from it. Deleted extraneous glyphs from non-Mono version. Implemented avgCharWidth fix. TO DO - build everything, and test implementation. compare to original
Re-worked the build system. Now there's just one copy of each glyph and the common glyphs are merged in to the individual differentiated font variants. Updated sources to address FontBakery errors
Hi @aaronbell, thank you for your help to proceed with the build process. However, I have communicated with the font author (which does not know about build process) which has pointed out some issues going forward: He is planning to stop maintaining the font after CJK Ext-J block is released in Unicode next year, and there are pending changes to be integrated into the font now at his local sources (which are not based on UFO - UFO are generated artefacts after building the font). As such, the current build flow is proposed and maintained by me. Here are a few questions regarding the build process and the future of other versions of LXGW Wenkai:
|
Hello! I totally understand your apprehension. Let me address your questions.
Correct. the
Essentially, the difference is that the
At present I am only contracted to update Wenkai TC. This isn't to say that the others won't be updated as well, but TC is the only one that is currently prioritized.
Yes, I can do that, no problem. My intention behind this is to actually make it easier to maintain — there is only one copy of each glyph, and one copy of the feature code for the entire set of fonts (stored in |
adding build system
I've reviewed the changes and most seem reasonable. A few questions though:
|
Yes, though it is worth keeping in mind that the
There was a misalignment between winAscent / winDescent and the hhea values, so I aligned those. I also noted that the Mono version differed from the standard version, so I changed the metrics to align with the standard. Unless there was a particular reason to have the two versions differentiated? Happy to modify further, I just thought it best to keep everything aligned.
IIRC, it was actually preventing linking because the macStyle and other bits weren't set correctly. Fontmake can figure out how to set the font metadata correctly, so I just updated the source metadata to ensure it knew what to set :)
Sure |
The monospaced edition takes the mertics of Sarasa Sans Mono as reference, which are more suitable for coding (See lxgw/LxgwWenKai#56). As such, the metric data of the monospaced edition differs from that of the proportional edition. |
Is it required to update the lib.plist when adding new glyphs in the common UFOZ file? There's a GlyphOrder list there. Also may I ask what's this key is for? com.schriftgestaltung.appVersion |
Also updated the original source with some additional glyphs that were missing and removed the softhyphen.
The following glyphs shouldn't be involved in common ufoz files due to the difference between proportional and monospaced editions of these glyphs.
|
@NightFurySL2001 @lxgw I've updated the ufoz to be a duplicate of the original ones that were supplied in the repro. Well, close to a duplicate, since I added a few additional glyphs and removed one (00AD). If you could ask the designer to use the new versions of the files, then they can update that file on the repro and it'll pull in the new version.
Generally I'd agree, except that those glyphs are probably either 500 or 1000 ADW in both the proportional and monospace versions of the font. So for that reason it doesn't matter. |
No. That's just the specific glyph order for the font, but when building it'll pull in anything that's in the glyphs folder
That's an artifact of the conversion that I did (using Glyphs) that records the current version of Glyphs, as newer versions can affect how things work. |
Here is update flow in future:
|
@aaronbell I have checked the new font files and UFO source files in the fork repo, and the vertical metrics have been lost. It should be because I exported the ufo file with FontForge in the first place. Could you help to add the vertical metrics back? The advanced height of each glyph is 1000 and the
Additionally, I'd still like to include the monospaced edition for these glyphs since there is a significant spacing change for monospaced edition for these glyphs (the outlines of these glyphs are narrower in the monospaced edition than in the proportional edition), also it'll be easier for me to maintain as essentially the whole ASCII region and LCG will be separated cleanly. I'd appreciate it if you could address these issues. Looking forward to your follow-up actions. |
Thanks for the review. I’ll look into these. |
Undertook a major overhaul, converting the UFO sources to glyphs sources, updating, and converting back to UFO + DS. Missing glyphs now added, and vertical metrics updated. Duplicated metadata removed, local names implemented. Should be good now!
oh yeah, one last thing...
This has been a rather informative experience for me in understanding the limitations of Glyphs in managing and updating UFOs directly. It appears that anything Glyphs decides it doesn't understand / process properly is simply dumped on export. For example, the localized names. Also, you'd mentioned I suspect that this will be an issue with most applications that translate UFO into app-specific data structures and then back to UFO. I'd suggest using Robofont as it is a native UFO reader / writer, but it appears to have non-existent CJK / vertical typesetting support. Otherwise, it is probably best to store in a particular app's format, then use a reliable conversion tool (like glyphs2ufo) to obtain the desired output. It makes it harder for others to work on your sources, but at least you can avoid things being broken unexpectedly like we've observed here. I've gone through and done the fun task of doing an overhaul of the differentiated UFO files by first converting them to Glyphs format, doing my usual clean up, and then converting them back to UFO / DesignSpace using glyphsLib. I know that the output of that library is quite reliable and in conjunction with FontTools will give us binaries with predictable results. As part of this, I also reduced the amount of duplicate / unnecessary data in the fontinfo section, and let the toolchain do its job in filling out that info. I believe that these are looking pretty good, but if you could take another look through, I'd appreciate it! I'll do one more pass in the morning :) |
Yes, FontForge seem to be missing the vertical metrics after exporting to UFO.
That is correct. FontForge has multiple issues with exporting UFO (and TTF files too, see lxgw/LxgwWenkaiGB#10) as you had experienced. The font author @lxgw is using FontCreator which do support exporting UFO in FC 14, but the exported UFO have some problems too (features.fea doesn't always follow Adobe syntax, exported in UTF-8 with BOM, missing critical localised names) which is why he's using FontForge to export UFO. The best font editing software that directly exports UFO correctly is FontLab, but they don't plan to support vertical metrics yet. Personally I had written a simple program to extract UFO from binary font files (https://github.com/NightFurySL2001/py-fonttools-script/blob/main/convert_ufo.py), but it takes quite a long time and so he end up not using that too. We have a few comments for the new UFO files:
Additional question from @lxgw:
|
- PANOSE reimplemented - localized names corrected
Sheesh. And here we thought UFO would be the true unifier of the font production world! I'm honestly not sure of the best way, then, to manage a UFO-based system, except to do what we've done here where the core files that contain the necessary metadata are, in a way, locked, and the UFO that @lxgw is working on acts more like a glyph repository than a source file. Anyway, I think we have something now that will work for our purposes.
Thanks for catching that. I'd missed the slight variation between the Simplified and Traditional names (I copied from the files you sent). Corrected.
Apparently this is a limitation of FontTools that clears PANOSE values from "interpolated" instances. I've had to re-add it in post-production since there is currently no way to implement it directly. I've also removed it from the UFO source to keep things cleaner.
Added. I expected that FT would add it automatically like it does with unicode ranges, but seems not. Added in the UFO source.
Font Bakery recommends removal of this glyph:
Uploaded the updated files and double-checking the validations on my end. |
hm. Trying this?
trying again :/
Trying to move the project file to get things working.
Hi all, wanted to check in if there's any remaining feedback on the font. I need to do a PR to Google Fonts soon. Thanks! |
No problem. On the path direction issue, I will correct on my end but please let the designer know that his files have the path directions set incorrectly to standard and need to be reversed. Should the common file be updated without that correction done, then there will be a mismatch again. |
Done. Thanks |
This reverts commit a5cf76f.
This was a bit confusing to me and with some research I discovered that Glyphs' default mode of setting path direction is CCW, and that Glyphs will correct the path direction on export. It doesn't assume one wants to have CW for quadratic curves, for some reason. My error on that. I'll change the path direction in the differentiated ones to match the common files. No changes needed on your end. |
Thanks, is the files updated? We're ready to merge soon after verifying the path direction are fixed. |
Oh. It looks like I never uploaded the new files. Sorry! |
I think we got a problem... did fontmake/gftools builder assumed all inputs are cubic/Bezier and CCW? Even when the source files are all CW, the output TTF is CCW. My guess is fontmake/gftools builder uses cubic/Bezier internally, and didn't reverse contour direction when loading the UFO and converting it from quadratic to cubic, meaning internally fontmake is keeping cubic curves at CW. Then, when outputting TTF, the contour type and direction are both reversed, making it quadratic curve at CCW. |
As the author of this project, I'd like to sincerely thank you for all the effort you've put into this project. Now I merge this request. |
@aaronbell we might need your help to check on this (non) issue. |
@aaronbell can you help to check why |
I’ll be able to look into these items probably in a few weeks or so once I roll back onto Google projects :) |
@aaronbell actually never mind, the problems are found: The updates are in the |
Did a major overhaul of the repository structure and build system. Now split out the differentiated glyphs from the common glyphs and merges them together on build.
Also did some other updates to address FB errors.