Closed khlsvr closed 2 weeks ago
Hey would it be possible for you or someone on windows computer to create a fast font from some Monospace font to add compatibility? For example DejaVu Sano Mono? https://dejavu-fonts.github.io/
I'm on linux and Fontlab is only available onWindows and Mac. I have FontForge installed and I'm already struggling at the first step adding a suffix to each character in a font.
That python script that is mentioned on the "apply to other fonts" part though.. For example, using the addfeatures.py script.
https://github.com/simoncozens/test-fonts/blob/master/addfeatures.py That looks like a simple script and Chatgpt had a plan how to use it once I first got the bold glyphs copied to the regular font file.
I then tried to keep on getting the glyphs copied. Chatgpt gave me instructions on copying them with fontforge, but the options were not there or they were grayed out. Then Chatgpt tried instructing me to do it with a python script using fonttools, but after 30+ minutes with trial and error, we couldn't get them copied. I also tried asking Gemini. So apparently this is a too difficult thing for a LLM chatbot for now at least
Just an update where I have got so far.
Using Fontforge I got so far (hopefully right way) that I added new encoding slots to regular font file, then pasted these bold glyphs from bold font file to the new empty slots in regular font file. Then manually.. sigh.. renamed all of them to a.bold A.bold b.bold B.bold etc. At this point I guess I have the font file with regular and both in one.
If you need to import just a .fea file use the File menu where you must choose Merge Feature Info (File > Merge Feature Info). In this case you will be in position to import .fea files.
So next I saved the simplified snippet with just A-Z to a .fea file and tried loading it with above mentioned method. Got no output which I guess was a good sign. I then went to Element > Font Info > Lookups and I can see there are many calt lookups there including bold characters in the mix, so I guess it did the trick. After this I go generate the font, but I am getting some intersection errors or such but an option to generate the font anyway. I generate it and then try load it, but this time it doesn't show bold chars not even in Abiword, so something went wrong somewhere.
Okay this shall (I hope) be the last message I spam in this thread since I now managed to create a monospace font out of the dejavu sans mono, and it succesfully loads in Kitty terminal now.
What I did was after I had manually created those .bold variants and copied them to the regular, I then instead just tried using your python script addfeatures.py and surprisingly it works now. I'll close this thread as solved.
edit: Streamlined the process a bit and made couple more fonts:
Steps for monospaced fonts especially and in this example I have added äÄöÖ in addition to a-z and A-Z:
create_empty_bold_placeholder_slots
inside fontforge's 'execute script' to create new slots with .bold ending in namespython3 addfeatures.py -o out.ttf IBMPlexMono-Light-Fast.ttf fin.fea
fc-cache -fv
fc-list | grep -i fontname
kitty --override font_family='fontname'
Contents of the create_empty_bold_placeholder_slots:
Contents of the fin.fea:
Contents of the addfeatures.py is untouched and is one provided in this repo.
Hi.
I wonder what my problem is. I installed all the 3 fonts to my Arch Linux through ~/.local/share/fonts/ dir and they show up in
fc-list
. I can also load them in qutebrowser or firefox, and I can see a difference to the font I have before loading them at least on qb. However, they just change the outlook, but do not add boldness to the characters at the begin of words. Same goes for kitty terminal when I try run kitty withkitty --override font_family='Fast_Sans'
I don't see any boldness. In fact, on kitty the font may not change at all. Tried with the dotted font and no dots are added. I am succesfully loading my custom conhanzi font on qutebrowser and it also has a lot of ligature substitutions going on, so there should be ligature support there. Also kitty supports ligatures and I can load conhanzi with the override flag succesfully there.Then running abiword and picking the Fast_Sans from the font menu I can see it working properly bolding first chars on each words so the font files themselves should be alright I guess
edit: I might have figured this out. In firefox if I pick one of the fonts as the "monospace" font, then it works there properly. Maybe it has to do with needing a monospace variation and I just need to find out how I can force one of these to be forced as monospace on terminal and qutebrowser. However it doesn't explain why on qb I can see the font appearance changing when I switch :thinking:
edit2: Kitty doesn't support non-monospaced fonts, so I guess I would need to create a monospaced variation of the font using your python script or something else I guess