Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Which font is identified behind the name "monospace"?

5 views
Skip to first unread message

dolphin

unread,
Jan 5, 2010, 3:31:31 AM1/5/10
to
Hi!

User 1 uses for example Iceweasel 2.0.0.3 at Debian Etch.
At the Preferences, user 1 opens the fonts configuration box.
There are four font classes:
- Proportional
- Serif
- Sans-serif
- Monospace

At Monospace, user 1 chooses Times New Roman.

User 2 is a web programmer and creates the following
style sheet:

pre, tt
{
font-family: monospace;
}

If user 1 views the web site, then all PRE and TT tags
will be displayed with a Times New Roman font.

This is absolutely not the result that user 2 had expected!
What is going on here?

If I open the Iceweasel configuration box and assign
"monospace" to "Monospace" and if I do not use any
style sheet, then the displayed text uses a font where
each letter has the same size (especially width).

User 2 wants to enforce exactly this font with his
style sheet, no matter which absurd font user 1
chooses at his Iceweasel configuration box!

First question:
Which font is actually meant if I open the Iceweasel
configuration box and assign "monospace" to "Monospace"
without using any overriding style sheet?

Second question:
What does user 2 has to assign to "font-family" in his
CSS file to get exactly this font? Assigning "monospace"
obviously does not lead to the goal.

Third question:
Is it possible for me to look up this kind of question
somewhere in my system without having to ask such
kind of question in a news group?

dolphin

Boris Zbarsky

unread,
Jan 5, 2010, 8:04:28 AM1/5/10
to
On 1/5/10 3:31 AM, dolphin wrote:
> At Monospace, user 1 chooses Times New Roman.

Which is a slightly silly thing to do, but ok...

> If user 1 views the web site, then all PRE and TT tags
> will be displayed with a Times New Roman font.

Yes, that's what the user preferences say to do.

> This is absolutely not the result that user 2 had expected!
> What is going on here?

Silly misconfiguration on the part of user 1, or user 1 having a good
reason to never see fixed-width characters, depending.

> User 2 wants to enforce exactly this font with his
> style sheet, no matter which absurd font user 1
> chooses at his Iceweasel configuration box!

Then user 2 should be using PDF, not HTML+CSS. In HTML+CSS, ultimate
control is ALWAYS with user 1 in this scenario.

> First question:
> Which font is actually meant if I open the Iceweasel
> configuration box and assign "monospace" to "Monospace"
> without using any overriding style sheet?

Whatever the OS reports as "monospace". On Linux this is presumably
some particular FontConfig option that User 1 could also change as desired.

> What does user 2 has to assign to "font-family" in his
> CSS file to get exactly this font?

That depends on the installed fonts of User 1.

> Is it possible for me to look up this kind of question
> somewhere in my system without having to ask such
> kind of question in a news group?

You could look at what your FontConfig does with "monospace", sure.

-Boris

dolphin

unread,
Jan 5, 2010, 1:01:27 PM1/5/10
to
On Jan 5, 2:04 pm, Boris Zbarsky <bzbar...@mit.edu> wrote:
> > Is it possible for me to look up this kind of question
> > somewhere in my system without having to ask such
> > kind of question in a news group?
>
> You could look at what your FontConfig does with "monospace", sure.
>
> -Boris

Hi!

Apparently "monospace" is not a real font but a placeholder
for a font. But why a software like firefox cannot make it
clear that "Courier" is a font and "monospace" is a placeholder?
I find it stupid!

By a fluke, I found out that my system means
"DejaVu Sans Mono" if I choose "monospace".

Surprise: If user 2 writes a CSS file with the content

pre, tt
{
font-family: DejaVu Sans Mono;
}

then user 1 gets displayed a result formatet
as "DejaVu Sans Mono", not as "Times New Roman".

This is exactly, what user 2 wants.

But now, the next questions:

1.) Why do I have to find out such things by a fluke?

2.) Isn't there a deterministic way to find such things out?

3.) Regarding to your statement "You could look at what your
FontConfig does with 'monospace', sure.": Where can I find
such FontConfig?

This would be the exact deterministic way that I am
looking for. Any help? I wanna totally understand this
problem. The fact that "monospace" isn't a font really
is a good initiation to understand the whole situation.

dolphin

Boris Zbarsky

unread,
Jan 5, 2010, 1:09:23 PM1/5/10
to
On 1/5/10 1:01 PM, dolphin wrote:
> 3.) Regarding to your statement "You could look at what your
> FontConfig does with 'monospace', sure.": Where can I find
> such FontConfig?

http://letmegooglethatforyou.com/?q=fontconfig

first hit.

> This would be the exact deterministic way that I am
> looking for. Any help? I wanna totally understand this
> problem. The fact that "monospace" isn't a font really
> is a good initiation to understand the whole situation.

"monospace" in the preferences dialog just means "the default monospace
font for the current OS settings; ask the OS what that is".

-Boris

Zack Weinberg

unread,
Jan 5, 2010, 1:17:32 PM1/5/10
to dolphin, dev-tec...@lists.mozilla.org
dolphin <dolph...@gmx.de> wrote:

> On Jan 5, 2:04 pm, Boris Zbarsky <bzbar...@mit.edu> wrote:
> > > Is it possible for me to look up this kind of question
> > > somewhere in my system without having to ask such
> > > kind of question in a news group?
> >
> > You could look at what your FontConfig does with "monospace", sure.
> >
> > -Boris
>
> Hi!
>
> Apparently "monospace" is not a real font but a placeholder
> for a font. But why a software like firefox cannot make it
> clear that "Courier" is a font and "monospace" is a placeholder?

