Score:1

Monospace font is not recognized as a monospace font

mx flag

I'm using Ubuntu 20.04.5 LTS and installed a monospace font called mononoki which is defined as a monospace font on the website. http://madmalik.github.io/mononoki/

I can see the font is installed and I can view it on the Fonts app. The font is also available for other text editors like gedit and LibreOffice Writer.

However, I want to use this on my terminal emulator which doesn't show it as an option. I tried both Kitty and the default Gnome Terminal Emulator.

This is probably because the font is not recognized as a monospace font even though it is.

You can see the outputs of different fc outputs below.

Thank you.

cagdasalagoz@cagdas-thinkpad:~/.local/kitty.app/bin$ fc-list | grep mononoki
/home/cagdasalagoz/.local/share/fonts/1mononoki-Bold.ttf: mononoki:style=Bold
/home/cagdasalagoz/.local/share/fonts/2mononoki-Bold.ttf: mononoki:style=Bold
/home/cagdasalagoz/.local/share/fonts/mononoki-BoldItalic.ttf: mononoki:style=BoldItalic
/home/cagdasalagoz/.local/share/fonts/1mononoki-Regular.ttf: mononoki:style=Regular
/home/cagdasalagoz/.local/share/fonts/1mononoki-Italic.ttf: mononoki:style=Italic
/home/cagdasalagoz/.local/share/fonts/mononoki-Italic.ttf: mononoki:style=Italic
/home/cagdasalagoz/.local/share/fonts/2mononoki-BoldItalic.ttf: mononoki:style=BoldItalic
/home/cagdasalagoz/.local/share/fonts/1mononoki-BoldItalic.ttf: mononoki:style=BoldItalic
/home/cagdasalagoz/.local/share/fonts/mononoki-Regular.ttf: mononoki:style=Regular
/home/cagdasalagoz/.local/share/fonts/mononoki-Bold.ttf: mononoki:style=Bold
/home/cagdasalagoz/.local/share/fonts/2mononoki-Italic.ttf: mononoki:style=Italic
cagdasalagoz@cagdas-thinkpad:~/.local/kitty.app/bin$ 
cagdasalagoz@cagdas-thinkpad:~/.local/kitty.app/bin$ fc-match monospace
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
cagdasalagoz@cagdas-thinkpad:~/.local/kitty.app/bin$ 
cagdasalagoz@cagdas-thinkpad:~/.local/kitty.app/bin$ fc-list :spacing=100
/usr/share/fonts/truetype/tlwg/TlwgTypo-Bold.ttf: Tlwg Typo:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
/usr/share/fonts/truetype/ubuntu/UbuntuMono-RI.ttf: Ubuntu Mono:style=Italic
/usr/share/fonts/opentype/urw-base35/NimbusMonoPS-Italic.otf: Nimbus Mono PS:style=Italic
/usr/share/fonts/X11/Type1/c0419bt_.pfb: Courier 10 Pitch:style=Regular
/usr/share/fonts/truetype/ubuntu/UbuntuMono-B.ttf: Ubuntu Mono:style=Bold
/usr/share/fonts/opentype/urw-base35/NimbusMonoPS-BoldItalic.otf: Nimbus Mono PS:style=Bold Italic
/usr/share/fonts/truetype/freefont/FreeMonoBoldOblique.ttf: FreeMono:style=Bold Oblique,получерен наклонен,Negreta cursiva,tučné kurzíva,fed kursiv,Fett-Kursiv,Έντονα Πλάγια,Negrita Cursiva,Lihavoitu Kursivoi,Gras Italique,Félkövér dőlt,Grassetto Corsivo,Vet Cursief,Halvfet Kursiv,Pogrubiona kursywa,Negrito Itálico,gros oblic,Полужирный Курсив,Tučná kurzíva,Fet Kursiv,Kalın İtalik,huruf tebal miring,жирний похилий,polkrepko ležeče,treknais slīpraksts,pusjuodis pasvirasis,Lodi etzana,धृष्ट-तिरछा
/usr/share/fonts/type1/gsfonts/n022003l.pfb: Nimbus Mono L:style=Regular
/usr/share/fonts/truetype/liberation/LiberationMono-BoldItalic.ttf: Liberation Mono:style=Bold Italic
/usr/share/fonts/truetype/tlwg/TlwgTypo-Oblique.ttf: Tlwg Typo:style=Oblique
/usr/share/fonts/truetype/liberation/LiberationMono-Bold.ttf: Liberation Mono:style=Bold
/usr/share/fonts/truetype/tlwg/TlwgMono-Bold.ttf: Tlwg Mono:style=Bold
/usr/share/fonts/type1/urw-base35/NimbusMonoPS-Italic.t1: Nimbus Mono PS:style=Italic
/usr/share/fonts/truetype/fonts-beng-extra/mitra.ttf: Mitra Mono,\\u09ae\\u09bf\\u09a4\\u09cd\\u09b0:style=Regular
/usr/share/fonts/X11/Type1/c0611bt_.pfb: Courier 10 Pitch:style=Bold Italic
/usr/share/fonts/truetype/liberation/LiberationMono-Regular.ttf: Liberation Mono:style=Regular
/usr/share/fonts/opentype/urw-base35/NimbusMonoPS-Bold.otf: Nimbus Mono PS:style=Bold
/usr/share/fonts/truetype/ubuntu/UbuntuMono-BI.ttf: Ubuntu Mono:style=Bold Italic
/usr/share/fonts/type1/gsfonts/n022023l.pfb: Nimbus Mono L:style=Regular Oblique
/usr/share/fonts/truetype/tlwg/TlwgTypo.ttf: Tlwg Typo:style=Regular
/usr/share/fonts/truetype/freefont/FreeMonoOblique.ttf: FreeMono:style=Oblique,наклонен,cursiva,kurzíva,kursiv,Πλάγια,Kursivoitu,Italique,Dőlt,Corsivo,Cursief,Kursywa,Itálico,oblic,Курсив,İtalik,huruf miring,похилий,ležeče,slīpraksts,pasvirasis,nghiêng,Etzana,तिरछा
/usr/share/fonts/truetype/ubuntu/UbuntuMono-R.ttf: Ubuntu Mono:style=Regular
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf: DejaVu Sans Mono:style=Bold
/usr/share/fonts/opentype/urw-base35/NimbusMonoPS-Regular.otf: Nimbus Mono PS:style=Regular
/usr/share/fonts/type1/urw-base35/NimbusMonoPS-Regular.t1: Nimbus Mono PS:style=Regular
/usr/share/fonts/type1/urw-base35/NimbusMonoPS-BoldItalic.t1: Nimbus Mono PS:style=Bold Italic
/usr/share/fonts/truetype/tlwg/TlwgMono.ttf: Tlwg Mono:style=Regular
/usr/share/fonts/truetype/liberation/LiberationMono-Italic.ttf: Liberation Mono:style=Italic
/usr/share/fonts/truetype/tlwg/TlwgMono-Oblique.ttf: Tlwg Mono:style=Oblique
/usr/share/fonts/X11/Type1/c0582bt_.pfb: Courier 10 Pitch:style=Italic
/usr/share/fonts/X11/Type1/c0583bt_.pfb: Courier 10 Pitch:style=Bold
/usr/share/fonts/truetype/tlwg/TlwgMono-BoldOblique.ttf: Tlwg Mono:style=Bold Oblique
/usr/share/fonts/truetype/noto/NotoMono-Regular.ttf: Noto Mono:style=Regular
/usr/share/fonts/type1/urw-base35/NimbusMonoPS-Bold.t1: Nimbus Mono PS:style=Bold
/usr/share/fonts/type1/gsfonts/n022004l.pfb: Nimbus Mono L:style=Bold
/usr/share/fonts/truetype/freefont/FreeMono.ttf: FreeMono:style=Regular,нормален,normal,obyčejné,Standard,µεσαία,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,menengah,прямій,navadno,vidējs,normalusis,thường,Arrunta,सामान्य
/usr/share/fonts/truetype/noto/NotoColorEmoji.ttf: Noto Color Emoji:style=Regular
/usr/share/fonts/truetype/tlwg/TlwgTypo-BoldOblique.ttf: Tlwg Typo:style=Bold Oblique
/usr/share/fonts/truetype/freefont/FreeMonoBold.ttf: FreeMono:style=Bold,получерен,negreta,tučné,fed,Fett,Έντονα,Negrita,Lihavoitu,Gras,Félkövér,Grassetto,Vet,Halvfet,Pogrubiony,Negrito,gros,Полужирный,Fet,Kalın,huruf tebal,жирний,polkrepko,treknraksts,pusjuodis,đậm,Lodia,धृष्ट
cagdasalagoz@cagdas-thinkpad:~/.local/kitty.app/bin$ 
in flag
Believe it or not, this is all correct. While Mononoki is visually a monospace font, its metadata does not define it as such. As a result, Ubuntu (and other OSes) will only show it as Regular, Bold, BoldItalic, and Italic.
cagdasalagoz avatar
mx flag
@matigo is there a way to add this to the definition so it can be used?
in flag
The issue comes down to the value of `isFixedPitch` in the `.ttf`, which is currently `0`. This needs to be `1`. If you have a tool to edit TrueType fonts, then you can change this value yourself and rebuild the font files. If you need a tool and are familiar with Python, you may be able to use [FontTools](https://github.com/fonttools/fonttools/) to quickly build something to dump the definition table, perform the edit, then rebuild.
cn flag
`gnome-terminal` doesn't offer you the fonts that don't _seem_ to be monospace; however, you can set those via `dconf` or `gsettings`, e.g. in `dconf-editor` navigate to `/org/gnome/terminal/legacy/profiles:` and there you'll find this setting.
Score:0
mx flag

I solved the issue so to let other people know I wanted to post the solution here. This was not caused by the lack of information in metadata but by the font itself.

Gnome terminal emulator or Kitty are running their own checks to see if the font is really monospaced or not. The font I was using had this issue with it. As you can see in the question it doesn't appear in the output of fc-list :spacing=100 command.

The font is updated by the creator to overcome this issue. I just had the old version. https://github.com/madmalik/mononoki/issues/23

If you have a similar problem you can check the solution applied by csauve in this issue page. He/She explained how to modify the font in the comments.

I was successfully able to make this font detected as monospaced by doing the following:

1.made the edit in my previous post

2.opened the .ufo directory in fontforge

3.I'm not sure if this step mattered, but selecting all glyphs, right clicked, and set all widths to 575. I didn't trust the validation because even when I set one glyph to 574, no problems were detected by fontforge

4.Exported the font to TTF into ~/.local/share/fonts/mononoki/

5.Ran fc-cache -f to rebuild the font cache

The font now shows up as monospace when I run fc-list :spacing=100 and works in kitty.

https://github.com/madmalik/mononoki/issues/23

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.