summaryrefslogtreecommitdiffstats
path: root/src/kernel/qpsprinter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/qpsprinter.cpp')
-rw-r--r--src/kernel/qpsprinter.cpp120
1 files changed, 60 insertions, 60 deletions
diff --git a/src/kernel/qpsprinter.cpp b/src/kernel/qpsprinter.cpp
index 039b587..6f00db3 100644
--- a/src/kernel/qpsprinter.cpp
+++ b/src/kernel/qpsprinter.cpp
@@ -1668,7 +1668,7 @@ unsigned short QPSPrinterFontPrivate::insertIntoSubset( unsigned short u )
pageSubsetCount++;
}
} else {
- qWarning("QPSPrinterFont::internal error");
+ tqWarning("QPSPrinterFont::internal error");
}
return retval;
}
@@ -1677,7 +1677,7 @@ void QPSPrinterFontPrivate::restore()
{
page_subset.clear();
pageSubsetCount = 0;
- //qDebug("restore for font %s\n",psname.latin1());
+ //tqDebug("restore for font %s\n",psname.latin1());
}
static inline const char *toHex( uchar u )
@@ -1814,7 +1814,7 @@ unsigned short QPSPrinterFontPrivate::mapUnicode( unsigned short unicode )
if ( !found ) {
return insertIntoSubset( unicode );
}
- //qDebug("mapping unicode %x to %x", unicode, offset+*res);
+ //tqDebug("mapping unicode %x to %x", unicode, offset+*res);
return offset + *res;
}
@@ -2289,7 +2289,7 @@ QPSPrinterFontTTF::QPSPrinterFontTTF(const QFontEngine *f, QByteArray& d)
else if (QString(environment_preference) == "3")
target_type = 3;
else
- qWarning("The value of QT_TTFTOPS must be 42 or 3");
+ tqWarning("The value of QT_TTFTOPS must be 42 or 3");
}
#endif
offset_table = (unsigned char*) data.data(); /* first 12 bytes */
@@ -2318,12 +2318,12 @@ QPSPrinterFontTTF::QPSPrinterFontTTF(const QFontEngine *f, QByteArray& d)
ury = topost( getFWord( ptr + 42 ) );
indexToLocFormat = getSHORT( ptr + 50 ); /* size of 'loca' data */
if(indexToLocFormat != 0 && indexToLocFormat != 1) {
- qWarning("TrueType font is unusable because indexToLocFormat != 0");
+ tqWarning("TrueType font is unusable because indexToLocFormat != 0");
defective = TRUE;
return;
}
if( getSHORT(ptr+52) != 0 ) {
- qWarning("TrueType font is unusable because glyphDataFormat != 0");
+ tqWarning("TrueType font is unusable because glyphDataFormat != 0");
defective = TRUE;
return;
}
@@ -2340,7 +2340,7 @@ QPSPrinterFontTTF::QPSPrinterFontTTF(const QFontEngine *f, QByteArray& d)
BYTE* table_ptr = getTable("name"); /* pointer to table */
if ( !table_ptr ) {
defective = TRUE;
- qDebug("couldn't find name table" );
+ tqDebug("couldn't find name table" );
return;
}
int numrecords = getUSHORT( table_ptr + 2 ); /* number of names */
@@ -2392,8 +2392,8 @@ QPSPrinterFontTTF::QPSPrinterFontTTF(const QFontEngine *f, QByteArray& d)
Fixed post_format = getFixed( post_table );
if( post_format.whole != 2 || post_format.fraction != 0 ) {
- qWarning("TrueType font does not have a format 2.0 'post' table");
- qWarning("post format is %d.%d",post_format.whole,post_format.fraction);
+ tqWarning("TrueType font does not have a format 2.0 'post' table");
+ tqWarning("post format is %d.%d",post_format.whole,post_format.fraction);
// Sivan Feb 2001: no longer defective.
// defective = TRUE;
}
@@ -2402,11 +2402,11 @@ QPSPrinterFontTTF::QPSPrinterFontTTF(const QFontEngine *f, QByteArray& d)
BYTE *maxp = getTable("maxp");
if ( !maxp ) {
defective = TRUE;
- qDebug("no maxp table in font");
+ tqDebug("no maxp table in font");
return;
}
numGlyphs = getUSHORT( maxp + 4 );
-// qDebug("number of glyphs is %d", numGlyphs);
+// tqDebug("number of glyphs is %d", numGlyphs);
replacementList = makePSFontNameList( f, psname );
uni2glyphSetup();
}
@@ -2505,8 +2505,8 @@ void QPSPrinterFontTTF::download(QTextStream& s,bool global)
return;
}
- //qDebug("downloading ttf font %s", psname.latin1() );
- //qDebug("target type=%d", target_type);
+ //tqDebug("downloading ttf font %s", psname.latin1() );
+ //tqDebug("target type=%d", target_type);
global_dict = global;
QMap<unsigned short, unsigned short> *subsetDict = &subset;
if ( !global )
@@ -2716,7 +2716,7 @@ void QPSPrinterFontTTF::download(QTextStream& s,bool global)
} else { /* type 3 */
if (!glyphset[x]) continue;
- //qDebug("emitting charproc for glyph %d, name=%s", x, glyphName(x).latin1() );
+ //tqDebug("emitting charproc for glyph %d, name=%s", x, glyphName(x).latin1() );
s << "/";
s << glyphName( x, glyphset );
s << "{";
@@ -2916,7 +2916,7 @@ void QPSPrinterFontTTF::uni2glyphSetup()
}
}
if (map==nmaps) {
- qWarning("Font does not have unicode encoding\n");
+ tqWarning("Font does not have unicode encoding\n");
return; // no unicode encoding!
}
@@ -2928,7 +2928,7 @@ void QPSPrinterFontTTF::uni2glyphSetup()
//fprintf(stderr,"Unicode cmap format %d\n",format);
if (format != 4) {
- //qWarning("Unicode cmap format is not 4");
+ //tqWarning("Unicode cmap format is not 4");
return;
}
@@ -3145,7 +3145,7 @@ void QPSPrinterFontTTF::sfnts_glyf_table(ULONG oldoffset,
** two byte boundary.
*/
if( length % 2 ) {
- qWarning("TrueType font contains a 'glyf' table without 2 byte padding");
+ tqWarning("TrueType font contains a 'glyf' table without 2 byte padding");
defective = TRUE;
return;
}
@@ -3168,7 +3168,7 @@ void QPSPrinterFontTTF::sfnts_glyf_table(ULONG oldoffset,
/* Look for unexplainable descrepancies between sizes */
if( total != correct_total_length ) {
- qWarning("QPSPrinterFontTTF::sfnts_glyf_table: total != correct_total_length");
+ tqWarning("QPSPrinterFontTTF::sfnts_glyf_table: total != correct_total_length");
defective = TRUE;
return;
}
@@ -3260,7 +3260,7 @@ void QPSPrinterFontTTF::download_sfnts(QTextStream& s)
sfnts_pputUSHORT(81,s, string_len, line_len, in_string); /* rangeShift */
}
else {
- qWarning("Fewer than 9 tables selected");
+ tqWarning("Fewer than 9 tables selected");
}
/* Now, emmit the table directory. */
@@ -3297,7 +3297,7 @@ void QPSPrinterFontTTF::download_sfnts(QTextStream& s)
string_len, line_len, in_string);
} else { // other tables should not exceed 64K (not always true; Sivan)
if( tables[x].length > 65535 ) {
- qWarning("TrueType font has a table which is too long");
+ tqWarning("TrueType font has a table which is too long");
defective = TRUE;
return;
}
@@ -3699,7 +3699,7 @@ void QPSPrinterFontTTF::charprocLoad(BYTE *glyph, charproc_data* cd)
ct = *(glyph++);
if( (x + ct) > cd->num_pts ) {
- qWarning("Fatal Error in TT flags");
+ tqWarning("Fatal Error in TT flags");
return;
}
@@ -4053,7 +4053,7 @@ QPSPrinterFontPFA::QPSPrinterFontPFA(const QFontEngine *f, QByteArray& d)
QString fontname;
if (p[ pos ] != '%' || p[ pos+1 ] != '!') { // PFA marker
- qWarning("invalid pfa file");
+ tqWarning("invalid pfa file");
return;
}
@@ -4079,7 +4079,7 @@ void QPSPrinterFontPFA::download(QTextStream& s, bool global)
return;
}
- //qDebug("downloading pfa font %s", psname.latin1() );
+ //tqDebug("downloading pfa font %s", psname.latin1() );
char* p = data.data();
s << "% Font resource\n";
@@ -4111,7 +4111,7 @@ QPSPrinterFontPFB::QPSPrinterFontPFB(const QFontEngine *f, QByteArray& d)
QString fontname;
if (p[ pos ] != 0x80) { // PFB marker
- qWarning("pfb file does not start with 0x80");
+ tqWarning("pfb file does not start with 0x80");
return;
}
pos++;
@@ -4146,7 +4146,7 @@ void QPSPrinterFontPFB::download(QTextStream& s, bool global)
return;
}
- //qDebug("downloading pfb font %s", psname.latin1() );
+ //tqDebug("downloading pfb font %s", psname.latin1() );
unsigned char* p = (unsigned char*) data.data();
int pos;
int len;
@@ -4173,7 +4173,7 @@ void QPSPrinterFontPFB::download(QTextStream& s, bool global)
len |= (p[ pos ] << 16); pos++;
len |= (p[ pos ] << 24); pos++;
- //qDebug("font block type %d len %d",typ,len);
+ //tqDebug("font block type %d len %d",typ,len);
int end = pos + len;
if (typ==1) {
@@ -4182,7 +4182,7 @@ void QPSPrinterFontPFB::download(QTextStream& s, bool global)
s << "\n";
hexcol = 0;
}
- //qWarning(QString::fromLatin1((char*)(p+pos),1));
+ //tqWarning(QString::fromLatin1((char*)(p+pos),1));
if (p[pos] == '\r' || p[pos] == '\n') {
s << "\n";
while (pos < end && (p[pos] == '\r' || p[pos] == '\n'))
@@ -4233,7 +4233,7 @@ QPSPrinterFontNotFound::QPSPrinterFontNotFound(const QFontEngine* f)
void QPSPrinterFontNotFound::download(QTextStream& s, bool)
{
- //qDebug("downloading not found font %s", psname.latin1() );
+ //tqDebug("downloading not found font %s", psname.latin1() );
emitPSFontNameList( s, psname, replacementList );
s << "% No embeddable font for ";
s << psname;
@@ -4350,7 +4350,7 @@ QString QPSPrinterFontAsian::defineFont( QTextStream &stream, const QString &ps,
void QPSPrinterFontAsian::download(QTextStream& s, bool)
{
- //qDebug("downloading asian font %s", psname.latin1() );
+ //tqDebug("downloading asian font %s", psname.latin1() );
s << "% Asian postscript font requested. Using "
<< psname << endl;
emitPSFontNameList( s, psname, replacementList );
@@ -4871,7 +4871,7 @@ QPSPrinterFontSimplifiedChinese::QPSPrinterFontSimplifiedChinese(const QFontEngi
psname = SongGBK2K[type].psname;
appendReplacements( replacementList, SimplifiedReplacements, type );
}
- //qDebug("simplified chinese: fontname is %s, psname=%s", f.family().latin1(), psname.latin1() );
+ //tqDebug("simplified chinese: fontname is %s, psname=%s", f.family().latin1(), psname.latin1() );
}
QString QPSPrinterFontSimplifiedChinese::extension() const
@@ -4921,14 +4921,14 @@ QPSPrinterFont::QPSPrinterFont(const QFont &f, int script, QPSPrinterPrivate *pr
#if defined( Q_WS_X11 )
bool xlfd = FALSE;
- //qDebug("engine = %p name=%s, script=%d", engine, engine ? engine->name() : "(null)", script);
+ //tqDebug("engine = %p name=%s, script=%d", engine, engine ? engine->name() : "(null)", script);
#ifndef QT_NO_XFTFREETYPE
if ( qt_has_xft && engine && engine->type() == QFontEngine::Xft ) {
XftPattern *pattern = static_cast<QFontEngineXft *>( engine )->pattern();
char *filename = 0;
XftPatternGetString (pattern, XFT_FILE, 0, &filename);
- //qDebug("filename for font is '%s'", filename);
+ //tqDebug("filename for font is '%s'", filename);
if ( filename ) {
fontfilename = QString::fromLocal8Bit( filename );
xfontname = fontfilename;
@@ -4996,7 +4996,7 @@ QPSPrinterFont::QPSPrinterFont(const QFont &f, int script, QPSPrinterPrivate *pr
xfontname += "/" + toString( script );
#endif
- //qDebug("looking for font %s in dict", xfontname.latin1() );
+ //tqDebug("looking for font %s in dict", xfontname.latin1() );
p = priv->fonts.find(xfontname);
if ( p )
return;
@@ -5014,15 +5014,15 @@ QPSPrinterFont::QPSPrinterFont(const QFont &f, int script, QPSPrinterPrivate *pr
fontmapname = (*it) + "/fonts.scale";
else
fontmapname = (*it) + "/fonts.dir";
- //qWarning(fontmapname);
+ //tqWarning(fontmapname);
QFile fontmap(fontmapname);
if (fontmap.open(IO_ReadOnly)) {
while (!fontmap.atEnd()) {
QString mapping;
fontmap.readLine(mapping,512);
// fold to lower (since X folds to lowercase)
- //qWarning(xfontname);
- //qWarning(mapping);
+ //tqWarning(xfontname);
+ //tqWarning(mapping);
if (mapping.lower().contains(searchname.lower())) {
int index = mapping.find(' ',0);
QString ffn = mapping.mid(0,index);
@@ -5031,7 +5031,7 @@ QPSPrinterFont::QPSPrinterFont(const QFont &f, int script, QPSPrinterPrivate *pr
!ffn.contains( ".spd" ) && !ffn.contains( ".phont" ) ) {
fontfilename = (*it) + QString("/") + ffn;
if ( QFile::exists(fontfilename) ) {
- //qDebug("found font file %s", fontfilename.latin1());
+ //tqDebug("found font file %s", fontfilename.latin1());
break;
} else // unset fontfilename
fontfilename = QString();
@@ -5046,7 +5046,7 @@ QPSPrinterFont::QPSPrinterFont(const QFont &f, int script, QPSPrinterPrivate *pr
}
#endif
- //qDebug("font=%s, fontname=%s, file=%s, p=%p", f.family().latin1(), xfontname.latin1(), fontfilename.latin1(), p);
+ //tqDebug("font=%s, fontname=%s, file=%s, p=%p", f.family().latin1(), xfontname.latin1(), fontfilename.latin1(), p);
// memory mapping would be better here
if (fontfilename.length() > 0) { // maybe there is no file name
@@ -5074,7 +5074,7 @@ QPSPrinterFont::QPSPrinterFont(const QFont &f, int script, QPSPrinterPrivate *pr
} else
type = NONE;
- //qDebug("font is of type %d", type );
+ //tqDebug("font is of type %d", type );
switch (type) {
case TTF :
p = new QPSPrinterFontTTF(engine, data);
@@ -5116,7 +5116,7 @@ QPSPrinterFont::QPSPrinterFont(const QFont &f, int script, QPSPrinterPrivate *pr
}
} else
#endif
- //qDebug("didnt find font for %s", xfontname.latin1());
+ //tqDebug("didnt find font for %s", xfontname.latin1());
p = new QPSPrinterFontNotFound( engine );
break;
}
@@ -5128,14 +5128,14 @@ QPSPrinterFont::QPSPrinterFont(const QFont &f, int script, QPSPrinterPrivate *pr
QDictIterator<QPSPrinterFontPrivate> it( priv->fonts );
for( it.toFirst(); it.current(); ++it ) {
if ( *(*it) == *p ) {
-// qWarning("Post script driver: font already in dict");
+// tqWarning("Post script driver: font already in dict");
delete p;
p = *it;
return;
}
}
- //qDebug("inserting font %s in dict psname=%s", xfontname.latin1(), p->postScriptFontName().latin1() );
+ //tqDebug("inserting font %s in dict psname=%s", xfontname.latin1(), p->postScriptFontName().latin1() );
priv->fonts.insert( xfontname, p );
}
@@ -5235,7 +5235,7 @@ void QPSPrinterPrivate::setFont( const QFont & fnt, int script )
}
if ( f.pointSize() == 0 ) {
#if defined(CHECK_RANGE)
- qWarning( "QPrinter: Cannot set a font with zero point size." );
+ tqWarning( "QPrinter: Cannot set a font with zero point size." );
#endif
f.setPointSize(QApplication::font().pointSize());
if ( f.pointSize() == 0 )
@@ -5529,7 +5529,7 @@ static QByteArray compress( const QImage & image, bool gray ) {
#if 0
/* this should never happen: both the start and
the end pointers ran off their tracks. */
- qDebug( "oops! %06x %06x %06x %06x %5d %5d %5d %d",
+ tqDebug( "oops! %06x %06x %06x %06x %5d %5d %5d %d",
pixel[start], pixel[end],
pixel[index], pixel[index+bestLength],
start, end, index, bestLength );
@@ -5716,20 +5716,20 @@ static QByteArray compress( const QImage & image, bool gray ) {
delete [] pixel;
#ifdef DEBUG_COMPRESS
- qDebug( "------------- image compression statistics ----------------" );
- qDebug(" compression time %d", t.elapsed() );
- qDebug( "Size dist of uncompressed blocks:" );
- qDebug( "\t%d\t%d\t%d\t%d\t%d\t%d\n", sizeUncompressed[0], sizeUncompressed[1],
+ tqDebug( "------------- image compression statistics ----------------" );
+ tqDebug(" compression time %d", t.elapsed() );
+ tqDebug( "Size dist of uncompressed blocks:" );
+ tqDebug( "\t%d\t%d\t%d\t%d\t%d\t%d\n", sizeUncompressed[0], sizeUncompressed[1],
sizeUncompressed[2], sizeUncompressed[3], sizeUncompressed[4], sizeUncompressed[5]);
- qDebug( "\t%d\t%d\t%d\t%d\t%d\n", sizeUncompressed[6], sizeUncompressed[7],
+ tqDebug( "\t%d\t%d\t%d\t%d\t%d\n", sizeUncompressed[6], sizeUncompressed[7],
sizeUncompressed[8], sizeUncompressed[9], sizeUncompressed[10] );
- qDebug( "Size dist of compressed blocks:" );
- qDebug( "\t%d\t%d\t%d\t%d\t%d\t%d\n", sizeCompressed[0], sizeCompressed[1],
+ tqDebug( "Size dist of compressed blocks:" );
+ tqDebug( "\t%d\t%d\t%d\t%d\t%d\t%d\n", sizeCompressed[0], sizeCompressed[1],
sizeCompressed[2], sizeCompressed[3], sizeCompressed[4], sizeCompressed[5]);
- qDebug( "\t%d\t%d\t%d\t%d\t%d\n", sizeCompressed[6], sizeCompressed[7],
+ tqDebug( "\t%d\t%d\t%d\t%d\t%d\n", sizeCompressed[6], sizeCompressed[7],
sizeCompressed[8], sizeCompressed[9], sizeCompressed[10] );
- qDebug( "===> total compression ratio %d/%d = %f", outOffset, size, (float)outOffset/(float)size );
- qDebug( "-----------------------------------------------------------" );
+ tqDebug( "===> total compression ratio %d/%d = %f", outOffset, size, (float)outOffset/(float)size );
+ tqDebug( "-----------------------------------------------------------" );
#endif
return outarr;
@@ -6061,7 +6061,7 @@ void QPSPrinterPrivate::resetDrawingTools( QPainter *paint )
if ( b != defaultBrush ) {
if ( b == Qt::CustomPattern ) {
#if defined(CHECK_RANGE)
- qWarning( "QPrinter: Pixmap brush not supported" );
+ tqWarning( "QPrinter: Pixmap brush not supported" );
#endif
} else {
cbrush = b;
@@ -6171,7 +6171,7 @@ void QPSPrinterPrivate::flushPage( bool last )
(last || buffer->size() > 50000000)
#endif
) {
-// qDebug("emiting header at page %d", pageCount );
+// tqDebug("emiting header at page %d", pageCount );
emitHeader( last );
}
outStream << "%%Page: "
@@ -6180,7 +6180,7 @@ void QPSPrinterPrivate::flushPage( bool last )
<< "QI\n";
if (!dirtyNewPage) {
if ( pageFonts ) {
- //qDebug("page fonts for page %d", pageCount);
+ //tqDebug("page fonts for page %d", pageCount);
// we have already downloaded the header. Maybe we have page fonts here
QDictIterator<QPSPrinterFontPrivate> it(fonts);
while (it.current()) {
@@ -6243,7 +6243,7 @@ static void ignoreSigPipe(bool b)
return; // not ignoring sigpipe
if (sigaction(SIGPIPE, users_sigpipe_handler, 0) == -1)
- qWarning("QPSPrinter: could not restore SIGPIPE handler");
+ tqWarning("QPSPrinter: could not restore SIGPIPE handler");
delete users_sigpipe_handler;
users_sigpipe_handler = 0;
@@ -6513,7 +6513,7 @@ bool QPSPrinter::cmd( int c , QPainter *paint, QPDevCmdParam *p )
case PdcSetROP:
#if defined(CHECK_RANGE)
if ( p[0].ival != Qt::CopyROP )
- qWarning( "QPrinter: Raster operation setting not supported" );
+ tqWarning( "QPrinter: Raster operation setting not supported" );
#endif
break;
case PdcSetBrushOrigin:
@@ -6534,7 +6534,7 @@ bool QPSPrinter::cmd( int c , QPainter *paint, QPDevCmdParam *p )
case PdcSetBrush:
if ( p[0].brush->style() == Qt::CustomPattern ) {
#if defined(CHECK_RANGE)
- qWarning( "QPrinter: Pixmap brush not supported" );
+ tqWarning( "QPrinter: Pixmap brush not supported" );
#endif
return FALSE;
}