You might want to read the CSS definition of generic font families:

http://www.w3.org/TR/2009/CR-CSS2-20090908/fonts.html#generic-font-families

The keywords 'serif', 'sans-serif', 'cursive', 'fantasy', and
'monospace', when used as an UNQUOTED font-family: value, are
"placeholders" (as you put it) for some user-selected system font.

You can force the browser to look for a font whose name actually is e.g.
"monospace" by writing

font-family: "monospace"

instead of

font-family: monospace

but this doesn't guarantee the effect you seem to want, either -- if
there is no such font, the browser will fall back to the default body
font, which is generally not fixed-width.

zw

dolphin

unread,
Jan 6, 2010, 3:00:08 AM1/6/10
to
Hi!

Now, I understand some more context. But, I also have some new
questions.

1.)
If I type "fc-match monospace" into a Debian Lenny Shell, then
I get "DejaVu Sans Mono" as a result. This is a deterministic
way I was looking for.

Even if "fc-match courier" yields a "Nimbus Mono L" (Lenny) rather
than a "Courier" (Etch), nevertheless the name "courier" is a more
precise or concrete font than a name like "monospace".

The other way around: The name "monospace" is definitely
a font family (a replacement / a placeholder), whereas
"courier" can be a real font.

Would it be appropriate that Firefox displays such definite
replacements such as "monospace" in a different way
than the rest of the list?

Currently, monospace is the first entry, and then the
rest of the list follows in an alphabetical order. But for
me (who was not acquainted with such replacement
concepts, who thought "monospace" was a real font)
the fact that "monospace" stands at the top of the list
was not enough for people like me to get the concept.

I think, it would be less confusing for laymen to
additionally:
* display replacements like "monospace" more
noticeable, for example italicized
* write a hint behind the replacement name
- not "monospace" as now
- but "monospace (system settings)"
- or "monospace system settings"
- or "monospace (system default)"
- or "monospace (fontconfig settings)"
- or "monospace (fontconfig default)"
- or "monospace (operating system provided)"
- or "monospace (os provided)"
* make a horizontal line between "monospace (system settings)"
and the remaining list entries

Additionally to the fact that the replacement resides at the top
of the list, the italicizing, the hint in parenthesis and the
horizontal line, they all together would help to more quickly
realize the wohl context.

2.) At the Preferences, when I open the fonts configuration box
and click at the pull down menu for "Monospace", then there
is a list of "monospace", some more real font names such
as "Century Schoolbook L", a horizontal line, a "serif" entry,
a "sans-serif" entry and then some more real font names
such as "Balker".

Why is there a horizontal line in the middle of the list?
The only thing I can discover is that the second part of
the list has some more exotic fonts, but the first part
also has exotic fonts. Again, I am guissing. Why
cannot be there a documentation that mentions the
cause of the splitting of the list? A non-clickable list
entry at the top of ich list part could solve the problem:

- [list of whatsoever these fonts] --- please choose below
- /monospace (system settings)/
- Century Schoolbook L
- ...
- horizontal line
- [list of whatsoever other fonts] --- please choose below
- /serif (system settings)/
- /sans-serif (system settings)/
- Balker
- Bitstream Charter
- ...

In retrospect, I consider these two questions as suggestions
to improve the software so that new users would understand
the software more easy.

Please, give me some statements if my suggestions are
reasonable enough to be included in later versions of the
software (Firefox, SeaMonkey, ...).

dolphin

Boris Zbarsky

unread,
Jan 6, 2010, 3:07:06 AM1/6/10
to
On 1/6/10 3:00 AM, dolphin wrote:
> Why is there a horizontal line in the middle of the list?

Last I checked, the things above the line are in fact fixed-width fonts
(for the particular dropdown you're looking at). The other fonts
installed are listed below the line in case you want to pick one of them
after all.

-Boris

Karl Tomlinson

unread,
Jan 11, 2010, 10:05:03 PM1/11/10
to
On Wed, 6 Jan 2010 00:00:08 -0800 (PST), dolphin wrote:

> I think, it would be less confusing for laymen to
> additionally:
> * display replacements like "monospace" more
> noticeable, for example italicized
> * write a hint behind the replacement name
> - not "monospace" as now
> - but "monospace (system settings)"
> - or "monospace system settings"
> - or "monospace (system default)"
> - or "monospace (fontconfig settings)"
> - or "monospace (fontconfig default)"
> - or "monospace (operating system provided)"
> - or "monospace (os provided)"
> * make a horizontal line between "monospace (system settings)"
> and the remaining list entries

Those sound like sensible suggestions.
I don't know whether Mac and Windows have equivalent default fonts
for each generic font. The current system is not really set up to
treat these differently (it may have been designed with other
systems in mind), but it would be possible to change things.

I notice though that my KDE apps just treat the generic family
names like real family names, in alphabetical order even, in their
font selection dialog boxes, so the concept is probably not too
foreign to users who have selected font families in other
applications.

Karl Tomlinson

unread,
Jan 11, 2010, 10:14:33 PM1/11/10
to

The way it's meant to work is that the families above the line are
those suitable for use as the particular generic (e.g. fixed-width
for monospace) for the particular language group (e.g. Western).

On Linux this is not fully implemented (yet?). The families above
the line are all fonts with support for the particular language
group.

I don't know how well matching families to particular generics is
supported on other systems. It would be reasonably simple to
limit monospace to fixed-width. Possibly dual-width should be
included also. There would be exceptions as some fonts get these
things wrong. Sans-serif and Serif might be more difficult to
detect.

0 new messages