summaryrefslogtreecommitdiffstats
path: root/src/kernel/tqfontengine_x11.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/tqfontengine_x11.cpp')
-rw-r--r--src/kernel/tqfontengine_x11.cpp96
1 files changed, 48 insertions, 48 deletions
diff --git a/src/kernel/tqfontengine_x11.cpp b/src/kernel/tqfontengine_x11.cpp
index aa116b93d..9276a5a93 100644
--- a/src/kernel/tqfontengine_x11.cpp
+++ b/src/kernel/tqfontengine_x11.cpp
@@ -71,17 +71,17 @@ static void drawLines( TQPainter *p, TQFontEngine *fe, int baseline, int x1, int
int lw = fe->lineThickness();
if ( textFlags & TQt::Underline ) {
int pos = fe->underlinePosition();
- qt_draw_transformed_rect( p, x1, baseline+pos, w, lw, TRUE );
+ qt_draw_transformed_rect( p, x1, baseline+pos, w, lw, true );
}
if ( textFlags & TQt::Overline ) {
int pos = fe->ascent()+1;
if ( !pos ) pos = 1;
- qt_draw_transformed_rect( p, x1, baseline-pos, w, lw, TRUE );
+ qt_draw_transformed_rect( p, x1, baseline-pos, w, lw, true );
}
if ( textFlags & TQt::StrikeOut ) {
int pos = fe->ascent()/3;
if ( !pos ) pos = 1;
- qt_draw_transformed_rect( p, x1, baseline-pos, w, lw, TRUE );
+ qt_draw_transformed_rect( p, x1, baseline-pos, w, lw, true );
}
}
@@ -161,7 +161,7 @@ static void drawScaled(int x, int y, const TQTextEngine *engine, const TQScriptI
mat1.scale(scale, scale);
w += h; // add some pixels to width because of italic correction
- TQBitmap bm( w, h, TRUE ); // create bitmap
+ TQBitmap bm( w, h, true ); // create bitmap
TQPainter paint;
paint.begin( &bm ); // draw text in bitmap
fe->draw( &paint, 0, si->ascent/scale, engine, si, textFlags );
@@ -280,7 +280,7 @@ void TQFontEngineBox::draw( TQPainter *p, int x, int y, const TQTextEngine *engi
int s = _size - 3;
for (int k = 0; k < si->num_glyphs; k++) {
if (!glyphAttributes[k].zeroWidth)
- qt_draw_transformed_rect( p, xp, yp, s, s, FALSE );
+ qt_draw_transformed_rect( p, xp, yp, s, s, false );
xp += _size;
}
} else {
@@ -383,7 +383,7 @@ const char *TQFontEngineBox::name() const
bool TQFontEngineBox::canRender( const TQChar *, int )
{
- return TRUE;
+ return true;
}
TQFontEngine::Type TQFontEngineBox::type() const
@@ -474,10 +474,10 @@ TQFontEngine::Error TQFontEngineXLFD::stringToCMap( const TQChar *str, int len,
}
if ( _codec ) {
- bool haveNbsp = FALSE;
+ bool haveNbsp = false;
for ( int i = 0; i < len; i++ )
if ( str[i].unicode() == 0xa0 ) {
- haveNbsp = TRUE;
+ haveNbsp = true;
break;
}
@@ -549,10 +549,10 @@ TQFontEngine::Error TQFontEngineXLFD::stringToCMap( const TQChar *str, int len,
extern "C" {
#endif
-static bool x_font_load_error = FALSE;
+static bool x_font_load_error = false;
static int x_font_errorhandler(Display *, XErrorEvent *)
{
- x_font_load_error = TRUE;
+ x_font_load_error = true;
return 0;
}
@@ -572,7 +572,7 @@ void TQFontEngineXLFD::draw( TQPainter *p, int x, int y, const TQTextEngine *eng
TQt::HANDLE hd = p->device()->handle();
GC gc = p->gc;
- bool transform = FALSE;
+ bool transform = false;
int xorig = x;
int yorig = y;
@@ -644,10 +644,10 @@ void TQFontEngineXLFD::draw( TQPainter *p, int x, int y, const TQTextEngine *eng
//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;
+ x_font_load_error = false;
XErrorHandler old_handler = XSetErrorHandler( x_font_errorhandler );
font_id = XLoadFont( dpy, xlfd_transformed.data() );
- XSync( dpy, FALSE );
+ XSync( dpy, false );
XSetErrorHandler( old_handler );
if ( x_font_load_error ) {
//tqDebug( "couldn't load transformed font" );
@@ -673,7 +673,7 @@ void TQFontEngineXLFD::draw( TQPainter *p, int x, int y, const TQTextEngine *eng
_scale = tmp;
return;
}
- transform = TRUE;
+ transform = true;
} else if ( p->txop == TQPainter::TxTranslate ) {
p->map( x, y, &x, &y );
}
@@ -942,15 +942,15 @@ bool TQFontEngineXLFD::canRender( const TQChar *string, int len )
glyph_t glyphs[256];
int nglyphs = 255;
glyph_t *g = glyphs;
- if ( stringToCMap( string, len, g, 0, &nglyphs, FALSE ) == OutOfMemory ) {
+ if ( stringToCMap( string, len, g, 0, &nglyphs, false ) == OutOfMemory ) {
g = (glyph_t *)malloc( nglyphs*sizeof(glyph_t) );
- stringToCMap( string, len, g, 0, &nglyphs, FALSE );
+ stringToCMap( string, len, g, 0, &nglyphs, false );
}
- bool allExist = TRUE;
+ bool allExist = true;
for ( int i = 0; i < nglyphs; i++ ) {
if ( !g[i] || !charStruct( _fs, g[i] ) ) {
- allExist = FALSE;
+ allExist = false;
break;
}
}
@@ -1029,10 +1029,10 @@ void TQFontEngineLatinXLFD::findEngine( const TQChar &ch )
int i;
for ( i = 0; i < mib_count; ++i ) {
const int mib = qt_mib_for_xlfd_encoding( alternate_encodings[i] );
- bool skip = FALSE;
+ bool skip = false;
for ( int e = 0; e < _count; ++e ) {
if ( _engines[e]->cmap() == mib ) {
- skip = TRUE;
+ skip = true;
break;
}
}
@@ -1080,7 +1080,7 @@ void TQFontEngineLatinXLFD::findEngine( const TQChar &ch )
chars[i] = i;
chars[0x200] = 0x20ac;
int glyphCount = 0x201;
- engine->stringToCMap( (const TQChar *) chars, 0x201, glyphs, advances, &glyphCount, FALSE );
+ engine->stringToCMap( (const TQChar *) chars, 0x201, glyphs, advances, &glyphCount, false );
// merge member data with the above
for ( i = 0; i < 0x200; ++i ) {
@@ -1104,7 +1104,7 @@ TQFontEngineLatinXLFD::stringToCMap( const TQChar *str, int len, glyph_t *glyphs
}
int i;
- bool missing = FALSE;
+ bool missing = false;
const TQChar *c = str+len;
glyph_t *g = glyphs+len;
if ( advances ) {
@@ -1382,21 +1382,21 @@ const char *TQFontEngineLatinXLFD::name() const
bool TQFontEngineLatinXLFD::canRender( const TQChar *string, int len )
{
- bool all = TRUE;
+ bool all = true;
int i;
for ( i = 0; i < len; ++i ) {
if ( string[i].unicode() >= 0x200 ||
glyphIndices[string[i].unicode()] == 0 ) {
if (string[i].unicode() != 0x20ac || euroIndex == 0)
- all = FALSE;
+ all = false;
break;
}
}
if ( all )
- return TRUE;
+ return true;
- all = TRUE;
+ all = true;
for ( i = 0; i < len; ++i ) {
if ( string[i].unicode() >= 0x200 ) {
if (string[i].unicode() == 0x20ac) {
@@ -1407,14 +1407,14 @@ bool TQFontEngineLatinXLFD::canRender( const TQChar *string, int len )
if (euroIndex)
continue;
}
- all = FALSE;
+ all = false;
break;
}
if ( glyphIndices[string[i].unicode()] != 0 ) continue;
findEngine( string[i] );
if ( glyphIndices[string[i].unicode()] == 0 ) {
- all = FALSE;
+ all = false;
break;
}
}
@@ -1432,7 +1432,7 @@ void TQFontEngineLatinXLFD::setScale( double scale )
chars[i] = i;
int glyphCount = 0x200;
_engines[0]->stringToCMap( (const TQChar *)chars, 0x200,
- glyphIndices, glyphAdvances, &glyphCount, FALSE );
+ glyphIndices, glyphAdvances, &glyphCount, false );
}
@@ -1491,7 +1491,7 @@ TQFontEngineXft::TQFontEngineXft( XftFont *font, XftPattern *pattern, int cmap )
// if the Xft font is not antialiased, it uses bitmaps instead of
// 8-bit alpha maps... adjust the cache_cost to reflect this
- Bool antialiased = TRUE;
+ Bool antialiased = true;
if ( XftPatternGetBool( pattern, XFT_ANTIALIAS,
0, &antialiased ) == XftResultMatch &&
! antialiased ) {
@@ -1616,12 +1616,12 @@ void TQFontEngineXft::draw( TQPainter *p, int x, int y, const TQTextEngine *engi
GlyphAttributes *glyphAttributes = engine->glyphAttributes( si );
XftFont *fnt = _font;
- bool transform = FALSE;
+ bool transform = false;
if ( p->txop >= TQPainter::TxScale || p->rop != TQt::CopyROP || _scale < 0.9999 || _scale > 1.001) {
bool can_scale = (_face->face_flags & FT_FACE_FLAG_SCALABLE) && p->rop == TQt::CopyROP;
double size = (p->m11()*p->m22() - p->m12()*p->m21())*_scale*_scale*fontDef.pixelSize*fontDef.pixelSize;
if (size > 256*256 || _scale < .9999 || _scale > 1.001)
- can_scale = FALSE;
+ can_scale = false;
if (!can_scale) {
// font doesn't support transformations, need to do it by hand
float tmp = _scale;
@@ -1686,7 +1686,7 @@ void TQFontEngineXft::draw( TQPainter *p, int x, int y, const TQTextEngine *engi
trf->next = transformed_fonts;
transformed_fonts = trf;
}
- transform = TRUE;
+ transform = true;
} else if ( p->txop == TQPainter::TxTranslate ) {
p->map( x, y, &x, &y );
}
@@ -1948,7 +1948,7 @@ int TQFontEngineXft::minRightBearing() const
TQChar *ch = (TQChar *)char_table;
glyph_t glyphs[char_table_entries];
int ng = char_table_entries;
- stringToCMap(ch, char_table_entries, glyphs, 0, &ng, FALSE);
+ stringToCMap(ch, char_table_entries, glyphs, 0, &ng, false);
while (--ng) {
if (glyphs[ng]) {
glyph_metrics_t gi = that->boundingBox( glyphs[ng] );
@@ -1980,14 +1980,14 @@ void TQFontEngineXft::setScale( double scale )
bool TQFontEngineXft::canRender( const TQChar *string, int len )
{
- bool allExist = TRUE;
+ bool allExist = true;
if (_cmap != -1) {
for ( int i = 0; i < len; i++ ) {
uint uc = getCodepoint(string, i, len);
if (!XftCharExists(0, _font, uc)
&& getAdobeCharIndex(_font, _cmap, uc) == 0) {
- allExist = FALSE;
+ allExist = false;
break;
}
}
@@ -1995,7 +1995,7 @@ bool TQFontEngineXft::canRender( const TQChar *string, int len )
for ( int i = 0; i < len; i++ ) {
uint uc = getCodepoint(string, i, len);
if (!XftCharExists(0, _font, uc)) {
- allExist = FALSE;
+ allExist = false;
break;
}
}
@@ -2259,7 +2259,7 @@ bool TQOpenType::checkScript(unsigned int script)
if (requirements & RequiresGsub) {
if (!gsub)
- return FALSE;
+ return false;
FT_UShort script_index;
FT_Error error = TT_GSUB_Select_Script(gsub, tag, &script_index);
@@ -2267,13 +2267,13 @@ bool TQOpenType::checkScript(unsigned int script)
#ifdef OT_DEBUG
tqDebug("could not select script %d in GSub table: %d", (int)script, error);
#endif
- return FALSE;
+ return false;
}
}
if (requirements & RequiresGpos) {
if (!gpos)
- return FALSE;
+ return false;
FT_UShort script_index;
FT_Error error = TT_GPOS_Select_Script(gpos, script, &script_index);
@@ -2281,11 +2281,11 @@ bool TQOpenType::checkScript(unsigned int script)
#ifdef OT_DEBUG
tqDebug("could not select script in gpos table: %d", error);
#endif
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
@@ -2436,8 +2436,8 @@ bool TQOpenType::positionAndAdd(TQShaperItem *item, bool doLogClusters)
face = lockFTFace(static_cast<TQFontEngineXft *>(fontEngine)->font());
#endif
memset(otl_buffer->positions, 0, otl_buffer->in_length*sizeof(OTL_PositionRec));
- // #### check that passing "FALSE,FALSE" is correct
- TT_GPOS_Apply_String(face, gpos, loadFlags, otl_buffer, FALSE, FALSE);
+ // #### check that passing "false,false" is correct
+ TT_GPOS_Apply_String(face, gpos, loadFlags, otl_buffer, false, false);
#ifdef TQ_WS_X11
unlockFTFace(static_cast<TQFontEngineXft *>(fontEngine)->font());
#endif
@@ -2446,14 +2446,14 @@ bool TQOpenType::positionAndAdd(TQShaperItem *item, bool doLogClusters)
// make sure we have enough space to write everything back
if (item->num_glyphs < (int)otl_buffer->in_length) {
item->num_glyphs = otl_buffer->in_length;
- return FALSE;
+ return false;
}
for (unsigned int i = 0; i < otl_buffer->in_length; ++i) {
item->glyphs[i] = otl_buffer->in_string[i].gindex;
item->attributes[i] = tmpAttributes[otl_buffer->in_string[i].cluster];
if (i && otl_buffer->in_string[i].cluster == otl_buffer->in_string[i-1].cluster)
- item->attributes[i].clusterStart = FALSE;
+ item->attributes[i].clusterStart = false;
}
item->num_glyphs = otl_buffer->in_length;
@@ -2519,7 +2519,7 @@ bool TQOpenType::positionAndAdd(TQShaperItem *item, bool doLogClusters)
// 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;
+ item->has_positioning = true;
} else {
qt_heuristicPosition(item);
}
@@ -2539,7 +2539,7 @@ bool TQOpenType::positionAndAdd(TQShaperItem *item, bool doLogClusters)
item->offsets[i].x, item->offsets[i].y);
tqDebug("-----------------------------------------");
#endif
- return TRUE;
+ return true;
}
#endif