summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaleb Tennis <caleb@gentoo.org>2003-12-05 14:08:31 +0000
committerCaleb Tennis <caleb@gentoo.org>2003-12-05 14:08:31 +0000
commit4705bb33bcd5f7160ff4ad63e01e4f5e0bf92e59 (patch)
tree83311f48b7459e5333d2051511d25142b3df10ba /x11-libs
parentChanged sparc keyword to ~sparc as numerous dependencies were masked. Need f... (diff)
downloadgentoo-2-4705bb33bcd5f7160ff4ad63e01e4f5e0bf92e59.tar.gz
gentoo-2-4705bb33bcd5f7160ff4ad63e01e4f5e0bf92e59.tar.bz2
gentoo-2-4705bb33bcd5f7160ff4ad63e01e4f5e0bf92e59.zip
add cjk patches for foreign fonts, and mark x86 stable
Diffstat (limited to 'x11-libs')
-rw-r--r--x11-libs/qt/ChangeLog10
-rw-r--r--x11-libs/qt/Manifest83
-rw-r--r--x11-libs/qt/files/qt-3.2.3-qfontdatabase-i18n-20031024.patch374
-rw-r--r--x11-libs/qt/files/qt-3.2.3-qpsprinter-useFreeType2-20031128.patch372
-rw-r--r--x11-libs/qt/files/qt-3.2.3-scriptForChar-20031128.patch546
-rw-r--r--x11-libs/qt/qt-3.2.3.ebuild8
6 files changed, 1350 insertions, 43 deletions
diff --git a/x11-libs/qt/ChangeLog b/x11-libs/qt/ChangeLog
index bf45c5ed92d2..ac1de43e8f79 100644
--- a/x11-libs/qt/ChangeLog
+++ b/x11-libs/qt/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for x11-libs/qt
# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/x11-libs/qt/ChangeLog,v 1.95 2003/11/29 22:52:50 brad_mssw Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-libs/qt/ChangeLog,v 1.96 2003/12/05 14:08:27 caleb Exp $
+
+ 05 Dec 2003; Caleb Tennis <caleb@gentoo.org> qt-3.2.3.ebuild,
+ files/qt-3.2.3-qfontdatabase-i18n-20031024.patch,
+ files/qt-3.2.3-qpsprinter-useFreeType2-20031128.patch,
+ files/qt-3.2.3-scriptForChar-20031128.patch:
+ Adding cjk patches for people using foreign fonts
+ See bug #33069 for more info.
+ Also marking x86 stable
29 Nov 2003; Brad House <brad_mssw@gentoo.org> qt-3.2.3.ebuild:
mark stable on amd64
diff --git a/x11-libs/qt/Manifest b/x11-libs/qt/Manifest
index ece4a1045692..9624425a62ba 100644
--- a/x11-libs/qt/Manifest
+++ b/x11-libs/qt/Manifest
@@ -1,54 +1,57 @@
-MD5 52dd5c420f4a4c9575bb54659ffcee85 ChangeLog 15744
-MD5 512150b47a904b0240101e319856aab1 metadata.xml 156
+MD5 232c9a440f58d6f1a15c750ba4a25c48 qt-3.1.2-r3.ebuild 4979
+MD5 9de36830c26a229b68dee7cf3442f287 qt-3.2.2-r1.ebuild 6277
MD5 3ea4b4de8bf408a89bad7560499c5517 qt-2.3.2-r1.ebuild 2274
+MD5 c47d4bd47ef74b87a7eaa1c5969ec48e qt-3.2.1.ebuild 4937
MD5 a3dd25c9f882f04df789dddc02ed3177 qt-3.0.5-r2.ebuild 3896
-MD5 9de36830c26a229b68dee7cf3442f287 qt-3.2.2-r1.ebuild 6277
-MD5 232c9a440f58d6f1a15c750ba4a25c48 qt-3.1.2-r3.ebuild 4979
+MD5 e2f7b604f119049e8be072fd959e805f qt-3.2.3.ebuild 5391
MD5 aff33d960efe2f7ef7782bd0a7cc9441 qt-3.1.2-r4.ebuild 5340
-MD5 90d1dd73bba8600a8c5c34f284177ca4 qt-3.2.3.ebuild 5185
-MD5 c47d4bd47ef74b87a7eaa1c5969ec48e qt-3.2.1.ebuild 4937
+MD5 0794e9a12e9f758d962867428a6d597e ChangeLog 16071
+MD5 512150b47a904b0240101e319856aab1 metadata.xml 156
+MD5 f036a81a9440e146ca67fb23dbb2b535 files/0013-qtabwidget-less_flicker.patch 2785
MD5 8ffca1b1b7523339af04fd24b4595ce4 files/0001-dnd_optimization.patch 5623
+MD5 5716cdfbdcb04ba8e3a25c7e1c49a9cc files/0026-netwm-fullscreen.patch 8243
MD5 8b3da5dae8babfcbdee3be465579d6c2 files/0002-dnd_active_window_fix.patch 7289
-MD5 cb961de2c2123caa01b045da33a3da21 files/0003-qmenubar_fitts_law.patch 979
+MD5 9ac22fe721162a565a7507763f785ab5 files/qt-3.2.3-qpsprinter-useFreeType2-20031128.patch 9972
+MD5 c7f65a0625242eccf159e2b8ee74976d files/45qt3 109
+MD5 7a287bc7609ad2420f70af6d4c58302f files/50qt2 63
MD5 65c6cd464a60955c85a85b1dfd487c04 files/0004-qiconview_etc_ctrl_selecting.patch 2207
-MD5 ac9d015b2aca3f99a110d486b5232fad files/0009-window_group.patch 4156
-MD5 3b9e1d14819114b64b8bf770e1a474cd files/0011-listview_keys.patch 2520
-MD5 f036a81a9440e146ca67fb23dbb2b535 files/0013-qtabwidget-less_flicker.patch 2785
-MD5 5469328b9b6197e8bbfbe3e1528e61ca files/0014-qiconview-autoscroll.patch 1915
-MD5 1629e8691d2921d8651788fc0499379e files/0015-qiconview-finditem.patch 1496
-MD5 2ba63844ecf426956135397f5eb845b4 files/0016-qiconview-rebuildcontainer.patch 1211
-MD5 91372ac45b85140af55a26498293e4ff files/0017-qiconview-ctrl_rubber.patch 3443
-MD5 cf7fad8d582c6b517b3555aba4e26fd1 files/0018-qlistview-paintcell.patch 1442
-MD5 3caa2fcd52c019652d8f73cd957ad85c files/0019-qlistview-adjustcolumn.patch 1508
+MD5 b79277b535797e854be75d1c396de0f2 files/digest-qt-3.2.1 72
+MD5 24486c56d654be71e66b7c01b143c9a9 files/digest-qt-3.2.3 72
+MD5 8fd2bb8fe0c4752252d064ff62257f9a files/0028-fix_sub_popup_crash.patch 302
MD5 e4054a5914b182318d548c53beea9590 files/0020-designer-deletetabs.patch 3493
-MD5 1a268563c150260e99ed24dd4d2f5fd0 files/0021-qiconview-dragalittle.patch 2341
-MD5 08fa63b47b7a7cf4886c151e1ce0e33f files/0022-qdragobject-hotspot.patch 1266
-MD5 f203b47b8d1425047e0e301cb7d68eed files/0023-qstring-crash.patch 950
+MD5 c6dc1b6fadcb4897d4c7b0a768c2d196 files/qt-3.1.2-r3-qsocket.diff 447
MD5 0c06df8bd83ccf54e9045ef5703a1703 files/0024-fix_enter_leave_notify.patch 1374
-MD5 c7f65a0625242eccf159e2b8ee74976d files/45qt3 109
-MD5 08cdd879d3418837cf4bad594dc0f91f files/45qtdir2 16
-MD5 7a287bc7609ad2420f70af6d4c58302f files/50qt2 63
-MD5 7dc4f78d52452c28ba797ffc7db34f23 files/50qtdir3 16
-MD5 1da4214f7cf90d34592e0453f47b4758 files/designer.diff 380
-MD5 037b7ee164790946df6a2d6ea89f01fc files/digest-qt-2.3.2-r1 65
+MD5 04fdd1779f4aca06b809528a2d0bad7a files/qt-3.1.2-coreutils-fixup.patch 4203
+MD5 b87df8ba9bf813ffe5e280fa2d79da25 files/qt-3.1.2-qpsprinter-ttc-otf-italic-20030429.patch 19286
+MD5 08fa63b47b7a7cf4886c151e1ce0e33f files/0022-qdragobject-hotspot.patch 1266
+MD5 905e62743eb9d6304dc70510c5d3ee69 files/0027-dnd-leak.patch 345
+MD5 001400cb2710d783deb4380ca6056bc2 files/qsocket-3.1.2.diff 3136
MD5 c8a8d41028d22397dcc86041f1856a79 files/digest-qt-3.0.5-r2 71
-MD5 1fd4137cd6f3d062dfd25523ee18468d files/digest-qt-3.2.2-r1 72
-MD5 24486c56d654be71e66b7c01b143c9a9 files/digest-qt-3.2.3 72
MD5 f197d87f2b33685cadba08c9cf2d08ee files/digest-qt-3.1.2-r3 72
MD5 f197d87f2b33685cadba08c9cf2d08ee files/digest-qt-3.1.2-r4 72
-MD5 b79277b535797e854be75d1c396de0f2 files/digest-qt-3.2.1 72
-MD5 e6052859850285f5334e722a73b2645b files/qt-3.2.2-crash-fix.patch 1035
-MD5 001400cb2710d783deb4380ca6056bc2 files/qsocket-3.1.2.diff 3136
-MD5 39f840d6723a7e898394bc84efb224a2 files/qt-3.1.0-minimized.diff 272
-MD5 04fdd1779f4aca06b809528a2d0bad7a files/qt-3.1.2-coreutils-fixup.patch 4203
+MD5 1fd4137cd6f3d062dfd25523ee18468d files/digest-qt-3.2.2-r1 72
+MD5 024632ca815ede1ccdd13cacea10e64a files/qt-3.1.2-thai-complextext.patch 528
+MD5 1a268563c150260e99ed24dd4d2f5fd0 files/0021-qiconview-dragalittle.patch 2341
+MD5 1da4214f7cf90d34592e0453f47b4758 files/designer.diff 380
+MD5 1629e8691d2921d8651788fc0499379e files/0015-qiconview-finditem.patch 1496
+MD5 687ac003fc61501eda26cb2cf068cb2a files/qt-3.2.3-scriptForChar-20031128.patch 18095
+MD5 cb961de2c2123caa01b045da33a3da21 files/0003-qmenubar_fitts_law.patch 979
+MD5 f203b47b8d1425047e0e301cb7d68eed files/0023-qstring-crash.patch 950
+MD5 ac9d015b2aca3f99a110d486b5232fad files/0009-window_group.patch 4156
+MD5 7dc4f78d52452c28ba797ffc7db34f23 files/50qtdir3 16
+MD5 2ba63844ecf426956135397f5eb845b4 files/0016-qiconview-rebuildcontainer.patch 1211
+MD5 91372ac45b85140af55a26498293e4ff files/0017-qiconview-ctrl_rubber.patch 3443
+MD5 08cdd879d3418837cf4bad594dc0f91f files/45qtdir2 16
+MD5 e9b2e2fbde862abb62cdfa78e62a35b6 files/qt-3.1.2-qmlined.diff 320
MD5 953be971128fb1a5ad7d9893f657e13c files/qt-3.1.2-korean-xim.patch 4285
+MD5 3caa2fcd52c019652d8f73cd957ad85c files/0019-qlistview-adjustcolumn.patch 1508
+MD5 e4b92fbf81b7fc94c5d337e1675476d7 files/qt-x11-free-3.0.5-ko_input.patch 12682
+MD5 3b9e1d14819114b64b8bf770e1a474cd files/0011-listview_keys.patch 2520
+MD5 037b7ee164790946df6a2d6ea89f01fc files/digest-qt-2.3.2-r1 65
MD5 8c9b47edf5949643d8dbeb3fecc40e7c files/qt-3.1.2-qfont-jp-family-subst-20030421.patch 22730
MD5 bf7aed227565288222ea889c81b1e363 files/qt-3.1.2-qlistview-dnd.diff 469
-MD5 e9b2e2fbde862abb62cdfa78e62a35b6 files/qt-3.1.2-qmlined.diff 320
-MD5 b87df8ba9bf813ffe5e280fa2d79da25 files/qt-3.1.2-qpsprinter-ttc-otf-italic-20030429.patch 19286
-MD5 c6dc1b6fadcb4897d4c7b0a768c2d196 files/qt-3.1.2-r3-qsocket.diff 447
-MD5 024632ca815ede1ccdd13cacea10e64a files/qt-3.1.2-thai-complextext.patch 528
-MD5 e4b92fbf81b7fc94c5d337e1675476d7 files/qt-x11-free-3.0.5-ko_input.patch 12682
-MD5 5716cdfbdcb04ba8e3a25c7e1c49a9cc files/0026-netwm-fullscreen.patch 8243
-MD5 905e62743eb9d6304dc70510c5d3ee69 files/0027-dnd-leak.patch 345
-MD5 8fd2bb8fe0c4752252d064ff62257f9a files/0028-fix_sub_popup_crash.patch 302
+MD5 e6052859850285f5334e722a73b2645b files/qt-3.2.2-crash-fix.patch 1035
+MD5 cf7fad8d582c6b517b3555aba4e26fd1 files/0018-qlistview-paintcell.patch 1442
+MD5 057679471a1149cfba2cabd7a1fd2b55 files/qt-3.2.3-qfontdatabase-i18n-20031024.patch 10536
+MD5 39f840d6723a7e898394bc84efb224a2 files/qt-3.1.0-minimized.diff 272
+MD5 5469328b9b6197e8bbfbe3e1528e61ca files/0014-qiconview-autoscroll.patch 1915
diff --git a/x11-libs/qt/files/qt-3.2.3-qfontdatabase-i18n-20031024.patch b/x11-libs/qt/files/qt-3.2.3-qfontdatabase-i18n-20031024.patch
new file mode 100644
index 000000000000..a904e5990995
--- /dev/null
+++ b/x11-libs/qt/files/qt-3.2.3-qfontdatabase-i18n-20031024.patch
@@ -0,0 +1,374 @@
+diff -u qt-x11-free-3.2.2-patch/src-orig/kernel/qapplication_x11.cpp qt-x11-free-3.2.2-patch/src/kernel/qapplication_x11.cpp
+--- qt-x11-free-3.2.2-patch/src-orig/kernel/qapplication_x11.cpp Fri Oct 10 10:47:25 2003
++++ qt-x11-free-3.2.2-patch/src/kernel/qapplication_x11.cpp Fri Oct 24 02:52:58 2003
+@@ -999,7 +999,7 @@
+ QString fam, skey;
+ QStringList::Iterator it = fontsubs.begin();
+ while (it != fontsubs.end()) {
+- fam = (*it++).latin1();
++ fam = *it++;
+ skey = "/qt/Font Substitutions/" + fam;
+ subs = settings.readListEntry(skey);
+ QFont::insertSubstitutions(fam, subs);
+diff -u qt-x11-free-3.2.2-patch/src-orig/kernel/qfontdatabase.cpp qt-x11-free-3.2.2-patch/src/kernel/qfontdatabase.cpp
+--- qt-x11-free-3.2.2-patch/src-orig/kernel/qfontdatabase.cpp Fri Oct 10 10:47:32 2003
++++ qt-x11-free-3.2.2-patch/src/kernel/qfontdatabase.cpp Fri Oct 24 02:52:58 2003
+@@ -67,6 +67,11 @@
+ # define for if(0){}else for
+ #endif
+
++#ifdef Q_WS_X11
++#include <qdict.h>
++QDict<QString> *qt_FamilyDictXft = 0;
++#endif
++
+ static int ucstricmp( const QString &as, const QString &bs )
+ {
+ const QChar *a = as.unicode();
+@@ -205,6 +210,7 @@
+ {
+ #if defined(Q_WS_X11)
+ weightName = setwidthName = 0;
++ rawName = "";
+ #endif // Q_WS_X11
+ }
+
+@@ -228,6 +234,7 @@
+ #ifdef Q_WS_X11
+ const char *weightName;
+ const char *setwidthName;
++ QString rawName;
+ #endif // Q_WS_X11
+
+ QtFontSize *pixelSize( unsigned short size, bool = FALSE );
+@@ -2331,6 +2338,14 @@
+ foundry = QString::null;
+ family = name;
+ }
++
++#ifdef Q_WS_X11
++ if ( qt_FamilyDictXft && !family.isEmpty() ) {
++ QString* ptr = qt_FamilyDictXft->find( family );
++ if ( ptr )
++ family = *ptr;
++ }
++#endif // Q_WS_X11
+ }
+
+ #endif // QT_NO_FONTDATABASE
+diff -u qt-x11-free-3.2.2-patch/src-orig/kernel/qfontdatabase_x11.cpp qt-x11-free-3.2.2-patch/src/kernel/qfontdatabase_x11.cpp
+--- qt-x11-free-3.2.2-patch/src-orig/kernel/qfontdatabase_x11.cpp Fri Oct 10 10:47:29 2003
++++ qt-x11-free-3.2.2-patch/src/kernel/qfontdatabase_x11.cpp Fri Oct 24 02:52:58 2003
+@@ -52,6 +52,9 @@
+
+ #ifndef QT_NO_XFTFREETYPE
+ #include <freetype/freetype.h>
++#include <qfile.h>
++#include <qdict.h>
++#include <qtextcodec.h>
+ #endif
+
+ #ifdef QFONTDATABASE_DEBUG
+@@ -783,11 +786,185 @@
+ return qtweight;
+ }
+
++
++static void getInfoFromSfntTables( const char *file, uint index,
++ QByteArray &tmp_buffer,
++ QTextCodec *locale, QTextCodec *utf16,
++ QString &familyName, int &spacing )
++{
++#define Q_GET_ULONG( p ) ( ( (Q_UINT32)(((Q_UINT8*)(p))[0]) << 24 ) | \
++ ( (Q_UINT32)(((Q_UINT8*)(p))[1]) << 16 ) | \
++ ( (Q_UINT32)(((Q_UINT8*)(p))[2]) << 8 ) | \
++ ( (Q_UINT32)(((Q_UINT8*)(p))[3]) << 0 ) )
++#define Q_GET_USHORT( p ) ( ( (Q_UINT16)(((Q_UINT8*)(p))[0]) << 8 ) | \
++ ( (Q_UINT16)(((Q_UINT8*)(p))[1]) << 0 ) )
++
++ QFile f( QFile::decodeName( QCString( file ) ) );
++ if ( !f.open( IO_ReadOnly ) )
++ return;
++
++ char* buf = tmp_buffer.data();
++ char* b = buf;
++ Q_UINT16 i;
++
++ if ( f.readBlock( buf, 12 ) < 12 )
++ return;
++
++ if ( b[0] == 't' && b[1] == 't' && b[2] == 'c' && b[3] == 'f' ) {
++ Q_ULONG numFonts = Q_GET_ULONG( b+8 );
++ if ( index + 1 > numFonts )
++ return;
++ if ( !f.at( 12 + 4*index ) || f.readBlock( buf, 4 ) < 4 )
++ return;
++ Q_ULONG OffsetTable = Q_GET_ULONG( b );
++ if ( !f.at( OffsetTable ) || f.readBlock( buf, 12 ) < 12 )
++ return;
++ }
++ else if ( index > 0 )
++ return;
++
++ // TrueType or CFF ?
++ if ( !( b[0] == 0 && b[1] == 1 && b[2] == 0 && b[3] == 0 ) &&
++ !( b[0] == 'O' && b[1] == 'T' && b[2] == 'T' && b[3] == 'O' ) )
++ return;
++
++ Q_ULONG numTables = Q_GET_USHORT( b+4 );
++ if ( numTables == 0 || numTables > 64 ||
++ (Q_ULONG)f.readBlock( buf, 16 * numTables ) < 16 * numTables )
++ return;
++
++ if ( spacing == XFT_PROPORTIONAL ) {
++ for ( i = 0, b = buf; i < numTables; i++, b += 16 ) {
++ if ( b[0] == 'O' && b[1] == 'S' && b[2] == '/' && b[3] == '2' ) {
++ Q_ULONG offset = Q_GET_ULONG( b+8 );
++ Q_UINT8 panose[10];
++
++ if ( !f.at( offset + 16*2 ) ||
++ f.readBlock( (char *)panose, 10 ) < 10 )
++ break;
++
++ if ( panose[3] == 9 )
++ spacing = XFT_MONO;
++ break;
++ }
++ }
++ }
++
++
++ Q_ULONG table_length = 0;
++ for ( i = 0, b = buf; i < numTables; i++, b += 16 ) {
++ if ( b[0] == 'n' && b[1] == 'a' && b[2] == 'm' && b[3] == 'e' ) {
++ Q_ULONG offset = Q_GET_ULONG( b+8 );
++ Q_ULONG length = Q_GET_ULONG( b+12 );
++
++ if ( length < 12 )
++ return;
++ if ( length > tmp_buffer.size() &&
++ !tmp_buffer.resize( length, QGArray::SpeedOptim ) )
++ return;
++
++ buf = tmp_buffer.data();
++ if ( !f.at( offset ) || (Q_ULONG)f.readBlock( buf, length ) < length )
++ return;
++
++ table_length = length;
++ break;
++ }
++ }
++
++ if ( i == numTables )
++ return;
++
++ b = buf;
++ Q_UINT16 count = Q_GET_USHORT( b+2 );
++ Q_UINT16 stringOffset = Q_GET_USHORT( b+4 );
++ if ( (Q_ULONG)( 12 + 12 * count ) > table_length )
++ return;
++
++ QStringList nameList( familyName );
++ char* strings = buf + stringOffset;
++ char* limit = buf + table_length;
++ int n_locNames = 0;
++ for ( i = 0, b = buf + 6; i < count; i++, b += 12 ) {
++ Q_UINT16 platformID = Q_GET_USHORT( b+0 );
++ Q_UINT16 encodingID = Q_GET_USHORT( b+2 );
++ // Q_UINT16 languageID = Q_GET_ULONG( b+4 );
++ Q_UINT16 nameID = Q_GET_USHORT( b+6 );
++ Q_UINT16 length = Q_GET_USHORT( b+8 );
++ Q_UINT16 offset = Q_GET_USHORT( b+10 );
++
++ if ( platformID != 3 || // ! Microsoft
++ encodingID != 1 || // ! UTF16
++ nameID != 1 || // ! family name
++ strings + offset + length > limit ) // oversize
++ continue;
++
++ QString family = utf16->toUnicode( strings + offset, length );
++
++ family.replace('-', ' ');
++ family.replace("/", "");
++
++ if ( !nameList.contains( family ) ) {
++ if ( locale && locale->canEncode( family ) ) {
++ nameList.prepend( family );
++ n_locNames += 1;
++
++ } else {
++ nameList.append( family );
++ }
++ }
++ }
++
++ if ( n_locNames > 0 ) {
++ familyName = "";
++
++ QStringList::iterator it = nameList.begin();
++ for ( ; n_locNames > 0; --n_locNames, ++it ) {
++ const unsigned short* ucs2 = (*it).ucs2();
++ uint len = (*it).length();
++
++ for ( ; len > 0; len-- ) {
++ if ( *ucs2++ >= 128 ) {
++ familyName = *it;
++ nameList.remove( it );
++ break;
++ }
++ }
++
++ if ( len > 0 )
++ break;
++ }
++
++ if ( familyName.isEmpty() ) {
++ familyName = *nameList.begin();
++ nameList.remove( nameList.begin() );
++ }
++
++ } else {
++ nameList.remove( nameList.begin() );
++ }
++
++ if ( nameList.count() > 0 ) {
++ QStringList::iterator it = nameList.begin();
++ QStringList::iterator end = nameList.end();
++
++ for ( ; it != end; ++it ) {
++ qt_FamilyDictXft->insert( *it, new QString( familyName ) );
++ }
++ }
++}
++
++
+ static void loadXft()
+ {
+ if (!qt_has_xft)
+ return;
+
++ if ( !qt_FamilyDictXft ) {
++ qt_FamilyDictXft = new QDict<QString>( 17, FALSE );
++ qt_FamilyDictXft->setAutoDelete( TRUE );
++ }
++
+ XftFontSet *fonts;
+
+ QString familyName;
+@@ -798,13 +975,43 @@
+ int spacing_value;
+ char *file_value;
+ int index_value;
++ char *style_value;
++
++ QByteArray tmp_buffer( 4096 );
++ QTextCodec *utf16 = QTextCodec::codecForName( "ISO-10646-UCS-2" );
++ QTextCodec *locale = QTextCodec::codecForLocale();
++
++ int mib = locale ? locale->mibEnum() : 4;
++ switch ( mib ) {
++#if 1
++ case 4: // Latin1
++ case 111: // Latin15
++ locale = 0;
++ break;
++#else
++ case 38: // eucKR
++ case 2025: // GB2312
++ case 113: // GBK
++ case 114: // GB18030
++ case 2026: // Big5
++ case 2101: // Big5-HKSCS
++ case 16: // JIS7
++ case 17: // SJIS
++ case 18: // eucJP
++ break;
++
++ default:
++ locale = 0;
++ break;
++#endif
++ }
+
+ fonts =
+ XftListFonts(QPaintDevice::x11AppDisplay(),
+ QPaintDevice::x11AppScreen(),
+ (const char *)0,
+ XFT_FAMILY, XFT_WEIGHT, XFT_SLANT,
+- XFT_SPACING, XFT_FILE, XFT_INDEX,
++ XFT_SPACING, XFT_FILE, XFT_INDEX, XFT_STYLE,
+ #ifdef QT_XFT2
+ FC_CHARSET,
+ #endif // QT_XFT2
+@@ -828,6 +1035,10 @@
+ XftPatternGetString (fonts->fonts[i], XFT_FILE, 0, &file_value);
+ XftPatternGetInteger (fonts->fonts[i], XFT_INDEX, 0, &index_value);
+
++ getInfoFromSfntTables( file_value, index_value,
++ tmp_buffer, locale, utf16,
++ familyName, spacing_value );
++
+ QtFontFamily *family = db->family( familyName, TRUE );
+ family->rawName = rawName;
+ family->hasXft = TRUE;
+@@ -867,6 +1078,10 @@
+ style->smoothScalable = TRUE;
+ family->fixedPitch = ( spacing_value >= XFT_MONO );
+
++ if ( XftPatternGetString (fonts->fonts[i],
++ XFT_STYLE, 0, &style_value) == XftResultMatch )
++ style->rawName = QString::fromUtf8( style_value );
++
+ QtFontSize *size = style->pixelSize( SMOOTH_SCALABLE, TRUE );
+ QtFontEncoding *enc = size->encodingID( -1, 0, 0, 0, 0, TRUE );
+ enc->pitch = ( spacing_value >= XFT_CHARCELL ? 'c' :
+@@ -874,6 +1089,11 @@
+ }
+
+ XftFontSetDestroy (fonts);
++
++ if ( qt_FamilyDictXft->count() == 0 ) {
++ delete qt_FamilyDictXft;
++ qt_FamilyDictXft = 0;
++ }
+ }
+
+ #ifndef QT_XFT2
+@@ -1192,6 +1412,7 @@
+ equiv->fakeOblique = TRUE;
+ #endif // !QT_XFT2
+ equiv->smoothScalable = TRUE;
++ equiv->rawName = style->rawName;
+
+ QtFontSize *equiv_size = equiv->pixelSize( SMOOTH_SCALABLE, TRUE );
+ QtFontEncoding *equiv_enc = equiv_size->encodingID( -1, 0, 0, 0, 0, TRUE );
+@@ -1309,6 +1530,11 @@
+ XftPatternAddString( pattern, XFT_FAMILY,
+ family->rawName.utf8().data() );
+
++ if ( !style->rawName.isEmpty() )
++ XftPatternAddString( pattern, XFT_STYLE,
++ style->rawName.utf8().data() );
++
++
+ const char *stylehint_value = 0;
+ switch ( request.styleHint ) {
+ case QFont::SansSerif:
+@@ -1396,6 +1622,17 @@
+ XftPattern *result =
+ XftFontMatch( QPaintDevice::x11AppDisplay(), fp->screen, pattern, &res );
+ XftPatternDestroy(pattern);
++
++ for ( int s = QFont::Han; s <= QFont::Yi; s++ ) {
++ if ( !( family->scripts[s] & QtFontFamily::UnSupported_Xft ) ) {
++ XftPatternDel( result, XFT_SPACING );
++# ifdef QT_XFT2
++ FcPatternDel( result, FC_GLOBAL_ADVANCE );
++ FcPatternAddBool( result, FC_GLOBAL_ADVANCE, FcFalse );
++ break;
++# endif
++ }
++ }
+
+ // We pass a duplicate to XftFontOpenPattern because either xft font
+ // will own the pattern after the call or the pattern will be
diff --git a/x11-libs/qt/files/qt-3.2.3-qpsprinter-useFreeType2-20031128.patch b/x11-libs/qt/files/qt-3.2.3-qpsprinter-useFreeType2-20031128.patch
new file mode 100644
index 000000000000..22b2439c6914
--- /dev/null
+++ b/x11-libs/qt/files/qt-3.2.3-qpsprinter-useFreeType2-20031128.patch
@@ -0,0 +1,372 @@
+--- qt-x11-free-3.2.3-fix/src/kernel/qpsprinter.cpp Mon Nov 10 19:21:57 2003
++++ qt-x11-free-3.2.3/src/kernel/qpsprinter.cpp Fri Nov 28 20:25:38 2003
+@@ -98,6 +98,12 @@
+ #include "qtextlayout_p.h"
+ #include "qtextengine_p.h"
+ extern bool qt_has_xft;
++
++#ifndef QT_NO_XFTFREETYPE
++#include <ft2build.h>
++#include FT_OUTLINE_H
++#endif
++
+ #endif
+
+ static bool qt_gen_epsf = FALSE;
+@@ -2076,6 +2082,32 @@
+
+ // ================== TTF ====================
+
++#ifndef QT_NO_XFTFREETYPE
++
++static void
++getXftData( const QFontEngine *engine,
++ int &index, int &weight, int &slant, XftMatrix &matrix )
++{
++ XftPattern* font = static_cast<const QFontEngineXft *>( engine )->pattern();
++ XftMatrix unit = { 1.0, 0, 0, 1.0 };
++ XftMatrix* mat;
++
++ index = 0;
++ weight = XFT_WEIGHT_MEDIUM;
++ slant = XFT_SLANT_ROMAN;
++ matrix = unit;
++
++ XftPatternGetInteger( font, XFT_INDEX, 0, &index );
++ XftPatternGetInteger( font, XFT_WEIGHT, 0, &weight );
++ XftPatternGetInteger( font, XFT_SLANT, 0, &slant );
++
++ if ( XftPatternGetMatrix( font, XFT_MATRIX, 0, &mat ) == XftResultMatch )
++ matrix = *mat;
++}
++
++#endif // QT_NO_XFTFREETYPE
++
++
+ typedef Q_UINT8 BYTE;
+ typedef Q_UINT16 USHORT;
+ typedef Q_UINT16 uFWord;
+@@ -2184,6 +2216,16 @@
+
+ int indexToLocFormat; /* short or long offsets */
+
++#ifndef QT_NO_XFTFREETYPE
++ FT_Face face;
++ int index;
++ int weight;
++ int slant;
++ XftMatrix matrix;
++
++ QString StyleName_Extension;
++#endif // QT_NO_XFTFREETYPE
++
+ };
+
+
+@@ -2293,6 +2335,58 @@
+ #endif
+ offset_table = (unsigned char*) data.data(); /* first 12 bytes */
+
++#ifndef QT_NO_XFTFREETYPE
++ if ( target_type == 42 ) {
++ if ( !( d[0] == '0' && d[1] == '1' && d[2] == '0' && d[3] == '0' ) ) {
++ defective = TRUE;
++ return;
++ }
++ }
++
++ face = 0;
++ StyleName_Extension = "";
++ getXftData( f, index, weight, slant, matrix );
++
++ if ( qt_has_xft && f->type() == QFontEngine::Xft ) {
++ extern FT_Library _XftFTlibrary;
++
++ if ( FT_New_Memory_Face( _XftFTlibrary,
++ (const FT_Byte*)data.data(),
++ data.size(), index, &face ) ||
++ ( face->face_flags & FT_FACE_FLAG_SCALABLE ) == 0 ) {
++ defective = TRUE;
++ return;
++ }
++
++ FT_Set_Pixel_Sizes( face, 1000, 1000 );
++
++ bool bold = ( face->style_flags & FT_STYLE_FLAG_BOLD ) != 0;
++ bool italic = ( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0;
++
++ if ( weight > XFT_WEIGHT_MEDIUM && !bold )
++ StyleName_Extension += "Bold";
++ if ( slant > XFT_SLANT_ROMAN && !italic )
++ StyleName_Extension += "Oblique";
++
++ if ( !StyleName_Extension.isEmpty() )
++ StyleName_Extension = "-" + StyleName_Extension;
++
++ if ( matrix.xx != 1.0 || matrix.xy != 0.0 ||
++ matrix.yx != 0.0 || matrix.yy != 1.0 )
++ StyleName_Extension += QString( "-%1-%2-%3-%4" )
++ .arg( matrix.xx, 0, 'f' )
++ .arg( matrix.yx, 0, 'f' )
++ .arg( matrix.xy, 0, 'f' )
++ .arg( matrix.yy, 0, 'f' );
++
++ StyleName_Extension.replace( '.', '_' );
++ }
++
++ if ( d[0] == 't' && d[1] == 't' && d[2] == 'c' && d[3] == 'f' )
++ offset_table += getULONG( offset_table + 12 + 4 * index );
++#endif
++
++
+ /* Determine how many directory entries there are. */
+ numTables = getUSHORT( offset_table + 4 );
+
+@@ -2408,6 +2502,11 @@
+ // qDebug("number of glyphs is %d", numGlyphs);
+ replacementList = makePSFontNameList( f, psname );
+ uni2glyphSetup();
++
++#ifndef QT_NO_XFTFREETYPE
++ psname += StyleName_Extension;
++ FullName += StyleName_Extension;
++#endif
+ }
+
+
+@@ -2524,7 +2623,7 @@
+ if( target_type == 42 )
+ s << "%%Creator: Converted from TrueType to type 42 by Qt\n";
+ else
+- s << "%%Creator: Converted from TrueType by Qt\n";
++ s << "%%Creator: Converted from TrueType/OpenType by Qt\n";
+
+ /* If VM usage information is available, print it. */
+ if( target_type == 42 && post_table)
+@@ -2546,7 +2645,7 @@
+ s << "/_d{bind def}bind def\n";
+ s << "/_m{moveto}_d\n";
+ s << "/_l{lineto}_d\n";
+- s << "/_cl{closepath eofill}_d\n";
++ s << "/_cl{closepath fill}_d\n";
+ s << "/_c{curveto}_d\n";
+ s << "/_sc{7 -1 roll{setcachedevice}{pop pop pop pop pop pop}ifelse}_d\n";
+ s << "/_e{exec}_d\n";
+@@ -2560,7 +2659,15 @@
+ if(target_type == 42)
+ s << "/FontMatrix[1 0 0 1 0 0]def\n";
+ else
++#ifndef QT_NO_XFTFREETYPE
++ s << QString( "/FontMatrix[%1 %2 %3 %4 0 0]def\n" )
++ .arg( 0.001 * matrix.xx, 0, 'f', 6 )
++ .arg( 0.001 * matrix.yx, 0, 'f', 6 )
++ .arg( 0.001 * matrix.xy, 0, 'f', 6 )
++ .arg( 0.001 * matrix.yy, 0, 'f', 6 );
++#else
+ s << "/FontMatrix[.001 0 0 .001 0 0]def\n";
++#endif
+
+ s << "/FontBBox[";
+ s<< llx;
+@@ -2703,6 +2810,11 @@
+
+ s << "end readonly def\n";
+
++ if ( face ) {
++ FT_Done_Face( face );
++ face = 0;
++ }
++
+ // === trailer ===
+
+ /* If we are generating a type 3 font, we need to provide */
+@@ -2845,7 +2957,7 @@
+ offset = getULONG( ptr + 8 );
+ //length = getULONG( ptr + 12 );
+
+- table = offset_table + offset;
++ table = (BYTE*)data.data() + offset;
+ return table;
+ }
+
+@@ -3348,6 +3460,123 @@
+ }
+ }
+
++
++#ifndef QT_NO_XFTFREETYPE
++
++#undef DOWNSCALE
++#define DOWNSCALE( x ) ( ( (x) + 32 ) >> 6 )
++
++extern "C" {
++
++static FT_Vector from;
++
++ static FT_Error
++ PSMovetoFT( FT_Vector* to, QTextStream *s )
++ {
++ if ( !to ) {
++ stack( 100, 1, *s );
++ (*s) << " _cl";
++ } else {
++ stack( 100, 3, *s );
++ (*s) << DOWNSCALE( to->x ) << " "
++ << DOWNSCALE( to->y ) << " _m\n";
++ from = *to;
++ }
++
++ return FT_Err_Ok;
++ }
++
++ static FT_Error
++ PSLinetoFT( FT_Vector* to,
++ QTextStream *s )
++ {
++ stack( 100, 3, *s );
++ (*s) << DOWNSCALE( to->x ) << " "
++ << DOWNSCALE( to->y ) << " _l\n";
++ from = *to;
++ return FT_Err_Ok;
++ }
++
++ static FT_Error
++ PSCubictoFT( FT_Vector* ctrl1, FT_Vector* ctrl2, FT_Vector* to,
++ QTextStream *s )
++ {
++ stack( 100, 7, *s );
++ (*s) << DOWNSCALE( ctrl1->x ) << " "
++ << DOWNSCALE( ctrl1->y ) << " "
++ << DOWNSCALE( ctrl2->x ) << " "
++ << DOWNSCALE( ctrl2->y ) << " "
++ << DOWNSCALE( to->x ) << " "
++ << DOWNSCALE( to->y ) << " _c\n";
++ from = *to;
++ return FT_Err_Ok;
++ }
++
++ static FT_Error
++ PSConictoFT( FT_Vector* ctrl, FT_Vector* to,
++ QTextStream *s )
++ {
++ FT_Vector ctrl1, ctrl2;
++
++
++ ctrl1.x = ( from.x + 2*ctrl->x ) / 3;
++ ctrl1.y = ( from.y + 2*ctrl->y ) / 3;
++ ctrl2.x = ( to->x + 2*ctrl->x ) / 3;
++ ctrl2.y = ( to->y + 2*ctrl->y ) / 3;
++
++ return PSCubictoFT( &ctrl1, &ctrl2, to, s );
++ }
++
++} // extern "C"
++
++static void
++charprocFT( FT_Face face, FT_UInt glyph_index,
++ int weight, int slant, QTextStream &s )
++{
++ static const FT_Outline_Funcs funcs =
++ {
++ (FT_Outline_MoveToFunc) PSMovetoFT,
++ (FT_Outline_LineToFunc) PSLinetoFT,
++ (FT_Outline_ConicToFunc) PSConictoFT,
++ (FT_Outline_CubicToFunc) PSCubictoFT,
++ 0, 0
++ };
++
++ FT_Int32 load_flags = FT_LOAD_NO_BITMAP |
++ FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH;
++
++ Q_UNUSED( weight );
++ Q_UNUSED( slant );
++
++ if ( !FT_Load_Glyph( face, glyph_index, load_flags ) ) {
++ FT_Glyph_Metrics* metrics = &face->glyph->metrics;
++
++ stack( 100, 7, s );
++ s << ( ( face->glyph->linearHoriAdvance + 0x8000L ) >> 16 );
++ s << " 0 ";
++ s << DOWNSCALE( metrics->horiBearingX );
++ s << " ";
++ s << DOWNSCALE( metrics->horiBearingY - metrics->height );
++ s << " ";
++ s << DOWNSCALE( metrics->horiBearingX + metrics->width );
++ s << " ";
++ s << DOWNSCALE( metrics->horiBearingY );
++ s << " _sc\n";
++
++ FT_Outline_Decompose( &face->glyph->outline, &funcs, &s );
++ PSMovetoFT( 0, &s );
++
++ } else {
++ stack( 7, 7, s );
++ s << "0 0 0 0 0 0 0 _sc\n";
++ }
++
++ stack_end( s );
++ return;
++}
++
++#endif // QT_NO_XFTFREETYPE
++
+ // postscript drawing commands
+
+ static void PSMoveto(FWord x, FWord y, QTextStream& ts)
+@@ -3742,6 +3971,12 @@
+ charproc_data cd;
+
+ glyphset[charindex] = TRUE;
++
++#ifndef QT_NO_XFTFREETYPE
++ if ( face )
++ return;
++#endif // QT_NO_XFTFREETYPE
++
+ //printf("subsetting %s ==> ",glyphName(charindex).latin1());
+
+ /* Get a pointer to the data. */
+@@ -3943,6 +4178,11 @@
+ s << "\n";
+ #endif
+
++ if ( face ) {
++ charprocFT( face, charindex, weight, slant, s );
++ return;
++ }
++
+ /* Get a pointer to the data. */
+ BYTE* glyph = charprocFindGlyphData( charindex );
+
+@@ -4889,9 +5129,17 @@
+ char *filename = 0;
+ XftPatternGetString (pattern, XFT_FILE, 0, &filename);
+ //qDebug("filename for font is '%s'", filename);
++ int index, weight, slant;
++ XftMatrix matrix;
++ getXftData (engine, index, weight, slant, matrix);
++ QString style = QString("-I%1-W%2-S%3-M[%4,%5,%6,%7]")
++ .arg(index).arg(weight).arg(slant)
++ .arg(matrix.xx).arg(matrix.xy)
++ .arg(matrix.yx).arg(matrix.yy);
++
+ if ( filename ) {
+ fontfilename = QString::fromLocal8Bit( filename );
+- xfontname = fontfilename;
++ xfontname = fontfilename + style;
+ }
+ } else
+ #endif
+@@ -5030,6 +5278,12 @@
+ type = PFA;
+ else if (d[0]==0x00 && d[1]==0x01 && d[2]==0x00 && d[3]==0x00)
+ type = TTF;
++#ifndef QT_NO_XFTFREETYPE
++ else if (d[0]=='t' && d[1]=='t' && d[2]=='c' && d[3]=='f')
++ type = TTF;
++ else if (d[0]=='O' && d[1]=='T' && d[2]=='T' && d[3]=='O')
++ type = TTF;
++#endif // QT_NO_XFTFREETYPE
+ else
+ type = NONE;
+ } else
diff --git a/x11-libs/qt/files/qt-3.2.3-scriptForChar-20031128.patch b/x11-libs/qt/files/qt-3.2.3-scriptForChar-20031128.patch
new file mode 100644
index 000000000000..ae567d1c35b1
--- /dev/null
+++ b/x11-libs/qt/files/qt-3.2.3-scriptForChar-20031128.patch
@@ -0,0 +1,546 @@
+diff -ur qt-x11-free-3.2.3-fix/src-orig/kernel/qfont.cpp qt-x11-free-3.2.3-fix/src/kernel/qfont.cpp
+--- qt-x11-free-3.2.3-fix/src-orig/kernel/qfont.cpp Mon Nov 10 19:21:57 2003
++++ qt-x11-free-3.2.3-fix/src/kernel/qfont.cpp Fri Nov 28 20:44:37 2003
+@@ -208,6 +208,10 @@
+ #ifndef Q_WS_MAC
+ memset( widthCache, 0, widthCacheSize*sizeof( uchar ) );
+ #endif
++#ifdef Q_WS_X11
++ memset( scripts_uniEngine, 0, QFont::LastPrivateScript * sizeof( uchar ) );
++ uniEngine = 0;
++#endif
+ }
+
+ QFontEngineData::~QFontEngineData()
+@@ -223,6 +227,10 @@
+ engine->deref();
+ engine = 0;
+ #endif // Q_WS_X11 || Q_WS_WIN
++#ifdef Q_WS_X11
++ memset( scripts_uniEngine, 0, QFont::LastPrivateScript * sizeof( uchar ) );
++ uniEngine = 0;
++#endif
+ }
+
+
+@@ -1244,7 +1252,7 @@
+ */
+ bool QFont::exactMatch() const
+ {
+- QFontEngine *engine = d->engineForScript( QFont::NoScript );
++ QFontEngine *engine = d->m_engineForScript( QFont::NoScript );
+ #ifdef QT_CHECK_STATE
+ Q_ASSERT( engine != 0 );
+ #endif // QT_CHECK_STATE
+@@ -1976,8 +1984,8 @@
+ */
+ int QFontMetrics::ascent() const
+ {
+- QFontEngine *engine = d->engineForScript( (QFont::Script) fscript );
+- QFontEngine *latin_engine = d->engineForScript( QFont::Latin );
++ QFontEngine *engine = d->m_engineForScript( (QFont::Script) fscript );
++ QFontEngine *latin_engine = d->m_engineForScript( QFont::Latin );
+ #ifdef QT_CHECK_STATE
+ Q_ASSERT( engine != 0 );
+ Q_ASSERT( latin_engine != 0 );
+@@ -2000,8 +2008,8 @@
+ */
+ int QFontMetrics::descent() const
+ {
+- QFontEngine *engine = d->engineForScript( (QFont::Script) fscript );
+- QFontEngine *latin_engine = d->engineForScript( QFont::Latin );
++ QFontEngine *engine = d->m_engineForScript( (QFont::Script) fscript );
++ QFontEngine *latin_engine = d->m_engineForScript( QFont::Latin );
+ #ifdef QT_CHECK_STATE
+ Q_ASSERT( engine != 0 );
+ Q_ASSERT( latin_engine != 0 );
+@@ -2020,8 +2028,8 @@
+ */
+ int QFontMetrics::height() const
+ {
+- QFontEngine *engine = d->engineForScript( (QFont::Script) fscript );
+- QFontEngine *latin_engine = d->engineForScript( QFont::Latin );
++ QFontEngine *engine = d->m_engineForScript( (QFont::Script) fscript );
++ QFontEngine *latin_engine = d->m_engineForScript( QFont::Latin );
+ #ifdef QT_CHECK_STATE
+ Q_ASSERT( engine != 0 );
+ Q_ASSERT( latin_engine != 0 );
+@@ -2040,8 +2048,8 @@
+ */
+ int QFontMetrics::leading() const
+ {
+- QFontEngine *engine = d->engineForScript( (QFont::Script) fscript );
+- QFontEngine *latin_engine = d->engineForScript( QFont::Latin );
++ QFontEngine *engine = d->m_engineForScript( (QFont::Script) fscript );
++ QFontEngine *latin_engine = d->m_engineForScript( QFont::Latin );
+ #ifdef QT_CHECK_STATE
+ Q_ASSERT( engine != 0 );
+ Q_ASSERT( latin_engine != 0 );
+@@ -2059,8 +2067,8 @@
+ */
+ int QFontMetrics::lineSpacing() const
+ {
+- QFontEngine *engine = d->engineForScript( (QFont::Script) fscript );
+- QFontEngine *latin_engine = d->engineForScript( QFont::Latin );
++ QFontEngine *engine = d->m_engineForScript( (QFont::Script) fscript );
++ QFontEngine *latin_engine = d->m_engineForScript( QFont::Latin );
+ #ifdef QT_CHECK_STATE
+ Q_ASSERT( engine != 0 );
+ Q_ASSERT( latin_engine != 0 );
+@@ -2083,8 +2091,8 @@
+ */
+ int QFontMetrics::minLeftBearing() const
+ {
+- QFontEngine *engine = d->engineForScript( (QFont::Script) fscript );
+- QFontEngine *latin_engine = d->engineForScript( QFont::Latin );
++ QFontEngine *engine = d->m_engineForScript( (QFont::Script) fscript );
++ QFontEngine *latin_engine = d->m_engineForScript( QFont::Latin );
+ #ifdef QT_CHECK_STATE
+ Q_ASSERT( engine != 0 );
+ Q_ASSERT( latin_engine != 0 );
+@@ -2105,8 +2113,8 @@
+ */
+ int QFontMetrics::minRightBearing() const
+ {
+- QFontEngine *engine = d->engineForScript( (QFont::Script) fscript );
+- QFontEngine *latin_engine = d->engineForScript( QFont::Latin );
++ QFontEngine *engine = d->m_engineForScript( (QFont::Script) fscript );
++ QFontEngine *latin_engine = d->m_engineForScript( QFont::Latin );
+ #ifdef QT_CHECK_STATE
+ Q_ASSERT( engine != 0 );
+ Q_ASSERT( latin_engine != 0 );
+@@ -2120,8 +2128,8 @@
+ */
+ int QFontMetrics::maxWidth() const
+ {
+- QFontEngine *engine = d->engineForScript( (QFont::Script) fscript );
+- QFontEngine *lengine = d->engineForScript( QFont::Latin );
++ QFontEngine *engine = d->m_engineForScript( (QFont::Script) fscript );
++ QFontEngine *lengine = d->m_engineForScript( QFont::Latin );
+ #ifdef QT_CHECK_STATE
+ Q_ASSERT( engine != 0 );
+ Q_ASSERT( lengine != 0 );
+@@ -2137,7 +2145,7 @@
+ bool QFontMetrics::inFont(QChar ch) const
+ {
+ QFont::Script script;
+- SCRIPT_FOR_CHAR( script, ch );
++ SCRIPT_FOR_CHAR( script, ch, d );
+
+ QFontEngine *engine = d->engineForScript( script );
+ #ifdef QT_CHECK_STATE
+@@ -2164,7 +2172,7 @@
+ int QFontMetrics::leftBearing(QChar ch) const
+ {
+ QFont::Script script;
+- SCRIPT_FOR_CHAR( script, ch );
++ SCRIPT_FOR_CHAR( script, ch, d );
+
+ QFontEngine *engine = d->engineForScript( script );
+ #ifdef QT_CHECK_STATE
+@@ -2198,7 +2206,7 @@
+ int QFontMetrics::rightBearing(QChar ch) const
+ {
+ QFont::Script script;
+- SCRIPT_FOR_CHAR( script, ch );
++ SCRIPT_FOR_CHAR( script, ch, d );
+
+ QFontEngine *engine = d->engineForScript( script );
+ #ifdef QT_CHECK_STATE
+@@ -2248,7 +2256,7 @@
+ width += d->engineData->widthCache[uc];
+ else if ( ::category( *ch ) != QChar::Mark_NonSpacing ) {
+ QFont::Script script;
+- SCRIPT_FOR_CHAR( script, *ch );
++ SCRIPT_FOR_CHAR( script, *ch, d );
+
+ if (script >= QFont::Arabic && script <= QFont::Khmer)
+ break;
+@@ -2378,7 +2386,7 @@
+ QRect QFontMetrics::boundingRect( QChar ch ) const
+ {
+ QFont::Script script;
+- SCRIPT_FOR_CHAR( script, ch );
++ SCRIPT_FOR_CHAR( script, ch, d );
+
+ QFontEngine *engine = d->engineForScript( script );
+ #ifdef QT_CHECK_STATE
+@@ -2519,7 +2527,7 @@
+ */
+ int QFontMetrics::underlinePos() const
+ {
+- QFontEngine *engine = d->engineForScript( (QFont::Script) fscript );
++ QFontEngine *engine = d->m_engineForScript( (QFont::Script) fscript );
+ #ifdef QT_CHECK_STATE
+ Q_ASSERT( engine != 0 );
+ #endif // QT_CHECK_STATE
+@@ -2559,7 +2567,7 @@
+ */
+ int QFontMetrics::lineWidth() const
+ {
+- QFontEngine *engine = d->engineForScript( (QFont::Script) fscript );
++ QFontEngine *engine = d->m_engineForScript( (QFont::Script) fscript );
+ #ifdef QT_CHECK_STATE
+ Q_ASSERT( engine != 0 );
+ #endif // QT_CHECK_STATE
+@@ -2715,7 +2723,7 @@
+ */
+ QString QFontInfo::family() const
+ {
+- QFontEngine *engine = d->engineForScript( (QFont::Script) fscript );
++ QFontEngine *engine = d->m_engineForScript( (QFont::Script) fscript );
+ #ifdef QT_CHECK_STATE
+ Q_ASSERT( engine != 0 );
+ #endif // QT_CHECK_STATE
+@@ -2729,7 +2737,7 @@
+ */
+ int QFontInfo::pointSize() const
+ {
+- QFontEngine *engine = d->engineForScript( (QFont::Script) fscript );
++ QFontEngine *engine = d->m_engineForScript( (QFont::Script) fscript );
+ #ifdef QT_CHECK_STATE
+ Q_ASSERT( engine != 0 );
+ #endif // QT_CHECK_STATE
+@@ -2743,7 +2751,7 @@
+ */
+ int QFontInfo::pixelSize() const
+ {
+- QFontEngine *engine = d->engineForScript( (QFont::Script) fscript );
++ QFontEngine *engine = d->m_engineForScript( (QFont::Script) fscript );
+ #ifdef QT_CHECK_STATE
+ Q_ASSERT( engine != 0 );
+ #endif // QT_CHECK_STATE
+@@ -2757,7 +2765,7 @@
+ */
+ bool QFontInfo::italic() const
+ {
+- QFontEngine *engine = d->engineForScript( (QFont::Script) fscript );
++ QFontEngine *engine = d->m_engineForScript( (QFont::Script) fscript );
+ #ifdef QT_CHECK_STATE
+ Q_ASSERT( engine != 0 );
+ #endif // QT_CHECK_STATE
+@@ -2771,7 +2779,7 @@
+ */
+ int QFontInfo::weight() const
+ {
+- QFontEngine *engine = d->engineForScript( (QFont::Script) fscript );
++ QFontEngine *engine = d->m_engineForScript( (QFont::Script) fscript );
+ #ifdef QT_CHECK_STATE
+ Q_ASSERT( engine != 0 );
+ #endif // QT_CHECK_STATE
+@@ -2838,7 +2846,7 @@
+ */
+ bool QFontInfo::fixedPitch() const
+ {
+- QFontEngine *engine = d->engineForScript( (QFont::Script) fscript );
++ QFontEngine *engine = d->m_engineForScript( (QFont::Script) fscript );
+ #ifdef QT_CHECK_STATE
+ Q_ASSERT( engine != 0 );
+ #endif // QT_CHECK_STATE
+@@ -2865,7 +2873,7 @@
+ */
+ QFont::StyleHint QFontInfo::styleHint() const
+ {
+- QFontEngine *engine = d->engineForScript( (QFont::Script) fscript );
++ QFontEngine *engine = d->m_engineForScript( (QFont::Script) fscript );
+ #ifdef QT_CHECK_STATE
+ Q_ASSERT( engine != 0 );
+ #endif // QT_CHECK_STATE
+@@ -2895,7 +2903,7 @@
+ */
+ bool QFontInfo::exactMatch() const
+ {
+- QFontEngine *engine = d->engineForScript( (QFont::Script) fscript );
++ QFontEngine *engine = d->m_engineForScript( (QFont::Script) fscript );
+ #ifdef QT_CHECK_STATE
+ Q_ASSERT( engine != 0 );
+ #endif // QT_CHECK_STATE
+diff -ur qt-x11-free-3.2.3-fix/src-orig/kernel/qfont_x11.cpp qt-x11-free-3.2.3-fix/src/kernel/qfont_x11.cpp
+--- qt-x11-free-3.2.3-fix/src-orig/kernel/qfont_x11.cpp Mon Nov 10 19:22:04 2003
++++ qt-x11-free-3.2.3-fix/src/kernel/qfont_x11.cpp Fri Nov 28 20:44:37 2003
+@@ -56,6 +56,7 @@
+ #include "qfontdata_p.h"
+ #include "qfontengine_p.h"
+ #include "qtextengine_p.h"
++#include "qscriptengine_p.h"
+
+ #include "qt_x11_p.h"
+
+@@ -277,7 +278,7 @@
+ QFontPrivate *priv = new QFontPrivate;
+
+ for ( uint i = 0; i < sample.length(); i++ ) {
+- SCRIPT_FOR_CHAR( tmp, *uc );
++ SCRIPT_FOR_CHAR( tmp, *uc, 0 );
+ uc++;
+ if ( tmp != cs && tmp != QFont::UnknownScript ) {
+ cs = tmp;
+@@ -364,12 +365,23 @@
+ // the cached engineData could have already loaded the engine we want
+ if ( engineData->engines[script] ) return;
+
++ static ShapeFunction basic_shape = scriptEngines[QFont::Latin].shape;
++ QFontEngine *uniEngine = 0;
++
++ if ( script != QFont::Unicode &&
++ scriptEngines[script].shape == basic_shape ) {
++ if ( !engineData->engines[QFont::Unicode] )
++ load( QFont::Unicode );
++ uniEngine = engineData->uniEngine;
++ }
++
+ // load the font
+ QFontEngine *engine = 0;
+ // double scale = 1.0; // ### TODO: fix the scale calculations
+
+ // list of families to try
+ QStringList family_list = QStringList::split( ',', req.family );
++ int count = family_list.count();
+
+ // append the substitute list for each family in family_list
+ QStringList subs_list;
+@@ -399,13 +411,17 @@
+ family_list << QString::null;
+
+ it = family_list.begin(), end = family_list.end();
+- for ( ; ! engine && it != end; ++it ) {
++ for ( ; ! engine && it != end; ++it, --count ) {
+ req.family = *it;
+
+ engine = QFontDatabase::findFont( script, this, req );
+ if ( engine ) {
+- if ( engine->type() != QFontEngine::Box )
+- break;
++ if ( engine->type() != QFontEngine::Box ) {
++ if ( script != QFont::Unicode && engine == uniEngine )
++ engineData->scripts_uniEngine[script] = 1;
++ if ( engine != uniEngine )
++ break;
++ }
+
+ if ( ! req.family.isEmpty() )
+ engine = 0;
+@@ -416,6 +432,49 @@
+
+ engine->ref();
+ engineData->engines[script] = engine;
++
++ if ( script == QFont::Unicode && count > 0 ) {
++ QString req_family, req_foundry, font_family, font_foundry;
++
++ QFontDatabase::parseFontName(req.family, req_foundry, req_family);
++ QFontDatabase::parseFontName(engine->fontDef.family,
++ font_foundry, font_family);
++
++ if ( req_family == font_family &&
++ ( req_foundry.isEmpty() ||
++ font_foundry.isEmpty() ||
++ req_foundry == font_foundry ) )
++ engineData->uniEngine = engine;
++ }
++}
++
++QFont::Script QFontPrivate::checkSpecialScript( QFont::Script script,
++ const QChar &ch )
++{
++ static ShapeFunction basic_shape = scriptEngines[QFont::Latin].shape;
++
++ if ( scriptEngines[script].shape != basic_shape )
++ return script;
++
++ if ( !engineData || !engineData->engines[QFont::Unicode] )
++ load( QFont::Unicode );
++
++ if ( engineData->uniEngine ) {
++ if ( engineData->uniEngine->canRender( &ch, 1 ) )
++ return QFont::Unicode;
++
++ } else {
++ if ( script != QFontPrivate::defaultScript &&
++ QFontPrivate::defaultScript != QFont::Unicode &&
++ QFontPrivate::defaultScript != QFont::UnknownScript ) {
++ QFontEngine *fe = engineForScript( QFontPrivate::defaultScript );
++
++ if ( fe->type() == QFontEngine::XLFD && fe->canRender( &ch, 1 ) )
++ return QFontPrivate::defaultScript;
++ }
++ }
++
++ return script;
+ }
+
+ /*!
+@@ -433,7 +492,7 @@
+ */
+ Qt::HANDLE QFont::handle() const
+ {
+- QFontEngine *engine = d->engineForScript( QFontPrivate::defaultScript );
++ QFontEngine *engine = d->m_engineForScript( QFontPrivate::defaultScript );
+ #ifdef QT_CHECK_STATE
+ Q_ASSERT( engine != 0 );
+ #endif // QT_CHECK_STATE
+@@ -466,7 +525,7 @@
+ */
+ QString QFont::rawName() const
+ {
+- QFontEngine *engine = d->engineForScript( QFontPrivate::defaultScript );
++ QFontEngine *engine = d->m_engineForScript( QFontPrivate::defaultScript );
+ #ifdef QT_CHECK_STATE
+ Q_ASSERT( engine != 0 );
+ #endif // QT_CHECK_STATE
+@@ -656,7 +715,7 @@
+ return 0;
+
+ QFont::Script script;
+- SCRIPT_FOR_CHAR( script, ch );
++ SCRIPT_FOR_CHAR( script, ch, d );
+
+ QFontEngine *engine = d->engineForScript( script );
+ #ifdef QT_CHECK_STATE
+@@ -690,7 +749,7 @@
+ return 0;
+
+ QFont::Script script;
+- SCRIPT_FOR_CHAR( script, ch );
++ SCRIPT_FOR_CHAR( script, ch, d );
+
+ int width;
+
+diff -ur qt-x11-free-3.2.3-fix/src-orig/kernel/qfontdata_p.h qt-x11-free-3.2.3-fix/src/kernel/qfontdata_p.h
+--- qt-x11-free-3.2.3-fix/src-orig/kernel/qfontdata_p.h Mon Nov 10 19:21:58 2003
++++ qt-x11-free-3.2.3-fix/src/kernel/qfontdata_p.h Fri Nov 28 20:44:37 2003
+@@ -125,6 +125,10 @@
+ enum { widthCacheSize = 0x500 };
+ uchar widthCache[widthCacheSize];
+ #endif
++#ifdef Q_WS_X11
++ uchar scripts_uniEngine[QFont::LastPrivateScript];
++ QFontEngine *uniEngine;
++#endif // Q_WS_X11
+ };
+
+
+@@ -154,6 +158,21 @@
+ return engineData->engine;
+ #endif // Q_WS_X11 || Q_WS_WIN
+ }
++
++ QFontEngine *m_engineForScript( QFont::Script script ) const {
++ if ( script == QFont::NoScript )
++ script = QFontPrivate::defaultScript;
++ QFontEngine *engine = engineForScript( script );
++#ifdef Q_WS_X11
++ if ( engineData->scripts_uniEngine[script] )
++ return engineData->uniEngine;
++#endif
++ return engine;
++ }
++
++#ifdef Q_WS_X11
++ QFont::Script checkSpecialScript( QFont::Script script, const QChar &ch );
++#endif // Q_WS_X11
+
+ QFontDef request;
+ QFontEngineData *engineData;
+diff -ur qt-x11-free-3.2.3-fix/src-orig/kernel/qfontdatabase_x11.cpp qt-x11-free-3.2.3-fix/src/kernel/qfontdatabase_x11.cpp
+--- qt-x11-free-3.2.3-fix/src-orig/kernel/qfontdatabase_x11.cpp Mon Nov 10 19:21:59 2003
++++ qt-x11-free-3.2.3-fix/src/kernel/qfontdatabase_x11.cpp Fri Nov 28 20:44:37 2003
+@@ -852,6 +852,7 @@
+ }
+ }
+ #endif // QT_XFT2
++ family->scripts[QFont::Unicode] = QtFontFamily::Supported;
+
+ QCString file = file_value;
+ family->fontFilename = file;
+diff -ur qt-x11-free-3.2.3-fix/src-orig/kernel/qtextengine.cpp qt-x11-free-3.2.3-fix/src/kernel/qtextengine.cpp
+--- qt-x11-free-3.2.3-fix/src-orig/kernel/qtextengine.cpp Mon Nov 10 19:22:03 2003
++++ qt-x11-free-3.2.3-fix/src/kernel/qtextengine.cpp Fri Nov 28 20:44:37 2003
+@@ -186,8 +186,7 @@
+ if ( control.singleLine ) {
+ for ( int i = start; i <= stop; i++ ) {
+
+- unsigned short uc = text[i].unicode();
+- QFont::Script s = (QFont::Script)scriptForChar( uc );
++ QFont::Script s = (QFont::Script)scriptForChar( text[i], engine->fnt );
+ if (s == QFont::UnknownScript)
+ s = script;
+
+@@ -203,19 +202,19 @@
+ for ( int i = start; i <= stop; i++ ) {
+
+ unsigned short uc = text[i].unicode();
+- QFont::Script s = (QFont::Script)scriptForChar( uc );
++ QFont::Script s = (QFont::Script)scriptForChar( text[i], engine->fnt );
+ if (s == QFont::UnknownScript)
+ s = script;
+
+ QChar::Category category = ::category( uc );
+ if ( uc == 0xfffcU || uc == 0x2028U ) {
+ item.analysis.bidiLevel = level % 2 ? level-1 : level;
+- item.analysis.script = QFont::Latin;
++ item.analysis.script = s;
+ item.isObject = TRUE;
+ s = QFont::NoScript;
+ } else if ((uc >= 9 && uc <=13) ||
+ (category >= QChar::Separator_Space && category <= QChar::Separator_Paragraph)) {
+- item.analysis.script = QFont::Latin;
++ item.analysis.script = s;
+ item.isSpace = TRUE;
+ item.isTab = ( uc == '\t' );
+ item.analysis.bidiLevel = item.isTab ? control.baseLevel() : level;
+diff -ur qt-x11-free-3.2.3-fix/src-orig/tools/qunicodetables_p.h qt-x11-free-3.2.3-fix/src/tools/qunicodetables_p.h
+--- qt-x11-free-3.2.3-fix/src-orig/tools/qunicodetables_p.h Mon Nov 10 19:21:38 2003
++++ qt-x11-free-3.2.3-fix/src/tools/qunicodetables_p.h Fri Nov 28 20:44:37 2003
+@@ -37,6 +37,7 @@
+ #define QUNICODETABLES_P_H
+
+ #include "qstring.h"
++#include "private/qfontdata_p.h"
+
+ #ifdef QT_NO_UNICODETABLES
+ # include <ctype.h>
+@@ -206,8 +207,9 @@
+ return QUnicodeTables::line_break_info[pos];
+ }
+
+-inline int scriptForChar( ushort uc )
++inline int scriptForChar( const QChar &ch, QFontPrivate *fnt = 0 )
+ {
++ unsigned short uc = ch.unicode();
+ unsigned char script = QUnicodeTables::scriptTable[(uc>>8)];
+ if ( script >= QUnicodeTables::SCRIPTS_INDIC ) {
+ if ( script == QUnicodeTables::SCRIPTS_INDIC ) {
+@@ -221,22 +223,18 @@
+ script = QUnicodeTables::otherScripts[index];
+ }
+ }
+- return script;
+-}
+
+ #ifdef Q_WS_X11
+-#define SCRIPT_FOR_CHAR( script, c ) \
+-do { \
+- unsigned short _uc = (c).unicode(); \
+- if ( _uc < 0x100 ) { \
+- script = QFont::Latin; \
+- } else { \
+- script = (QFont::Script)scriptForChar( _uc ); \
+- } \
+-} while( FALSE )
++ if ( fnt )
++ script = fnt->checkSpecialScript( (QFont::Script)script, ch );
+ #else
+-#define SCRIPT_FOR_CHAR( script, c ) \
+- script = (QFont::Script)scriptForChar( (c).unicode() )
+-#endif
++ Q_UNUSED( fnt );
++#endif // Q_WS_X11
++
++ return script;
++}
++
++#define SCRIPT_FOR_CHAR( script, c, fnt ) \
++ script = (QFont::Script)scriptForChar( c, fnt )
+
+ #endif
diff --git a/x11-libs/qt/qt-3.2.3.ebuild b/x11-libs/qt/qt-3.2.3.ebuild
index 690142d5fab6..ede6904608c7 100644
--- a/x11-libs/qt/qt-3.2.3.ebuild
+++ b/x11-libs/qt/qt-3.2.3.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/x11-libs/qt/qt-3.2.3.ebuild,v 1.3 2003/11/29 22:52:50 brad_mssw Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-libs/qt/qt-3.2.3.ebuild,v 1.4 2003/12/05 14:08:27 caleb Exp $
SRCTYPE="free"
DESCRIPTION="QT version ${PV}"
@@ -9,7 +9,7 @@ SRC_URI="ftp://ftp.trolltech.com/qt/source/qt-x11-${SRCTYPE}-${PV}.tar.bz2"
LICENSE="QPL-1.0 | GPL-2"
SLOT="3"
-KEYWORDS="~x86 hppa amd64"
+KEYWORDS="x86 hppa amd64"
IUSE="cups nas postgres opengl mysql odbc gif doc"
DEPEND="virtual/x11
@@ -38,6 +38,10 @@ src_unpack() {
export QTDIR=${S}
cd ${S}
+ use cjk && epatch ${FILESDIR}/${P}-qfontdatabase-i18n-20031024.patch
+ use cjk && epatch ${FILESDIR}/${P}-qpsprinter-useFreeType2-20031128.patch
+ use cjk && epatch ${FILESDIR}/${P}-scriptForChar-20031128.patch
+
cp configure configure.orig
sed -e 's:read acceptance:acceptance=yes:' configure.orig > configure