Missing characters in monospace fonts fall back to proportional fonts

Bug #932958 reported by Bryan Richter
36
This bug affects 6 people
Affects Status Importance Assigned to Milestone
fontconfig (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

gnome-terminal 3.0.1-0ubuntu3, Ubuntu 11.10
gnome-terminal 3.6.2-0ubuntu1, Ubuntu 15.04

When a character is not present in whichever monospace font you are using, Ubuntu chooses a proportional font to render it.

This is usually not desirable. In a terminal, for example, the proportional character is often too wide and therefore overlapped by the following character.

For example:
- bug 819708 (heavy line-drawing characters not lined up in Ubuntu Mono)
- bug 1116428 ('DOTTED CIRCLE' and 'BLACK CIRCLE' substituted from a wider font)
- bug 1094434 ("font lacks that symbols and use the ones from the other font which have incorrect sizes")
- bug 736613 ("the ! is rendered on top of the C")
- this bug as originally reported (U+25B7 white right-pointing triangle and U+20AF drachma overlapping with following characters).

This happens with multiple monospace fonts -- Droid Sans Mono, Terminus, TlwgMono Medium, and Ubuntu Mono -- suggesting that it is a problem with fontconfig, rather than with the individual fonts.

Revision history for this message
Bryan Richter (bryan-richter) wrote :
Revision history for this message
Bryan Richter (bryan-richter) wrote :

I tried a couple different fonts. Some have the problem, and others do not.

A sample of fonts that have the problem:
* Droid Sans Mono
* TlwgMono Medium
* Ubuntu Mono
* Terminus

A sample of fonts that do _not_ have the problem:
* Andale Mono
* DejaVu Sans Mono
* FreeMono

affects: gnome-terminal (Ubuntu) → ttf-droid (Ubuntu)
Revision history for this message
Wladimir J. van der Laan (laanwj) wrote :

Yes this is clearly visible if you try to run, for example, Dwarf Fortress in console mode.
For example the smileys used for the dwarves themselves ☺ are almost two characters wide in gnome-terminal with the default font.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in fonts-tlwg (Ubuntu):
status: New → Confirmed
Changed in ttf-droid (Ubuntu):
status: New → Confirmed
Changed in ubuntu-font-family-sources (Ubuntu):
status: New → Confirmed
Changed in xfonts-terminus (Ubuntu):
status: New → Confirmed
Revision history for this message
Matthew Paul Thomas (mpt) wrote :

In a terminal, enter:

    pango-view --font="Ubuntu Mono 48" --markup --text='<span fallback="false">ABC&#13;A☺C&#13;A▷C</span>'

This demonstrates that:
- the ☺ character in Ubuntu Mono is the correct width
- the ▷ character is not present in Ubuntu Mono at all.

The lists of fonts that "have the problem, and ... do not" seem to be lists of fonts that contain those two characters or not.

So the bug here probably is not with any individual font; it is that monospace fonts fall back to proportional fonts for missing characters, instead of falling back to another monospace font with the desired glyph.

Changed in ubuntu-font-family:
status: New → Incomplete
summary: - Some characters too wide with default fixed-with font
+ [nc] Some characters too wide with default fixed-with font
description: updated
summary: - [nc] Some characters too wide with default fixed-with font
+ Missing characters in monospace fonts fall back to proportional fonts
affects: ubuntu-font-family → fontconfig (Ubuntu)
Changed in fontconfig (Ubuntu):
status: Incomplete → Confirmed
no longer affects: fonts-tlwg (Ubuntu)
no longer affects: ttf-droid (Ubuntu)
no longer affects: ubuntu-font-family-sources (Ubuntu)
no longer affects: xfonts-terminus (Ubuntu)
Revision history for this message
Matthew Paul Thomas (mpt) wrote :

Now I think about it more, even just ensuring that monospace fonts fall back to other monospace fonts wouldn't solve the problem, for two reasons. First, monospace fonts can be different widths, so the fallback might be wider than the original. And second, the character might not be present in any monospace fonts at all, but still be present in a proportional font, and it would be better to fall back to a proportional font than to nothing at all.

So ideal behavior, perhaps, would be ensuring that a fallback character for a monospace font is the same width as the original font -- by centering it if it is narrower, and by scaling it down if it is wider.

Changed in fontconfig (Ubuntu):
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.