Closed Bug 754506 Opened 12 years ago Closed 12 years ago

Gtk/Qt Linux --disable-pango option is broken

Categories

(Core Graveyard :: Widget: Qt, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 703042

People

(Reporter: romaxa, Assigned: romaxa)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch Qt FT2 backend WIP (obsolete) — Splinter Review
Currently if pango not installed, then qt port trying to compile FT2 backend and fails.
I think it would make sense to make Ft2 backend work for Qt, so as an option we can disable pango at all in qt builds
This fix would also help to cleanup changes for HONK port
Blocks: b2g-on-linux
Assignee: nobody → romaxa
Attachment #623375 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #623540 - Flags: review?(jfkthame)
Comment on attachment 623540 [details] [diff] [review]
Fix building Qt port with FT2 backend

I'm concerned about the behavior that will result from this; in particular, taking this approach:

+    FcPattern *pat = NULL;
+    FcObjectSet *os = NULL;
+    FcFontSet *fs = NULL;
+    pat = FcPatternCreate();
+    os = FcObjectSetBuild(FC_FAMILY, FC_FILE, FC_INDEX, FC_WEIGHT, FC_SLANT, FC_WIDTH, NULL);
+    fs = FcFontList(NULL, pat, os);
+    for (int i = 0; i < fs->nfont; i++) {
+        char *file;
+        if (FcPatternGetString(fs->fonts[i], FC_FILE, 0, (FcChar8 **) &file) != FcResultMatch)
+            continue;
+        nsCString s(file);
+        AppendFacesFromFontFile(s, false, &fnc);
+    }

This means that in the Qt build, although we're running in a fontconfig-based environment, we won't actually honor fontconfig settings properly. The code here will get a list of all the "installed" font files from FC, but then we'll do all font lookups directly using the family/face names from the files. Therefore, we will skip any fontconfig aliases that may be defined in fonts.conf. This is particularly worrying for people who may have alternates in place of common fonts such as Times, with an FC alias mapping "Times" -> "Nimbus Roman No9" or something.

Issues like this are the reason we don't use this approach in the standard Linux desktop build; we need to do font name lookups through fontconfig rather than just using a list of the "real" fonts. This applies regardless of whether we're using pango for text shaping or not.
Summary: Make Qt port work and compile without pango → Gtk/Qt Linux --disable-pango option is broken
gfx/thebes/gfxFT2Fonts.cpp: In member function ‘void gfxFT2FontGroup::FamilyListToArrayList(const nsString&, nsIAtom*, nsTArray<nsRefPtr<gfxFontEntry> >*)’:
gfx/thebes/gfxFT2Fonts.cpp:226:99: error: conversion from ‘FontEntry*’ to non-scalar type ‘nsRefPtr<gfxFontEntry>’ requested
gfx/thebes/gfxFT2Fonts.cpp: In function ‘PRInt32 GetCJKLangGroupIndex(const char*)’:
gfx/thebes/gfxFT2Fonts.cpp:257:21: error: ‘COUNT_OF_CJK_LANG_GROUP’ was not declared in this scope
gfx/thebes/gfxFT2Fonts.cpp:258:40: error: ‘sCJKLangGroup’ was not declared in this scope
gfx/thebes/gfxFT2Fonts.cpp: In member function ‘void gfxFT2FontGroup::GetCJKPrefFonts(nsTArray<nsRefPtr<gfxFontEntry> >&)’:
gfx/thebes/gfxFT2Fonts.cpp:274:9: error: ‘Preferences’ has not been declared
gfx/thebes/gfxFT2Fonts.cpp:276:34: error: ‘Preferences’ has not been declared
gfx/thebes/gfxFT2Fonts.cpp:296:57: error: ‘sCJKLangGroup’ was not declared in this scope
gfx/thebes/gfxFT2Fonts.cpp: In member function ‘already_AddRefed<gfxFT2Font> gfxFT2FontGroup::WhichFontSupportsChar(const nsTArray<nsRefPtr<gfxFontEntry> >&, PRUint32)’:
gfx/thebes/gfxFT2Fonts.cpp:347:69: error: invalid static_cast from type ‘gfxFontEntry*’ to type ‘FontEntry*’
gfx/thebes/gfxFT2Fonts.cpp: In static member function ‘static already_AddRefed<gfxFT2Font> gfxFT2Font::GetOrMakeFont(const nsAString_internal&, const gfxFontStyle*, bool)’:
gfx/thebes/gfxFT2Fonts.cpp:602:74: error: invalid static_cast from type ‘FontEntry*’ to type ‘FT2FontEntry*’
make[1]: *** [gfxFT2Fonts.o] Error 1
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
Comment on attachment 623540 [details] [diff] [review]
Fix building Qt port with FT2 backend

Clearing old r? flag; no longer relevant, superseded by bug 947379.
Attachment #623540 - Flags: review?(jfkthame)
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.