SOLVED Which font file is "monospace regular" and "monospace bold"?

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
User avatar
Flemur
Level 19
Level 19
Posts: 9754
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

SOLVED Which font file is "monospace regular" and "monospace bold"?

Post by Flemur »

Answer: "monospace regular" is not set to a given font, its a sort of placeholder for to say "monospace" without defining which font is used.

Hi -

When presenting a list of fonts, (for use in their GUIs) both "xfce4-terminal" and "synaptic" list fonts called
"monospace regular" and "monospace bold".

But those fonts DO NOT show up in "gnome-font-viewer" or "font-manager" ! (?)

How can I find out which font file (ttf file) contains those fonts?

TIA!
Last edited by Flemur on Sat Dec 16, 2017 9:54 pm, edited 1 time in total.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
rene
Level 17
Level 17
Posts: 7754
Joined: Sun Mar 27, 2016 6:58 pm

Re: Which font file is "monospace regular" and "monospace bold"?

Post by rene »

Code: Select all

$ fc-match monospace
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
$ fc-match monospace:bold
DejaVuSansMono-Bold.ttf: "DejaVu Sans Mono" "Bold"
User avatar
Flemur
Level 19
Level 19
Posts: 9754
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Which font file is "monospace regular" and "monospace bold"?

Post by Flemur »

rene wrote:

Code: Select all

$ fc-match monospace
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
$ fc-match monospace:bold
DejaVuSansMono-Bold.ttf: "DejaVu Sans Mono" "Bold"
Thanks!

I'll betcha this is another freedesktop.org debacle - note the different results for "monospace bold" - which is what I actually see - vs "monospace:bold", which is not the name displayed in xfce-terminal/synaptic:

Code: Select all

$ fc-match "monospace bold"
DejaVuSans.ttf: "DejaVu Sans" "Book"
$
$ fc-match "monospace:bold"
DejaVuSansMono-Bold.ttf: "DejaVu Sans Mono" "Bold"
$
$ fc-match "monospace:regular"
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
$
$ fc-match "monospace regular"
DejaVuSans.ttf: "DejaVu Sans" "Book"
But at least I know - I think I know - it's DejaVu of some sort.

EDIT:
I unintalled DejaVu* (and ran sudo fc-cache) and the choice "monospace bold/regular" is still there, so fc-match returned the wrong answers.

EDIT.2: Turns out "monospace bold" etc is a fake name.

I'll just avoid using it because you never really know what it refers too; after removing DejaVu and Ubuntu, it returns:

Code: Select all

$ fc-match "monospace bold"
Vera.ttf: "Bitstream Vera Sans" "Roman"
$
$ fc-match "monospace:bold"
VeraMoBd.ttf: "Bitstream Vera Sans Mono" "Bold"
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
rene
Level 17
Level 17
Posts: 7754
Joined: Sun Mar 27, 2016 6:58 pm

Re: Which font file is "monospace regular" and "monospace bold"?

Post by rene »

Yes, the "serif", "sans-serif" and "monospace" names are the three generic family names to be configured per-system to actual serif, sans-serif and monospace fonts, and are in fact recommended: any program using one of the generic names allows central configuration through fontconfig by the user. If you for example have the following for an /etc/fonts/local.conf,

Code: Select all

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <alias>
    <family>serif</family>
    <prefer><family>FreeSerif</family></prefer>
  </alias>
  <alias>
    <family>sans-serif</family>
    <prefer><family>FreeSans</family></prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer><family>FreeMono</family></prefer>
  </alias>
</fontconfig>
then any program set to use "monospace" will all of a sudden use FreeMono rather than DejaVu Mono. And yes, monospace:bold will be provided by FreeMonoBold.otf from that point on, as a new round of fc-match experimentation with that above file in place will show. Note, fontconfig watches its configuration directories; you may need to wait 30 seconds for a change in /etc/fonts to appear but fc-cache is not needed.

I don't have xfce4-terminal installed, but to be fair to fontconfig, it would appear that I in synaptic only get to pick fonts through a dialog in which "Monospace" and "Bold" are two separate choices; this would not really seem to map much better to "monospace bold" than to "monospace:bold". But generally, yes, certainly fontconfig is the kind of overly generic redhat/freedesktop.org system that drowns any hope of actually being actively used by anyone other than the also very recently college-graduated in over-generalization and -complication. The usual outcome is said system going through three incompatible rewrites before being given up on altogether.

Note though that for now Wayland uses it [edit: well, "freetype", which is not the same thing] exclusively; you may want to go read up at https://www.freedesktop.org/wiki/Software/fontconfig/
Post Reply