[Webkit-unassigned] [Bug 38758] [gtk] web fonts not loaded properly in scribd html5 reader
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jun 1 05:05:51 PDT 2010
https://bugs.webkit.org/show_bug.cgi?id=38758
Xan Lopez <xan.lopez at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #56913|review? |review-
Flag| |
--- Comment #7 from Xan Lopez <xan.lopez at gmail.com> 2010-06-01 05:05:51 PST ---
(From update of attachment 56913)
>+ // Handle generic family types specially, because fontconfig does not know them, but we have
>+ // code to fallback correctly in our platform data implementation. Times New Roman is treated
>+ // specially, as it is used as last fallback.
>+ if (!family.length() || family.startsWith("-webkit-")
>+ || (fontDescription.genericFamily() != FontDescription::NoFamily)
>+ || isWellKnownFontName(family) || (family == "Times New Roman"))
>+ return new FontPlatformData(fontDescription, family);
Not sure if it makes sense to not have Time News Roman in the well known list at this point.
>+
>+ // First check the font exists.
>+ CString familyNameString = family.string().utf8();
>+ const char* fcfamily = familyNameString.data();
>+
>+ FcPattern* pattern = FcPatternCreate();
>+ if (!FcPatternAddString(pattern, FC_FAMILY, reinterpret_cast<const FcChar8*>(fcfamily))) {
>+ FcPatternDestroy(pattern);
>+ return 0;
>+ }
>+
>+ FcConfigSubstitute(0, pattern, FcMatchPattern);
>+ FcDefaultSubstitute(pattern);
>+
>+ FcObjectSet* objectSet = FcObjectSetCreate();
>+ if (!FcObjectSetAdd(objectSet, FC_FAMILY)) {
>+ FcPatternDestroy(pattern);
>+ FcObjectSetDestroy(objectSet);
>+ return 0;
>+ }
>+
>+ FcFontSet* fontSet = FcFontList(0, pattern, objectSet);
>+ FcPatternDestroy(pattern);
>+ FcObjectSetDestroy(objectSet);
>+
>+ if (!fontSet)
>+ return 0;
>+
>+ if (!fontSet->fonts) {
>+ FcFontSetDestroy(fontSet);
>+ return 0;
>+ }
>+
>+ FcFontSetDestroy(fontSet);
>+
> return new FontPlatformData(fontDescription, family);
Most of the code here is just freeing a couple of data structures all the time, guess we should just use GOwnPtr.
Looks good other than that.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list