-
Notifications
You must be signed in to change notification settings - Fork 819
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
Problem adding GDI+DWrite glyphs pair for contribution (help needed) #704
Comments
Awesome! So the thing that is probably catching you up is that the final font feature code is actually not stored in the UFOs but in the The other thing I wanted to say, though, is that I'm working on an overhaul of the font, which will include changing the vertical metrics. This whole DWrite vs GDI difference is the cause of too many bugs, so I'm thinking to align them (like the coding fonts of old), which will make the need for two versions unnecessary. Unfortunately, I haven't had a chance to think through what that final height will be as of yet, but I wanted to mention :). |
Thank you so much @aaronbell, it works now! So now I can start methodically adding all my other glyphs to all those script files. Do you prefer several small pull requests or a large one with all the characters? Don't feel too bad about the overhaul and changing all the metrics I have to use for my 800 glyphs. For the larger sets I basically wrote scripts to generate them from coordinates tables, so I should be able to build new ones for whichever dimensions you decide. |
Glad to be of help! I'd say it would probably be easiest to review them in individual sets. Maybe individual bug groups? |
Ok, I'll try the following:
Does that seem ok for you? |
I'm trying to add some missing symbols to Cascadia to be able to submit my contribution as a pull request.
I've forked the project and managed to build it and add new characters to it just fine.
I have two main categories of symbols: Some are based on the dimensions of characters, while others are designed to fill their cell (like the U+2588 full block character).
For the ones based on characters dimensions, I looked at existing uppercase letters and found out that they should fit in the bounding rectangle 0,1420 to 1060,0.
For the ones based on a full cell, my understanding is I have to provide a GDI-based version that fits the rectangle 0,2226 to 1200,-480, as well as a DirectWrite-based version that fits the rectangle 0,1900 to 1200,-480.
The GDI one is considered the base one and should include the unicode hex value, while the DirectWrite one should have a
.stypo
suffix to its name and filename, and not include any unicode hex value.I looked at the files referencing existing block characters in the project and believe I found all the places where I should add references to mine, including the
rclt
substututions to make it use the DirectWrite glyphs instead of the GDI ones.Unfortunately, it appears the font I build always uses the GDI glyphs, making them the wrong height in Windows Terminal.
I would really appreciate some guidance to get this to work so I can add many symbols I have been working on.
I tried a simple modification to add 3 characters, U+2427, U+2428, and U+2429.
Here is how I proceeded so far:
(These changes can also be seen on my repository https://github.com/PhMajerus/cascadia-code)
Glyph files
Added glyph files to the
glyphs
subfolder of each font (CascadiaCode-Bold.ufo
,CascadiaCode-BoldItalic.ufo
,CascadiaCode-ExtraLight.ufo
,CascadiaCode-ExtraLightItalic.ufo
,CascadiaCode-Italic.ufo
, andCascadiaCode-Regular.ufo
)checkerB_oardD_eleteA_pple2.glif
checkerB_oardD_eleteT_rs80.glif
checkerB_oardD_eleteA_mstradC_pc.glif
checkerB_oardD_eleteA_mstradC_pc.stypo.glif
The Apple2 and Trs80 symbols dimensions are relative to characters, while the AmstradCpc symbol dimensions are relative to a full block. Therefore, two versions are provided to support GDI and DirectWrite-based renderers.
Contents files
Added the glyphs name and filename tuples to each
contents.plist
file within theglyphs
subfolder of each font.Features files
In the
features.fea
file of each non-italic font (CascadiaCode-Bold.ufo
,CascadiaCode-ExtraLight.ufo
, andCascadiaCode-Regular.ufo
)…Added the glyphs names to the
@NotSpace
list.Added GDI to DirectWrite substitution to
feature rclt
for the AmstradCpc character, using the following line:sub checkerBoardDeleteAmstradCpc by checkerBoardDeleteAmstradCpc.stypo;
Lib files
In the
lib.plist
file of each font…Added the glyphs names to the
public.glyphOrder
list.Added the glyphs name and
uniXXXX
codepoint name tuples to thepublic.postscriptNames
list.Building the font
Building the font using
python3 build.py
works without any error, and opening it in VTT shows the added glyphs, including both GDI and DirectWrite variants of the AmstradCpc one.In VTT, compiling
everything for all glyphs
succeeds on first try, andship font
generates a smaller .ttf file.Problem
Installing the font and using it in Windows Terminal works, but the U+2429 character apparently uses the GDI
checkerBoardDeleteAmstradCpc.glif
instead of the DirectWritecheckerBoardDeleteAmstradCpc.stypo.glif
version.I was under the impression that the
feature rclt
substitution would make the .stypo version be used instead of the base one. Unfortunately, that doesn’t seem to be the case.See the U+2429 checkerboard character, it is extending above the cell, but it should fit the same bounding box as the U+2588 full block character.
I have 800 glif files ready to add to Cascadia, including the ones requested in #647, #607, and fixes for #644, but almost all of them are block mosaics that need to fill a full block cell properly, so I need to be able to fix this basic update before adding the others.
Can you help me find out what I missed?
Thanks,
The text was updated successfully, but these errors were encountered: