Closed Bug 488626 Opened 15 years ago Closed 13 years ago

FT font support needs to get correct family names out

Categories

(Core :: Graphics, defect)

All
Windows CE
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: vlad, Unassigned)

References

Details

(Whiteboard: [nv])

Attachments

(1 file, 4 obsolete files)

Our FT2 font backend seems to grab the base family name from ttf files; this is coming out as lowercase ("tahoma", "times new roman") and generally looks odd.  I'm guessing that we need to dig into the full name tables to get the real name out, not sure what the best way is to do that.
gfxFontUtils contains code for reading the name table.  Just use a FT2 API to read the name table data into memory.  To match other platforms, localized font family names should match indpendent of underlying locale.  For UI code, the family name should be the locale-specific name or the default name (i.e. English or the first name in the name table) when a locale-specific name doesn't exist.
Because I didn't notice this bug, I was working on it in another way.
I reattach the patch here for reference.
Attached patch Patch v2 (obsolete) — Splinter Review
I've fixed previous patch to use gfxFontUtils::ReadNames instead of using FT_Get_Sfnt_Name.
I fixed also gfxFontUtils.cpp because it causes alignment error on ARM arch.
Attachment #379529 - Attachment is obsolete: true
(In reply to comment #4)
> I've fixed previous patch to use gfxFontUtils::ReadNames instead of using
> FT_Get_Sfnt_Name.
> I fixed also gfxFontUtils.cpp because it causes alignment error on ARM arch.

Yeah, I was going to mention that but you beat me to it.  One note, it looks like you're merging in fullnames and postscript names as ways of matching a family, this isn't correct.  The font-family property should only match the family data.  Name matching of other data in Safari (postscript) and IE (fullname) are bugs, er, unintended consequences of using platform API's?!? ;)  

Face names and family names need to be distinct, otherwise you end up with CSS that doesn't make sense:

body {
  font-family: "Arial Bold";
  font-weight: normal;
}

Which face should this match?  Normal?  Bold?
Attached patch Patch v3 (obsolete) — Splinter Review
Thank you for pointing out it.
To tell the truth, I couldn't decide that full names and PS names should
be merged or not because some APIs and programs doesn't distinguish them.
Attachment #380036 - Attachment is obsolete: true
Blocks: 493280
This bug seems related with bug 493280.
If it's wrong, please remove dependency.
Blocks: 489752
Attached patch Patch v4 (obsolete) — Splinter Review
Follow trunk.

I think more work is needed for this patch because Qt and Gtk(with gfxFT2Fonts) platform has same issue.
Attachment #380052 - Attachment is obsolete: true
Now I turn over the dependency because it can be fixed using gfxPlatformFontList which is introduced at bug 493280.
No longer blocks: 493280
Depends on: 493280
Blocks: 503260
No longer blocks: 503260
Attached patch Patch v5Splinter Review
Follow trunk, and resolve standard family name also on GTK and Qt.
Attachment #394451 - Attachment is obsolete: true
Whiteboard: [nv]
WinCE/Windows Mobile support has been removed from the main build system, Spidermonkey, mobile installer, in-app updater and so on (see bug 614720, bug 554087 and all their dependants). Until such point where MS decide to release a Windows Phone 7 NDK and the decision is made to port to that platform, this is WONTFIX.

Filter bugmail on WinCEMassWONTFIX.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: