summaryrefslogtreecommitdiffstats
path: root/src/kernel/qfontengine_x11.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-02-28 22:31:39 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-02-28 22:31:39 -0600
commit41bb408dde90e755b07cd2ab8a9bdec7548c84b0 (patch)
tree6d4d5407c000add30aa78630e009c0e5d633e440 /src/kernel/qfontengine_x11.cpp
parent1740cd279522c060e738bbbffacab83355d2b794 (diff)
downloadtqt3-41bb408dde90e755b07cd2ab8a9bdec7548c84b0.tar.gz
tqt3-41bb408dde90e755b07cd2ab8a9bdec7548c84b0.zip
Automated conversion from qt3
Diffstat (limited to 'src/kernel/qfontengine_x11.cpp')
-rw-r--r--src/kernel/qfontengine_x11.cpp102
1 files changed, 51 insertions, 51 deletions
diff --git a/src/kernel/qfontengine_x11.cpp b/src/kernel/qfontengine_x11.cpp
index 3802a13c1..d9d2f1640 100644
--- a/src/kernel/qfontengine_x11.cpp
+++ b/src/kernel/qfontengine_x11.cpp
@@ -139,7 +139,7 @@ static TQBitmap transform(Display *dpy, const TQBitmap &source, int xoff, int y
bm = TQBitmap( w, h, dptr, TQImage::systemBitOrder() != TQImage::BigEndian );
} else {
#if defined(QT_CHECK_RANGE)
- qWarning( "TQFontEngineXft::tranform: xform failed");
+ tqWarning( "TQFontEngineXft::tranform: xform failed");
#endif
}
@@ -266,7 +266,7 @@ void TQFontEngineBox::draw( TQPainter *p, int x, int y, const TQTextEngine *engi
glyph_metrics_t ci = boundingBox( glyphs, offsets, numGlyphs );
p->drawRect( x + ci.x, y + ci.y, ci.width, ci.height );
p->drawRect( x + ci.x, y + 50 + ci.y, ci.width, ci.height );
- qDebug("bounding rect=%d %d (%d/%d)", ci.x, ci.y, ci.width, ci.height );
+ tqDebug("bounding rect=%d %d (%d/%d)", ci.x, ci.y, ci.width, ci.height );
p->restore();
int xp = x;
int yp = y;
@@ -323,7 +323,7 @@ void TQFontEngineBox::draw( TQPainter *p, int x, int y, const TQTextEngine *engi
x += offsets[i].x;
y += offsets[i].y;
p->drawRect( x + ci.x, y + 50 + ci.y, ci.width, ci.height );
- qDebug("bounding ci[%d]=%d %d (%d/%d) / %d %d offset=(%d/%d)", i, ci.x, ci.y, ci.width, ci.height,
+ tqDebug("bounding ci[%d]=%d %d (%d/%d) / %d %d offset=(%d/%d)", i, ci.x, ci.y, ci.width, ci.height,
ci.xoff, ci.yoff, offsets[i].x, offsets[i].y );
x += ci.xoff;
y += ci.yoff;
@@ -558,7 +558,7 @@ void TQFontEngineXLFD::draw( TQPainter *p, int x, int y, const TQTextEngine *eng
if ( !si->num_glyphs )
return;
-// qDebug("TQFontEngineXLFD::draw( %d, %d, numglyphs=%d", x, y, si->num_glyphs );
+// tqDebug("TQFontEngineXLFD::draw( %d, %d, numglyphs=%d", x, y, si->num_glyphs );
Display *dpy = TQPaintDevice::x11AppDisplay();
TQt::HANDLE hd = p->device()->handle();
@@ -633,7 +633,7 @@ void TQFontEngineXLFD::draw( TQPainter *p, int x, int y, const TQTextEngine *eng
matrix += ' ';
}
matrix += ']';
- //qDebug("m: %2.2f %2.2f %2.2f %2.2f, matrix=%s", p->m11(), p->m12(), p->m21(), p->m22(), matrix.data());
+ //tqDebug("m: %2.2f %2.2f %2.2f %2.2f, matrix=%s", p->m11(), p->m12(), p->m21(), p->m22(), matrix.data());
xlfd_transformed.replace( pos, endPos-pos, matrix );
x_font_load_error = FALSE;
@@ -642,7 +642,7 @@ void TQFontEngineXLFD::draw( TQPainter *p, int x, int y, const TQTextEngine *eng
XSync( dpy, FALSE );
XSetErrorHandler( old_handler );
if ( x_font_load_error ) {
- //qDebug( "couldn't load transformed font" );
+ //tqDebug( "couldn't load transformed font" );
font_id = _fs->fid;
xlfd_transformations = XlfdTrUnsupported;
} else {
@@ -678,7 +678,7 @@ void TQFontEngineXLFD::draw( TQPainter *p, int x, int y, const TQTextEngine *eng
glyph_metrics_t ci = boundingBox( glyphs, advances, offsets, si->num_glyphs );
p->drawRect( x + ci.x, y + ci.y, ci.width, ci.height );
p->drawRect( x + ci.x, y + 100 + ci.y, ci.width, ci.height );
- qDebug("bounding rect=%d %d (%d/%d)", ci.x, ci.y, ci.width, ci.height );
+ tqDebug("bounding rect=%d %d (%d/%d)", ci.x, ci.y, ci.width, ci.height );
p->restore();
int xp = x;
int yp = y;
@@ -705,7 +705,7 @@ void TQFontEngineXLFD::draw( TQPainter *p, int x, int y, const TQTextEngine *eng
int i = si->num_glyphs;
while( i-- ) {
advance_t adv = advances[i];
- // qDebug("advance = %d/%d", adv.x, adv.y );
+ // tqDebug("advance = %d/%d", adv.x, adv.y );
x += adv;
glyph_metrics_t gi = boundingBox( glyphs[i] );
int xp = x-offsets[i].x-gi.xoff;
@@ -726,7 +726,7 @@ void TQFontEngineXLFD::draw( TQPainter *p, int x, int y, const TQTextEngine *eng
if (!glyphAttributes[i].zeroWidth && xp < SHRT_MAX && xp > SHRT_MIN)
XDrawString16(dpy, hd, gc, xp, yp, chars+i, 1 );
advance_t adv = advances[i];
- // qDebug("advance = %d/%d", adv.x, adv.y );
+ // tqDebug("advance = %d/%d", adv.x, adv.y );
x += adv;
i++;
}
@@ -760,7 +760,7 @@ void TQFontEngineXLFD::draw( TQPainter *p, int x, int y, const TQTextEngine *eng
for ( int i = 0; i < si->num_glyphs; i++ ) {
glyph_metrics_t ci = boundingBox( glyphs[i] );
p->drawRect( x + ci.x + offsets[i].x, y + 100 + ci.y + offsets[i].y, ci.width, ci.height );
- qDebug("bounding ci[%d]=%d %d (%d/%d) / %d %d offs=(%d/%d) advance=(%d/%d)", i, ci.x, ci.y, ci.width, ci.height,
+ tqDebug("bounding ci[%d]=%d %d (%d/%d) / %d %d offs=(%d/%d) advance=(%d/%d)", i, ci.x, ci.y, ci.width, ci.height,
ci.xoff, ci.yoff, offsets[i].x, offsets[i].y,
advances[i].x, advances[i].y);
x += advances[i].x;
@@ -1505,10 +1505,10 @@ TQFontEngineXft::TQFontEngineXft( XftFont *font, XftPattern *pattern, int cmap )
// Xft maps Unicode and adobe roman for us.
for (int i = 0; i < _face->num_charmaps; ++i) {
FT_CharMap cm = _face->charmaps[i];
-// qDebug("font has charmap %x", cm->encoding);
+// tqDebug("font has charmap %x", cm->encoding);
if (cm->encoding == ft_encoding_adobe_custom
|| cm->encoding == ft_encoding_symbol) {
-// qDebug("font has adobe custom or ms symbol charmap");
+// tqDebug("font has adobe custom or ms symbol charmap");
_cmap = i;
break;
}
@@ -1855,13 +1855,13 @@ void TQFontEngineXft::draw( TQPainter *p, int x, int y, const TQTextEngine *engi
col.color.alpha = 0xffff;
col.pixel = pen.pixel();
#ifdef FONTENGINE_DEBUG
- qDebug("===== drawing %d glyphs reverse=%s ======", si->num_glyphs, si->analysis.bidiLevel % 2?"TRUE":"FALSE" );
+ tqDebug("===== drawing %d glyphs reverse=%s ======", si->num_glyphs, si->analysis.bidiLevel % 2?"TRUE":"FALSE" );
p->save();
p->setBrush( TQt::white );
glyph_metrics_t ci = boundingBox( glyphs, advances, offsets, si->num_glyphs );
p->drawRect( x + ci.x, y + ci.y, ci.width, ci.height );
p->drawRect( x + ci.x, y + 100 + ci.y, ci.width, ci.height );
- qDebug("bounding rect=%d %d (%d/%d)", ci.x, ci.y, ci.width, ci.height );
+ tqDebug("bounding rect=%d %d (%d/%d)", ci.x, ci.y, ci.width, ci.height );
p->restore();
int yp = y;
int xp = x;
@@ -1895,7 +1895,7 @@ void TQFontEngineXft::draw( TQPainter *p, int x, int y, const TQTextEngine *engi
p->drawRect( x+offsets[i].x+gi.x, y+offsets[i].y+100+gi.y, gi.width, gi.height );
p->drawLine( x+offsets[i].x, y + 150 + 5*i , x+offsets[i].x+advances[i], y + 150 + 5*i );
p->drawLine( x+offsets[i].x, y + 152 + 5*i , x+offsets[i].x+gi.xoff, y + 152 + 5*i );
- qDebug("bounding ci[%d]=%d %d (%d/%d) / %d %d offs=(%d/%d) advance=%d", i, gi.x, gi.y, gi.width, gi.height,
+ tqDebug("bounding ci[%d]=%d %d (%d/%d) / %d %d offs=(%d/%d) advance=%d", i, gi.x, gi.y, gi.width, gi.height,
gi.xoff, gi.yoff, offsets[i].x, offsets[i].y, advances[i]);
#endif
x += advances[i];
@@ -1915,7 +1915,7 @@ void TQFontEngineXft::draw( TQPainter *p, int x, int y, const TQTextEngine *engi
if (!glyphAttributes[i].zeroWidth && xp < SHRT_MAX && xp > SHRT_MIN)
XftDrawString16( draw, &col, fnt, xp, yp, (XftChar16 *) (glyphs+i), 1 );
#endif // QT_XFT2
- // qDebug("advance = %d/%d", adv.x, adv.y );
+ // tqDebug("advance = %d/%d", adv.x, adv.y );
x += advances[i];
i++;
}
@@ -1980,7 +1980,7 @@ void TQFontEngineXft::draw( TQPainter *p, int x, int y, const TQTextEngine *engi
for ( int i = 0; i < si->num_glyphs; i++ ) {
glyph_metrics_t ci = boundingBox( glyphs[i] );
p->drawRect( x + ci.x + offsets[i].x, y + 100 + ci.y + offsets[i].y, ci.width, ci.height );
- qDebug("bounding ci[%d]=%d %d (%d/%d) / %d %d offs=(%d/%d) advance=%d", i, ci.x, ci.y, ci.width, ci.height,
+ tqDebug("bounding ci[%d]=%d %d (%d/%d) / %d %d offs=(%d/%d) advance=%d", i, ci.x, ci.y, ci.width, ci.height,
ci.xoff, ci.yoff, offsets[i].x, offsets[i].y, advances[i]);
x += advances[i];
}
@@ -2208,7 +2208,7 @@ bool TQFontEngineXft::canRender( const TQChar *string, int len )
TQOpenType *TQFontEngineXft::openType() const
{
-// qDebug("openTypeIface requested!");
+// tqDebug("openTypeIface requested!");
if ( _openType )
return _openType;
@@ -2390,7 +2390,7 @@ TQOpenType::TQOpenType(TQFontEngineXft *fe)
FT_Error error;
if ((error = TT_Load_GDEF_Table(face, &gdef))) {
#ifdef OT_DEBUG
- qDebug("error loading gdef table: %d", error);
+ tqDebug("error loading gdef table: %d", error);
#endif
gdef = 0;
}
@@ -2399,9 +2399,9 @@ TQOpenType::TQOpenType(TQFontEngineXft *fe)
gsub = 0;
#ifdef OT_DEBUG
if (error != FT_Err_Table_Missing) {
- qDebug("error loading gsub table: %d", error);
+ tqDebug("error loading gsub table: %d", error);
} else {
- qDebug("face doesn't have a gsub table");
+ tqDebug("face doesn't have a gsub table");
}
#endif
}
@@ -2409,7 +2409,7 @@ TQOpenType::TQOpenType(TQFontEngineXft *fe)
if ((error = TT_Load_GPOS_Table(face, &gpos, gdef))) {
gpos = 0;
#ifdef OT_DEBUG
- qDebug("error loading gpos table: %d", error);
+ tqDebug("error loading gpos table: %d", error);
#endif
}
@@ -2448,7 +2448,7 @@ bool TQOpenType::checkScript(unsigned int script)
FT_Error error = TT_GSUB_Select_Script(gsub, tag, &script_index);
if (error) {
#ifdef OT_DEBUG
- qDebug("could not select script %d in GSub table: %d", (int)script, error);
+ tqDebug("could not select script %d in GSub table: %d", (int)script, error);
#endif
return FALSE;
}
@@ -2462,7 +2462,7 @@ bool TQOpenType::checkScript(unsigned int script)
FT_Error error = TT_GPOS_Select_Script(gpos, script, &script_index);
if (error) {
#ifdef OT_DEBUG
- qDebug("could not select script in gpos table: %d", error);
+ tqDebug("could not select script in gpos table: %d", error);
#endif
return FALSE;
}
@@ -2486,10 +2486,10 @@ void TQOpenType::selectScript(unsigned int script, const Features *features)
{
TTO_FeatureList featurelist = gsub->FeatureList;
int numfeatures = featurelist.FeatureCount;
- qDebug("gsub table has %d features", numfeatures);
+ tqDebug("gsub table has %d features", numfeatures);
for(int i = 0; i < numfeatures; i++) {
TTO_FeatureRecord *r = featurelist.FeatureRecord + i;
- qDebug(" feature '%s'", tag_to_string(r->FeatureTag));
+ tqDebug(" feature '%s'", tag_to_string(r->FeatureTag));
}
}
#endif
@@ -2498,14 +2498,14 @@ void TQOpenType::selectScript(unsigned int script, const Features *features)
FT_Error error = TT_GSUB_Select_Script(gsub, tag, &script_index);
if (!error) {
#ifdef OT_DEBUG
- qDebug("script %s has script index %d", tag_to_string(script), script_index);
+ tqDebug("script %s has script index %d", tag_to_string(script), script_index);
#endif
while (features->tag) {
FT_UShort feature_index;
error = TT_GSUB_Select_Feature(gsub, features->tag, script_index, 0xffff, &feature_index);
if (!error) {
#ifdef OT_DEBUG
- qDebug(" adding feature %s", tag_to_string(features->tag));
+ tqDebug(" adding feature %s", tag_to_string(features->tag));
#endif
TT_GSUB_Add_Feature(gsub, feature_index, features->property);
}
@@ -2523,12 +2523,12 @@ void TQOpenType::selectScript(unsigned int script, const Features *features)
{
TTO_FeatureList featurelist = gpos->FeatureList;
int numfeatures = featurelist.FeatureCount;
- qDebug("gpos table has %d features", numfeatures);
+ tqDebug("gpos table has %d features", numfeatures);
for(int i = 0; i < numfeatures; i++) {
TTO_FeatureRecord *r = featurelist.FeatureRecord + i;
FT_UShort feature_index;
TT_GPOS_Select_Feature(gpos, r->FeatureTag, script_index, 0xffff, &feature_index);
- qDebug(" feature '%s'", tag_to_string(r->FeatureTag));
+ tqDebug(" feature '%s'", tag_to_string(r->FeatureTag));
}
}
#endif
@@ -2553,7 +2553,7 @@ void TQOpenType::selectScript(unsigned int script, const Features *features)
static void dump_string(OTL_Buffer buffer)
{
for (uint i = 0; i < buffer->in_length; ++i) {
- qDebug(" %x: cluster=%d", buffer->in_string[i].gindex, buffer->in_string[i].cluster);
+ tqDebug(" %x: cluster=%d", buffer->in_string[i].gindex, buffer->in_string[i].cluster);
}
}
#endif
@@ -2575,13 +2575,13 @@ bool TQOpenType::shape(TQShaperItem *item, const unsigned int *properties)
}
#ifdef OT_DEBUG
- qDebug("-----------------------------------------");
-// qDebug("log clusters before shaping:");
+ tqDebug("-----------------------------------------");
+// tqDebug("log clusters before shaping:");
// for (int j = 0; j < length; j++)
-// qDebug(" log[%d] = %d", j, item->log_clusters[j]);
- qDebug("original glyphs: %p", item->glyphs);
+// tqDebug(" log[%d] = %d", j, item->log_clusters[j]);
+ tqDebug("original glyphs: %p", item->glyphs);
for (int i = 0; i < length; ++i)
- qDebug(" glyph=%4x", otl_buffer->in_string[i].gindex);
+ tqDebug(" glyph=%4x", otl_buffer->in_string[i].gindex);
// dump_string(otl_buffer);
#endif
@@ -2594,13 +2594,13 @@ bool TQOpenType::shape(TQShaperItem *item, const unsigned int *properties)
}
#ifdef OT_DEBUG
-// qDebug("log clusters before shaping:");
+// tqDebug("log clusters before shaping:");
// for (int j = 0; j < length; j++)
-// qDebug(" log[%d] = %d", j, item->log_clusters[j]);
- qDebug("shaped glyphs:");
+// tqDebug(" log[%d] = %d", j, item->log_clusters[j]);
+ tqDebug("shaped glyphs:");
for (int i = 0; i < length; ++i)
- qDebug(" glyph=%4x", otl_buffer->in_string[i].gindex);
- qDebug("-----------------------------------------");
+ tqDebug(" glyph=%4x", otl_buffer->in_string[i].gindex);
+ tqDebug("-----------------------------------------");
// dump_string(otl_buffer);
#endif
@@ -2643,7 +2643,7 @@ bool TQOpenType::positionAndAdd(TQShaperItem *item, bool doLogClusters)
int oldCi = 0;
for (unsigned int i = 0; i < otl_buffer->in_length; ++i) {
int ci = otl_buffer->in_string[i].cluster;
- // qDebug(" ci[%d] = %d mark=%d, cmb=%d, cs=%d",
+ // tqDebug(" ci[%d] = %d mark=%d, cmb=%d, cs=%d",
// i, ci, glyphAttributes[i].mark, glyphAttributes[i].combiningClass, glyphAttributes[i].clusterStart);
if (!item->attributes[i].mark && item->attributes[i].clusterStart && ci != oldCi) {
for (int j = oldCi; j < ci; j++)
@@ -2657,7 +2657,7 @@ bool TQOpenType::positionAndAdd(TQShaperItem *item, bool doLogClusters)
}
// calulate the advances for the shaped glyphs
-// qDebug("unpositioned: ");
+// tqDebug("unpositioned: ");
static_cast<TQFontEngineXft *>(item->font)->recalcAdvances(item->num_glyphs, item->glyphs, item->advances);
// positioning code:
@@ -2665,9 +2665,9 @@ bool TQOpenType::positionAndAdd(TQShaperItem *item, bool doLogClusters)
float scale = item->font->scale();
OTL_Position positions = otl_buffer->positions;
-// qDebug("positioned glyphs:");
+// tqDebug("positioned glyphs:");
for (unsigned int i = 0; i < otl_buffer->in_length; i++) {
-// qDebug(" %d:\t orig advance: (%d/%d)\tadv=(%d/%d)\tpos=(%d/%d)\tback=%d\tnew_advance=%d", i,
+// tqDebug(" %d:\t orig advance: (%d/%d)\tadv=(%d/%d)\tpos=(%d/%d)\tback=%d\tnew_advance=%d", i,
// glyphs[i].advance.x.toInt(), glyphs[i].advance.y.toInt(),
// (int)(positions[i].x_advance >> 6), (int)(positions[i].y_advance >> 6),
// (int)(positions[i].x_pos >> 6), (int)(positions[i].y_pos >> 6),
@@ -2695,7 +2695,7 @@ bool TQOpenType::positionAndAdd(TQShaperItem *item, bool doLogClusters)
--back;
}
}
-// qDebug(" ->\tadv=%d\tpos=(%d/%d)",
+// tqDebug(" ->\tadv=%d\tpos=(%d/%d)",
// glyphs[i].advance.x.toInt(), glyphs[i].offset.x.toInt(), glyphs[i].offset.y.toInt());
}
item->has_positioning = TRUE;
@@ -2705,18 +2705,18 @@ bool TQOpenType::positionAndAdd(TQShaperItem *item, bool doLogClusters)
#ifdef OT_DEBUG
// if (doLogClusters) {
-// qDebug("log clusters after shaping:");
+// tqDebug("log clusters after shaping:");
// for (int j = 0; j < length; j++)
-// qDebug(" log[%d] = %d", j, item->log_clusters[j]);
+// tqDebug(" log[%d] = %d", j, item->log_clusters[j]);
// }
- qDebug("final glyphs:");
+ tqDebug("final glyphs:");
for (int i = 0; i < (int)otl_buffer->in_length; ++i)
- qDebug(" glyph=%4x char_index=%d mark: %d cmp: %d, clusterStart: %d advance=%d offset=%d/%d",
+ tqDebug(" glyph=%4x char_index=%d mark: %d cmp: %d, clusterStart: %d advance=%d offset=%d/%d",
item->glyphs[i], otl_buffer->in_string[i].cluster, item->attributes[i].mark,
item->attributes[i].combiningClass, item->attributes[i].clusterStart,
item->advances[i],
item->offsets[i].x, item->offsets[i].y);
- qDebug("-----------------------------------------");
+ tqDebug("-----------------------------------------");
#endif
return TRUE;
}