1 diff -Nur qt-x11-free-3.3.2.orig/src/kernel/qapplication_x11.cpp qt-x11-free-3.3.2/src/kernel/qapplication_x11.cpp
2 --- qt-x11-free-3.3.2.orig/src/kernel/qapplication_x11.cpp 2004-04-19 11:36:02.000000000 +0200
3 +++ qt-x11-free-3.3.2/src/kernel/qapplication_x11.cpp 2004-05-12 23:10:49.895694064 +0200
5 Atom qt_gbackground_properties = 0;
7 Atom qt_utf8_string = 0;
9 +// detect broken window managers
10 +Atom qt_sgi_desks_manager = 0;
11 bool qt_broken_wm = FALSE;
12 +static void qt_detect_broken_window_manager();
15 Atom qt_net_supported = 0;
20 - settings.readBoolEntry("/qt/brokenWindowManager", FALSE);
21 + settings.readBoolEntry("/qt/brokenWindowManager", qt_broken_wm);
24 settings.readBoolEntry("/qt/resolveSymlinks", TRUE);
25 @@ -1289,6 +1293,27 @@
29 +static void qt_detect_broken_window_manager()
33 + ulong nitems, after;
36 + // look for SGI's 4Dwm
37 + int e = XGetWindowProperty(appDpy, QPaintDevice::x11AppRootWindow(),
38 + qt_sgi_desks_manager, 0, 1, False, XA_WINDOW,
39 + &type, &format, &nitems, &after, &data);
43 + if (e == Success && type == XA_WINDOW && format == 32 && nitems == 1 && after == 0) {
44 + // detected SGI 4Dwm
45 + qt_broken_wm = TRUE;
50 // update the supported array
51 void qt_get_net_supported()
54 qt_x11_intern_atom( "_NET_WM_NAME", &qt_net_wm_name );
55 qt_x11_intern_atom( "_NET_WM_ICON_NAME", &qt_net_wm_icon_name );
56 qt_x11_intern_atom( "UTF8_STRING", &qt_utf8_string );
57 + qt_x11_intern_atom( "_SGI_DESKS_MANAGER", &qt_sgi_desks_manager );
60 qt_x11_motifdnd_init();
62 // Finally create all atoms
63 qt_x11_process_intern_atoms();
65 + // look for broken window managers
66 + qt_detect_broken_window_manager();
68 // initialize NET lists
69 qt_get_net_supported();
70 qt_get_net_virtual_roots();
71 diff -Nur qt-x11-free-3.3.2.orig/src/kernel/qfontdatabase.cpp qt-x11-free-3.3.2/src/kernel/qfontdatabase.cpp
72 --- qt-x11-free-3.3.2.orig/src/kernel/qfontdatabase.cpp 2004-04-19 11:36:07.000000000 +0200
73 +++ qt-x11-free-3.3.2/src/kernel/qfontdatabase.cpp 2004-05-12 23:10:49.897693768 +0200
89 // MathematicalOperators,
96 // MiscellaneousSymbols,
102 @@ -920,12 +920,14 @@
103 script, scriptName( script ).latin1(),
104 request.weight, request.italic, request.stretch, request.pixelSize, pitch );
106 + bool usesFontConfig = FALSE;
108 if (family_name.isEmpty()
109 || family_name == "Sans Serif"
110 || family_name == "Serif"
111 || family_name == "Monospace") {
112 fe = loadFontConfigFont(fp, request, script);
113 + usesFontConfig = (fe != 0);
119 && ucstricmp( try_family->english_name, family_name ) != 0
125 if ( family_name.isEmpty() )
127 override_script = QFont::Han_SimplifiedChinese;
129 } else if (override_script == QFont::Han_SimplifiedChinese
130 - && (try_family->scripts[QFont::Han_TraditionalChinese] & QtFontFamily::Supported)) {
131 + && (try_family->scripts[QFont::Han_TraditionalChinese] & QtFontFamily::Supported)) {
132 override_script = QFont::Han_TraditionalChinese;
135 @@ -978,20 +980,20 @@
139 - if (family_name.isEmpty()) {
141 - } else if (try_family->scripts[QFont::UnknownScript] & QtFontFamily::Supported) {
142 - // try with the unknown script (for a symbol font)
143 - override_script = QFont::UnknownScript;
144 + if (family_name.isEmpty()) {
146 + } else if (try_family->scripts[QFont::UnknownScript] & QtFontFamily::Supported) {
147 + // try with the unknown script (for a symbol font)
148 + override_script = QFont::UnknownScript;
150 - } else if (try_family->scripts[QFont::Unicode] & QtFontFamily::Supported) {
151 - // try with the unicode script instead
152 - override_script = QFont::Unicode;
155 - // family not supported by unicode/unknown scripts
158 + } else if (try_family->scripts[QFont::Unicode] & QtFontFamily::Supported) {
159 + // try with the unicode script instead
160 + override_script = QFont::Unicode;
163 + // family not supported by unicode/unknown scripts
168 QtFontFoundry *try_foundry = 0;
169 @@ -1134,7 +1136,12 @@
173 - QFontCache::Key key( request, script,
174 + QFontDef def = request;
175 + if (def.family.isEmpty()) {
176 + def.family = fp->request.family;
177 + def.family = def.family.left(def.family.find(','));
179 + QFontCache::Key key( def, script,
183 @@ -1142,15 +1149,17 @@
186 QFontCache::instance->insertEngine( key, fe );
187 - for ( int i = 0; i < QFont::NScripts; ++i ) {
188 - if ( i == script ) continue;
190 - if (!canRender(fe, (QFont::Script) i))
194 - QFontCache::instance->insertEngine( key, fe );
196 + if (!usesFontConfig) {
197 + for ( int i = 0; i < QFont::NScripts; ++i ) {
198 + if ( i == script ) continue;
200 + if (!canRender(fe, (QFont::Script) i))
204 + QFontCache::instance->insertEngine( key, fe );
209 if ( request.family.isEmpty() ) {
210 diff -Nur qt-x11-free-3.3.2.orig/src/kernel/qfontdatabase_x11.cpp qt-x11-free-3.3.2/src/kernel/qfontdatabase_x11.cpp
211 --- qt-x11-free-3.3.2.orig/src/kernel/qfontdatabase_x11.cpp 2004-04-19 11:36:05.000000000 +0200
212 +++ qt-x11-free-3.3.2/src/kernel/qfontdatabase_x11.cpp 2004-05-12 23:10:49.899693472 +0200
214 QtFontFoundry *foundry
215 = family->foundry( QString::null, TRUE );
217 - for ( int i = 0; i < QFont::LastPrivateScript; ++i )
218 + for ( int i = 0; i < QFont::LastPrivateScript; ++i ) {
219 + if (i == QFont::UnknownScript)
221 family->scripts[i] = QtFontFamily::Supported;
224 QtFontStyle::Key styleKey;
225 styleKey.oblique = FALSE;
226 diff -Nur qt-x11-free-3.3.2.orig/src/kernel/qfontengine_x11.cpp qt-x11-free-3.3.2/src/kernel/qfontengine_x11.cpp
227 --- qt-x11-free-3.3.2.orig/src/kernel/qfontengine_x11.cpp 2004-04-19 11:36:09.000000000 +0200
228 +++ qt-x11-free-3.3.2/src/kernel/qfontengine_x11.cpp 2004-05-12 23:10:49.891694657 +0200
229 @@ -1395,29 +1395,17 @@
236 + // Xft maps Unicode and adobe roman for us.
237 for (int i = 0; i < _face->num_charmaps; ++i) {
238 - FT_CharMap cm = _face->charmaps[i];
239 -// qDebug("font has charmap %x", cm->encoding);
240 - if (charmap == -1 && cm->encoding == ft_encoding_unicode)
242 - // we don't use FT_ENCODING_MS_SYMBOL in 3.3, as it maps to U+0xf0xx. All of the fonts
243 - // tested also provide a FT_ENCODING_APPLE_ROMAN table that works for the basic range.
245 - && (/*cm->encoding == FT_ENCODING_MS_SYMBOL ||*/
246 - cm->encoding == ft_encoding_adobe_custom
247 - || cm->encoding == ft_encoding_apple_roman)) {
253 - if (symbol != -1 && (charmap == -1 || cmap))
255 - if (charmap != -1) {
256 -// qDebug("using charmap %x", _face->charmaps[charmap]->encoding);
257 - FT_Set_Charmap(_face, _face->charmaps[charmap]);
258 + FT_CharMap cm = _face->charmaps[i];
259 +// qDebug("font has charmap %x", cm->encoding);
260 + if (cm->encoding == ft_encoding_adobe_custom
261 + || cm->encoding == ft_encoding_symbol) {
262 +// qDebug("font has adobe custom or ms symbol charmap");
269 @@ -1458,6 +1446,15 @@
273 +static glyph_t getAdobeCharIndex(XftFont *font, int cmap, uint ucs4)
275 + FT_Face _face = XftLockFace( font );
276 + FT_Set_Charmap(_face, _face->charmaps[cmap]);
277 + glyph_t g = FT_Get_Char_Index(_face, ucs4);
278 + XftUnlockFace(font);
282 QFontEngine::Error QFontEngineXft::stringToCMap( const QChar *str, int len, glyph_t *glyphs, advance_t *advances, int *nglyphs, bool mirrored ) const
284 if ( *nglyphs < len ) {
285 @@ -1473,7 +1470,7 @@
289 - glyph_t glyph = FT_Get_Char_Index(_face, uc);
290 + glyph_t glyph = XftCharIndex(0, _font, uc);
292 if ( uc < cmapCacheSize )
293 ((QFontEngineXft *)this)->cmapCache[uc] = glyph;
294 @@ -1486,7 +1483,7 @@
298 - glyph_t glyph = FT_Get_Char_Index(_face, uc);
299 + glyph_t glyph = XftCharIndex(0, _font, uc);
301 if ( uc < cmapCacheSize )
302 ((QFontEngineXft *)this)->cmapCache[uc] = glyph;
303 @@ -2067,13 +2064,22 @@
304 bool allExist = TRUE;
307 - for ( int i = 0; i < len; i++ ) {
308 - if (!FT_Get_Char_Index(_face, string[i].unicode())) {
313 + for ( int i = 0; i < len; i++ ) {
314 + if (!XftCharExists(0, _font, string[i].unicode())
315 + && getAdobeCharIndex(_font, _cmap, string[i].unicode()) == 0) {
321 + for ( int i = 0; i < len; i++ ) {
322 + if (!XftCharExists(0, _font, string[i].unicode())) {
332 diff -Nur qt-x11-free-3.3.2.orig/src/kernel/qscriptengine_x11.cpp qt-x11-free-3.3.2/src/kernel/qscriptengine_x11.cpp
333 --- qt-x11-free-3.3.2.orig/src/kernel/qscriptengine_x11.cpp 2004-04-19 11:36:07.000000000 +0200
334 +++ qt-x11-free-3.3.2/src/kernel/qscriptengine_x11.cpp 2004-05-12 23:10:49.906692436 +0200
335 @@ -1533,7 +1533,8 @@
337 openType->applyGSUBFeature(FT_MAKE_TAG( 'c', 'c', 'm', 'p' ));
340 + where[0] = (from == 0
341 + || !(string.unicode()[from-1].isLetter() || string.unicode()[from-1].isMark()));
342 openType->applyGSUBFeature(FT_MAKE_TAG( 'i', 'n', 'i', 't' ), where);
343 openType->applyGSUBFeature(FT_MAKE_TAG( 'n', 'u', 'k', 't' ));
345 @@ -1720,7 +1721,7 @@
349 - if (state == Halant)
350 + if (state == Halant && uc[pos].unicode() == 0x200d /* ZWJ */)
354 @@ -2257,8 +2258,8 @@
355 KHDEBUG("state[%d]=%d (uc=%4x)", pos, state, uc[pos].unicode() );
358 - if (state != Khmer_Cons) {
359 - if (state != Khmer_IndV && state != Khmer_Other)
360 + if (state != Khmer_Cons && state != Khmer_IndV) {
361 + if (state != Khmer_Other)
365 diff -Nur qt-x11-free-3.3.2.orig/src/kernel/qtextengine.cpp qt-x11-free-3.3.2/src/kernel/qtextengine.cpp
366 --- qt-x11-free-3.3.2.orig/src/kernel/qtextengine.cpp 2004-04-19 11:36:07.000000000 +0200
367 +++ qt-x11-free-3.3.2/src/kernel/qtextengine.cpp 2004-05-12 23:10:49.907692288 +0200
369 #define BIDI_DEBUG 0//2
370 #if (BIDI_DEBUG >= 1)
372 +using namespace std;
374 static const char *directions[] = {
375 "DirL", "DirR", "DirEN", "DirES", "DirET", "DirAN", "DirCS", "DirB", "DirS", "DirWS", "DirON",
378 if( status.eor != QChar::DirR && status.eor != QChar::DirAL ) {
379 //last stuff takes embedding dir
380 - if(control.direction() == QChar::DirR || status.lastStrong == QChar::DirR) {
381 + if(control.direction() == QChar::DirR
382 + || status.lastStrong == QChar::DirR || status.lastStrong == QChar::DirAL) {
383 appendItems(engine, sor, eor, control, dir);
384 dir = QChar::DirON; status.eor = QChar::DirON;