[Bug 3512] Implement font-stretch property

bugzilla-daemon at mozilla.org bugzilla-daemon at mozilla.org
Fri Aug 26 00:20:55 UTC 2011


Do not reply to this email.  You can add comments to this bug at
https://bugzilla.mozilla.org/show_bug.cgi?id=3512

Karl Tomlinson (:karlt) <karlt at mozbugz.karlt.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #555845|review?(karlt at mozbugz.karlt |review+
              Flags|.net)                       |

--- Comment #71 from Karl Tomlinson (:karlt) <karlt at mozbugz.karlt.net> 2011-08-25 17:20:55 PDT ---
Comment on attachment 555845
  --> https://bugzilla.mozilla.org/attachment.cgi?id=555845
patch to pass font-stretch to the linux/pango/fontconfig backend

>+    if (width <= (FC_WIDTH_ULTRACONDENSED + FC_WIDTH_EXTRACONDENSED) / 2) {
>+        return -4;

>+        case -4:
>+            return FC_WIDTH_ULTRACONDENSED;

Would it make sense to use NS_FONT_STRETCH_* for the constants here?

>@@ -444,16 +444,24 @@ gfxUserFcFontEntry::AdjustPatternToCSS(F
>+    int fontWidth = FC_WIDTH_NORMAL;
>+    FcPatternGetInteger(aPattern, FC_WIDTH, 0, &fontWidth);
>+    int cssWidth = gfxFontconfigUtils::FcWidthForThebesStretch(mStretch);
>+    if (cssWidth != fontWidth) {
>+        FcPatternDel(aPattern, FC_WIDTH);
>+        FcPatternAddInteger(aPattern, FC_WIDTH, cssWidth);
>+    }
>+

A missing FC_WIDTH is treated differently from a FC_WIDTH_NORMAL, so I think
its best to initialize fontWidth to something invalid like -1 (as for
FC_WEIGHT) above to ensure that FC_WIDTH is set.

-- 
Configure bugmail: https://bugzilla.mozilla.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the fonts-bugs mailing list