[Bug 744812] Re: FontConfig/Qt stack choke on Ubuntu Medium font meta-data (No medium in Inkscape and too bold in Qt apps)

Paul Sladen ubuntu at paul.sladen.org
Sat Sep 22 17:26:16 UTC 2012


Saviq: thanks for finding the Qt part.  Things that may be useful in
reaching a decision:  Truetype defines a weight scale; which is
{100,200,300,400,500,600,700,800,900}; (plus other flags); these can be
seen with:

  (cd /usr/share/fonts/truetype/ubuntu-font-family/; for i in *.ttf ; do
echo -ne "$i\t:"; showttf $i | grep -i Weight | xargs echo ; done)

This TTF scale is the source for virtually all weights in use (as
virtually all fonts are sourced from TTF/OTF containers these days).
These are suffering from a double-remapping + double discard.  Other
people's handling of the mapping are; for Google Web Fonts (documented
per Dave Crossland) on:

  https://bugs.launchpad.net/ubuntu-font-family/+bug/730912/comments/2

Probably the most useful recommendation on the handling of mapping is
from the CSS specification;

  http://www.w3.org/TR/CSS21/fonts.html#propdef-font-weight
  "…association of other weights within a family to the numerical weight values is intended only to preserve the ordering of darkness within that family."

and which provides the recommended remapping algorithm in text form.
This initially maps a Medium back to 500 (if available) and a Bold to
700 (if available).  and uses other logic to fill outwards from those
reference points.  Given QML<->CSS and the significance of familiarity
with HTML/CSS (and exposure/testing) that it has likely had, it might be
reasonable to transpose/implement this algorithm too.

TTF weights {300,400,500,700}.  FC weights {50,80,100,200}.  Ideal Qt
output {25,50,63,75}

(Rule of thumb would seem to be ~0.125 of TTF value, or ~0.63 of FC
value for the two important weights Regular and Medium).

The idea way might be to have would be perhaps to have Qt's
getFCWeight() reverse the bucket logic of FcFreeTypeQueryFace() (which
returns discreet enums, not an integer, nor the raw 'os2->usWeightClass'
directly), and then apply the CSS algorithm to the untransformed result.
This should be fairly robust.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to fontconfig in Ubuntu.
https://bugs.launchpad.net/bugs/744812

Title:
  FontConfig/Qt stack choke on Ubuntu Medium font meta-data (No medium
  in Inkscape and too bold in Qt apps)

Status in Linux Libertine:
  Unknown
Status in Ubuntu Font Family:
  Invalid
Status in “fontconfig” package in Ubuntu:
  Confirmed
Status in “ubuntu-font-family-sources” package in Ubuntu:
  Confirmed
Status in “fontconfig” source package in Natty:
  Confirmed
Status in “ubuntu-font-family-sources” source package in Natty:
  Fix Released
Status in “fontconfig” source package in Oneiric:
  Confirmed
Status in “ubuntu-font-family-sources” source package in Oneiric:
  Fix Released
Status in “fontconfig” source package in Precise:
  Confirmed
Status in “ubuntu-font-family-sources” source package in Precise:
  Fix Released
Status in “fontconfig” source package in Quantal:
  Confirmed
Status in “ubuntu-font-family-sources” source package in Quantal:
  Confirmed

Bug description:
  [Kubuntu natty up-to-date]
  Hi,
  Without any change on my system, I noticed some days ago that my default font (ubuntu) changed. Some odd behaviour appeared : ubuntu medium 10 pt was ok but ubuntu medium 11pt was bold (-> in my taskbar clock or in kpackapgekit). In fact, after some play with kcm kubuntu font manager, the ubuntu medium 10pt was wrong, since kcm module shows the true appearance of ubuntu medium, which is quite bold. I swapped to ubunu light font
  SO ! I changed font hinting to light (default in kubuntu seems to be medium) and it seems to have solved bugs.
  Anyway, "ubuntu font" management by KDE seems to be strange, and firefox 4 font rendering is worse (imho) with light hinting (but maybe because of unselected "system default" parameter in fonts kcm).

To manage notifications about this bug go to:
https://bugs.launchpad.net/linuxlibertine/+bug/744812/+subscriptions




More information about the foundations-bugs mailing list