[sisyphus] qt patch
Aleksey Novodvorsky
=?iso-8859-1?q?aen_=CE=C1_logic=2Eru?=
Вт Авг 21 19:06:09 MSD 2001
Hi!
Для любителей qt/kde прилагается патч к qt-2.3.1, исправляющий досадную
багу с печатью tff-шрифтами. Новый qt завтра будет в Sisyphus
Rgrds, AEN
----------- следующая часть -----------
diff -ur qt-2.3.1.orig/src/kernel/qpsprinter.cpp qt-2.3.1/src/kernel/qpsprinter.cpp
--- qt-2.3.1.orig/src/kernel/qpsprinter.cpp Tue Aug 21 15:26:02 2001
+++ qt-2.3.1/src/kernel/qpsprinter.cpp Tue Aug 21 17:13:42 2001
@@ -2610,6 +2610,13 @@
Q_UINT16 fraction;
} Fixed; // 16.16 bit fixed-point number
+static float f2dot14( ushort s )
+{
+ float f = ((float)( s & 0x3fff ))/ 16384.;
+ f += (s & 0x8000) ? ( (s & 0x4000) ? -1 : -2 ) : ( (s & 0x4000) ? 1 : 0 );
+ return f;
+}
+
static ULONG getULONG(BYTE *p)
{
int x;
@@ -4127,8 +4134,8 @@
USHORT glyphIndex;
int arg1;
int arg2;
- USHORT xscale;
- USHORT yscale;
+ float xscale = 1 ;
+ float yscale = 1 ;
USHORT scale01;
USHORT scale10;
@@ -4153,23 +4160,23 @@
}
if(flags & WE_HAVE_A_SCALE) {
- xscale = yscale = getUSHORT(glyph);
+ xscale = yscale = f2dot14 (getUSHORT(glyph));
glyph += 2;
scale01 = scale10 = 0;
} else if(flags & WE_HAVE_AN_X_AND_Y_SCALE) {
- xscale = getUSHORT(glyph);
+ xscale = f2dot14 (getUSHORT(glyph));
glyph += 2;
- yscale = getUSHORT(glyph);
+ yscale = f2dot14 (getUSHORT(glyph));
glyph += 2;
scale01 = scale10 = 0;
} else if(flags & WE_HAVE_A_TWO_BY_TWO) {
- xscale = getUSHORT(glyph);
+ xscale = f2dot14 (getUSHORT(glyph));
glyph += 2;
scale01 = getUSHORT(glyph);
glyph += 2;
scale10 = getUSHORT(glyph);
glyph += 2;
- yscale = getUSHORT(glyph);
+ yscale = f2dot14 (getUSHORT(glyph));
glyph += 2;
} else {
xscale = yscale = scale01 = scale10 = 0;
@@ -4189,8 +4196,14 @@
s << topost(arg1);
s << " ";
s << topost(arg2);
- s << " translate\n";
-
+ s << " translate ";
+ if ( xscale || yscale ){
+ s << xscale ;
+ s << " " ;
+ s << yscale ;
+ s << " scale" ;
+ }
+ s << "\n";
//fprintf(stderr,"gsave %d %d translate\n", topost(arg1), topost(arg2) );
}
} else {
Подробная информация о списке рассылки Sisyphus