Comment 0 for bug 1002757

Revision history for this message
su_v (suv-lp) wrote :

In revision 11393 Inkscape's default font was changed to 'sans-serif'. AFAICT this breaks several aspects of font handling in the text tool and the 'Text and Font …' dialog: The underlying issue seems to be that Inkscape does not recognized 'sans-serif' as "installed" font (related to case-sensitive parsing of font names (?)).

Steps to reproduce (quit inkscape first):
 1) mv ~/.config/inkscape ~/.config/inkscape.bkp
 2) launch inkscape (opens new empty document)
 3) switch to the text tool
    (note: font family selector in the controls bar is empty)
 4) create new text object #1 (regular text)
    (note: text tool reports "Font not found on system")
 5) switch back to the select tool, select text object #1
    (note: status line message reports <no name found>)
 6) open 'Text > Text and Font…'
    (note: font preview area is empty)
 7) switch to the text tool
 8) create new text object #2 with different text content
 9) select a different font from the dropdown list on the
    text tool controls bar for text object #2
    (note: font preview area shows content of text object #2,
           using the just assigned font family)
10) switch back to the select tool, select text object #1
    (note: font preview area is stuck displaying the content
           of previously selected text object #2)

Details:
1) Text Tool (controls bar):
- The font family selector is empty now when activating the Text tool (before clicking on the canvas to create a new text object).
- The font family selector of a newly created text (font family "sans-serif") warns about "Font not found on system".
- (…)

2) Status Bar:
- The message in the status bar for such a text object with the new 'sans-serif' default font doesn't inform about the font family:
"Text (<no name found>, 40px) in layer Layer 1."

3) 'Text > Text and Font…' dialog:
- The generic font family 'sans-serif' is not listed, other generic font names like 'Sans', 'Serif' and 'Monospace' however are.
- This new default font cannot be restored from within the 'Text and Fonts…' dialog (because 'sans-serif' cannot be selected).
- Due to the "missing" font, the dialog does not render a preview of such a text object with the new default font 'sans-serif'.
- If switching between a text object with the new default font ('sans-serif') and a text object using an "installed" font family, the preview sticks to the content of the last selected object with a font found to be installed on the system, and does not update when reselecting the text object with the new default font ('sans-serif') -> the dialog shows a preview text not related to the currently selected object.
- (…)

Related earlier reports:
- Bug #379885 “Generic font-family names not recognized in font lister”
  <https://bugs.launchpad.net/inkscape/+bug/379885>
- Bug #667091 “Fonts initially indicated as 'not found on system'”
  (Possibly fixed in in earlier revision 10491)
  <https://bugs.launchpad.net/inkscape/+bug/667091>
- Bug #932048 “Text and Font dialog : Make consistent with text toolbar”
  <https://bugs.launchpad.net/inkscape/+bug/932048>
- (…)

Tested and confirmed on Mac OS X 10.5.8 with
- fontconfig 2.8.0, freetype 2.4.5, cairo 1.10.2, pango 1.28.4
and on OS X 10.7.4 with
- fontconfig 2.9.0, freetype 2.4.9, cairo 1.12.2, pango 1.30.0
using the same default font backend as on linux (i.e. inkscape/Gtk+ running under X11).

Note: the native font backend of pango on Mac OS X (pango 1.28: ATSUI, pango 1.30.0: CoreText) introduce additional issues which are _not_ in the scope of this bug report.

fontconfig does find a match for 'sans-serif' on both test systems:
$ fc-match sans-serif
Vera.ttf: "Bitstream Vera Sans" "Roman"
$ fc-match Sans-Serif
Vera.ttf: "Bitstream Vera Sans" "Roman"
$ fc-match sans
Vera.ttf: "Bitstream Vera Sans" "Roman"
$ fc-match Sans
Vera.ttf: "Bitstream Vera Sans" "Roman"
$