Poor or no font matching on common fonts

Bug #1060498 reported by David Mathog
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
jazzynico
Inkscape Devlibs
Fix Released
Medium
jazzynico

Bug Description

Devlibs includes fontconfig, which I assume is being referenced by Pango (or whatever) when it decides that it cannot match a font like Times. The thing is, the fontconfig configuration files which are currently in devlibs do not seem to be be very good for a couple of _extremely_ common fonts. This is painfully evident on EMF import of Times and Helvetica, which show up with the little orange/yellow triangle in the font list indicating that they are unknown fonts. It does not need to be this way, the fontconfig configuration files could be modified to map Times to "Times New Roman" (very close) and Helvetica to Arial (exactly the same on Windows), assuming that the end user has not installed an actual Times or Helvetica font, which would match perfectly.

The first attachment is a small SVG file that has text in Times, TImes New Roman, Arial, and Helvetica. It looks OK in Firefox, but really bad in Inkscape. (Times in particular is much too wide.)

The second attachment is a little fontconfig/freetype test program. It uses the devlibs configuration and shows what fontconfig is matching to for these fontnames, then it shows the glyph widths for "Hello world". It builds in mingw like this:

  gcc -Wall -DWIN32 -I/c/progs/devlibs32/include -I/c/progs/devlibs32/include/freetype2 \
   -o ft_example ft_example.c -lfreetype6 -lfontconfig-1 -L/c/progs/devlibs32/bin

(Use the correct path for your devlibs). Run it in mingw like:

 ./ft_exampe times "times new roman" arial helvetica

Revision history for this message
David Mathog (mathog) wrote :
Revision history for this message
David Mathog (mathog) wrote :
Revision history for this message
David Mathog (mathog) wrote :
Revision history for this message
David Mathog (mathog) wrote :

That command line should of course have been:

./ft_example times "times new roman" arial helvetica

Revision history for this message
David Mathog (mathog) wrote :

This is a slightly modified example which includes some common text at the beginning of each line. The first pair of lines should be identical, or nearly so, as should the second pair of lines. This is not the case.

Revision history for this message
David Mathog (mathog) wrote :

Screen shot (off center, oops) showing the fonts Inkscape uses. The first and third lines are using suboptimal replacement fonts.

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

See also (new duplicate) Bug #1060508 “Poor or no font matching on common fonts”

tags: added: fonts win32
Revision history for this message
David Mathog (mathog) wrote :

Found the problem.

The .../devlibs32/etc/fonts/fonts.d and fonts.avail are missing 30-metric-aliases.conf. When inkscape builds these become .../inkscape/etc/fonts/fonts.d and ...fonts.avail, and since the files were missing from devlibs, they are also missing from inkscape.

Copied that file from a linux system and dropped it into the fonts.d and fonts.avail directories, then checked times and helvetica - they looked MUCH better. This file is attached. It should be added to the next release of devlibs.

As an aside, does it really make sense to have both fonts.,d and fonts.avail on windows? On linux and presumably OS X the contents of fonts.d are just symlinks to (some of the files in) fonts.avail. In devlibs on Windows though they are just copies. As expected, removing the fonts.avail directory had no effect, since only fonts.d is actually used.

Revision history for this message
David Mathog (mathog) wrote :

Test file with overlapping times/times new roman and arial/helvetica.

Revision history for this message
David Mathog (mathog) wrote :

Second test file with 30-metric-aliases.conf in place. Times now matches very well with Times New Roman, and Helvetica
matches very well with Arial.

su_v (suv-lp)
tags: added: packaging
Revision history for this message
jazzynico (jazzynico) wrote :

Confirmed on Windows XP, Inkscape trunk revision 11737.
Adding the missing aliases conf file fixes the issue.

While I'm at it, I'm going to update the fontconfig to 2.8.0-2 (currently 2.8.0) and test some other missing conf files that may fix known issues such as Bug #168926 and Bug #219390.

Fontconfig 2.10.1 is the latest stable version, but the gnome ftp doesn't provide the win32 binary, and the one from opensuse introduces new dependencies. Thus I guess it's safer to update the libs after 0.49 is out.

Changed in inkscape:
assignee: nobody → JazzyNico (jazzynico)
importance: Undecided → Medium
milestone: none → 0.49
status: New → In Progress
Changed in inkscape-devlibs:
assignee: nobody → JazzyNico (jazzynico)
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
jazzynico (jazzynico) wrote :

Fixed in devlibs r34.

Changed in inkscape-devlibs:
status: In Progress → Fix Committed
Changed in inkscape:
status: In Progress → Fix Committed
Changed in inkscape-devlibs:
status: Fix Committed → Fix Released
jazzynico (jazzynico)
Changed in inkscape:
status: Fix Committed → Fix Released
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.