diff options
Diffstat (limited to 'src/kernel/tqfontdatabase_x11.cpp')
| -rw-r--r-- | src/kernel/tqfontdatabase_x11.cpp | 138 |
1 files changed, 69 insertions, 69 deletions
diff --git a/src/kernel/tqfontdatabase_x11.cpp b/src/kernel/tqfontdatabase_x11.cpp index ee7387387..b26842fc7 100644 --- a/src/kernel/tqfontdatabase_x11.cpp +++ b/src/kernel/tqfontdatabase_x11.cpp @@ -61,7 +61,7 @@ #ifdef TQFONTDATABASE_DEBUG # define FD_DEBUG tqDebug #else -# define FD_DEBUG if (FALSE) tqDebug +# define FD_DEBUG if (false) tqDebug #endif // TQFONTDATABASE_DEBUG // from tqfont_x11.cpp @@ -71,7 +71,7 @@ extern double qt_pixelSize(double pointSize, TQPaintDevice *paintdevice, int scr static inline void capitalize ( char *s ) { - bool space = TRUE; + bool space = true; while( *s ) { if ( space ) *s = toupper( *s ); @@ -535,7 +535,7 @@ static bool parseXFontName( char *fontName, char **tokens ) { if ( ! fontName || fontName[0] == '0' || fontName[0] != '-' ) { tokens[0] = 0; - return FALSE; + return false; } int i; @@ -557,10 +557,10 @@ static bool parseXFontName( char *fontName, char **tokens ) if ( i < NFontFields ) { for ( int j = i ; j < NFontFields; ++j ) tokens[j] = 0; - return FALSE; + return false; } - return TRUE; + return true; } static inline bool isZero(char *x) @@ -593,7 +593,7 @@ static inline bool isFixedPitch( char **tokens ) Fills in a font definition (TQFontDef) from an XLFD (X Logical Font Description). - Returns TRUE if the the given xlfd is valid. The fields lbearing + Returns true if the the given xlfd is valid. The fields lbearing and rbearing are not given any values. */ bool qt_fillFontDef( const TQCString &xlfd, TQFontDef *fd, int screen ) @@ -601,7 +601,7 @@ bool qt_fillFontDef( const TQCString &xlfd, TQFontDef *fd, int screen ) char *tokens[NFontFields]; TQCString buffer = xlfd.copy(); if ( ! parseXFontName(buffer.data(), tokens) ) - return FALSE; + return false; capitalize(tokens[Family]); capitalize(tokens[Foundry]); @@ -638,14 +638,14 @@ bool qt_fillFontDef( const TQCString &xlfd, TQFontDef *fd, int screen ) fd->pixelSize = tqRound(qt_pixelSize(fd->pointSize / 10., 0, screen)); } - return TRUE; + return true; } /* Fills in a font definition (TQFontDef) from the font properties in an XFontStruct. - Returns TRUE if the TQFontDef could be filled with properties from + Returns true if the TQFontDef could be filled with properties from the XFontStruct. The fields lbearing and rbearing are not given any values. */ @@ -653,7 +653,7 @@ static bool qt_fillFontDef( XFontStruct *fs, TQFontDef *fd, int screen ) { unsigned long value; if ( fs && !XGetFontProperty( fs, XA_FONT, &value ) ) - return FALSE; + return false; char *n = XGetAtomName( TQPaintDevice::x11AppDisplay(), value ); TQCString xlfd( n ); @@ -674,14 +674,14 @@ static TQtFontStyle::Key getStyle( char ** tokens ) char slant1 = tolower( (uchar) tokens[Slant][1] ); if ( slant1 == 'o' ) - key.oblique = TRUE; + key.oblique = true; else if ( slant1 == 'i' ) - key.italic = TRUE; + key.italic = true; } } else if ( slant0 == 'o' ) - key.oblique = TRUE; + key.oblique = true; else if ( slant0 == 'i' ) - key.italic = TRUE; + key.italic = true; key.weight = getFontWeight( tokens[Weight] ); @@ -702,7 +702,7 @@ static TQtFontStyle::Key getStyle( char ** tokens ) extern bool tqt_has_xft; // defined in tqfont_x11.cpp -static bool xlfdsFullyLoaded = FALSE; +static bool xlfdsFullyLoaded = false; static unsigned char encodingLoaded[numEncodings]; static void loadXlfds( const char *reqFamily, int encoding_id ) @@ -748,13 +748,13 @@ static void loadXlfds( const char *reqFamily, int encoding_id ) capitalize( foundryName ); TQtFontStyle::Key styleKey = getStyle( tokens ); - bool smooth_scalable = FALSE; - bool bitmap_scalable = FALSE; + bool smooth_scalable = false; + bool bitmap_scalable = false; if ( isScalable(tokens) ) { if ( isSmoothlyScalable( tokens ) ) - smooth_scalable = TRUE; + smooth_scalable = true; else - bitmap_scalable = TRUE; + bitmap_scalable = true; } uint pixelSize = atoi( tokens[PixelSize] ); uint xpointSize = atoi( tokens[PointSize] ); @@ -773,10 +773,10 @@ static void loadXlfds( const char *reqFamily, int encoding_id ) continue; } - TQtFontFamily *family = fontFamily ? fontFamily : db->family( familyName, TRUE ); + TQtFontFamily *family = fontFamily ? fontFamily : db->family( familyName, true ); family->fontFileIndex = -1; - TQtFontFoundry *foundry = family->foundry( foundryName, TRUE ); - TQtFontStyle *style = foundry->style( styleKey, TRUE ); + TQtFontFoundry *foundry = family->foundry( foundryName, true ); + TQtFontStyle *style = foundry->style( styleKey, true ); delete [] style->weightName; style->weightName = tqstrdup( tokens[Weight] ); @@ -784,18 +784,18 @@ static void loadXlfds( const char *reqFamily, int encoding_id ) style->setwidthName = tqstrdup( tokens[Width] ); if ( smooth_scalable ) { - style->smoothScalable = TRUE; - style->bitmapScalable = FALSE; + style->smoothScalable = true; + style->bitmapScalable = false; pixelSize = SMOOTH_SCALABLE; } if ( !style->smoothScalable && bitmap_scalable ) - style->bitmapScalable = TRUE; + style->bitmapScalable = true; if ( !fixedPitch ) - family->fixedPitch = FALSE; + family->fixedPitch = false; - TQtFontSize *size = style->pixelSize( pixelSize, TRUE ); + TQtFontSize *size = style->pixelSize( pixelSize, true ); TQtFontEncoding *enc = - size->encodingID( encoding_id, xpointSize, xres, yres, avgwidth, TRUE ); + size->encodingID( encoding_id, xpointSize, xres, yres, avgwidth, true ); enc->pitch = *tokens[Spacing]; if ( !enc->pitch ) enc->pitch = '*'; @@ -806,14 +806,14 @@ static void loadXlfds( const char *reqFamily, int encoding_id ) family->scripts[script] |= TQtFontFamily::UnSupported_Xlfd; } if ( encoding_id == -1 ) - family->xlfdLoaded = TRUE; + family->xlfdLoaded = true; } if ( !reqFamily ) { // mark encoding as loaded if ( encoding_id == -1 ) - xlfdsFullyLoaded = TRUE; + xlfdsFullyLoaded = true; else - encodingLoaded[encoding_id] = TRUE; + encodingLoaded[encoding_id] = true; } XFreeFontNames( fontList ); @@ -847,20 +847,20 @@ static void loadXft() bool fixed; }; const XftDefaultFont defaults[] = { - { "Serif", "serif", FALSE }, - { "Sans Serif", "sans-serif", FALSE }, - { "Monospace", "monospace", TRUE }, - { 0, 0, FALSE } + { "Serif", "serif", false }, + { "Sans Serif", "sans-serif", false }, + { "Monospace", "monospace", true }, + { 0, 0, false } }; const XftDefaultFont *f = defaults; while (f->qtname) { - TQtFontFamily *family = db->family( f->qtname, TRUE ); + TQtFontFamily *family = db->family( f->qtname, true ); family->fixedPitch = f->fixed; family->rawName = f->rawname; - family->hasXft = TRUE; - family->synthetic = TRUE; + family->hasXft = true; + family->synthetic = true; TQtFontFoundry *foundry - = family->foundry( TQString::null, TRUE ); + = family->foundry( TQString::null, true ); for ( int i = 0; i < TQFont::LastPrivateScript; ++i ) { if (i == TQFont::UnknownScript) @@ -869,14 +869,14 @@ static void loadXft() } TQtFontStyle::Key styleKey; - styleKey.oblique = FALSE; + styleKey.oblique = false; for (int i = 0; i < 4; ++i) { styleKey.italic = (i%2); styleKey.weight = (i > 1) ? TQFont::Bold : TQFont::Normal; - TQtFontStyle *style = foundry->style( styleKey, TRUE ); - style->smoothScalable = TRUE; - TQtFontSize *size = style->pixelSize( SMOOTH_SCALABLE, TRUE ); - TQtFontEncoding *enc = size->encodingID( -1, 0, 0, 0, 0, TRUE ); + TQtFontStyle *style = foundry->style( styleKey, true ); + style->smoothScalable = true; + TQtFontSize *size = style->pixelSize( SMOOTH_SCALABLE, true ); + TQtFontEncoding *enc = size->encodingID( -1, 0, 0, 0, 0, true ); enc->pitch = (f->fixed ? 'm' : 'p'); } ++f; @@ -893,29 +893,29 @@ static void checkXftMatrix( TQtFontFamily* family ) { TQtFontSize *size = style->pixelSize( SMOOTH_SCALABLE ); if ( ! size ) continue; - TQtFontEncoding *enc = size->encodingID( -1, 0, 0, 0, 0, TRUE ); + TQtFontEncoding *enc = size->encodingID( -1, 0, 0, 0, 0, true ); if ( ! enc ) continue; TQtFontStyle::Key key = style->key; // does this style have an italic equivalent? - key.italic = TRUE; + key.italic = true; TQtFontStyle *equiv = foundry->style( key ); if ( equiv ) continue; // does this style have an oblique equivalent? - key.italic = FALSE; - key.oblique = TRUE; + key.italic = false; + key.oblique = true; equiv = foundry->style( key ); if ( equiv ) continue; // let's fake one... - equiv = foundry->style( key, TRUE ); - equiv->fakeOblique = TRUE; - equiv->smoothScalable = TRUE; + equiv = foundry->style( key, true ); + equiv->fakeOblique = true; + equiv->smoothScalable = true; - TQtFontSize *equiv_size = equiv->pixelSize( SMOOTH_SCALABLE, TRUE ); - TQtFontEncoding *equiv_enc = equiv_size->encodingID( -1, 0, 0, 0, 0, TRUE ); + TQtFontSize *equiv_size = equiv->pixelSize( SMOOTH_SCALABLE, true ); + TQtFontEncoding *equiv_enc = equiv_size->encodingID( -1, 0, 0, 0, 0, true ); // keep the same pitch equiv_enc->pitch = enc->pitch; @@ -958,9 +958,9 @@ static bool loadXftFont( FcPattern* font ) FcPatternGetBool(font, FC_SCALABLE, 0, &scalable); foundry_value = 0; XftPatternGetString(font, FC_FOUNDRY, 0, &foundry_value); - TQtFontFamily *family = db->family( familyName, TRUE ); + TQtFontFamily *family = db->family( familyName, true ); family->rawName = rawName; - family->hasXft = TRUE; + family->hasXft = true; FcCharSet *charset = 0; FcResult res = FcPatternGetCharSet(font, FC_CHARSET, 0, &charset); @@ -979,7 +979,7 @@ static bool loadXftFont( FcPattern* font ) family->scripts[i] |= TQtFontFamily::UnSupported_Xft; } } - family->xftScriptCheck = TRUE; + family->xftScriptCheck = true; } else { // we set UnknownScript to supported for symbol fonts. It makes no sense to merge these // with other ones, as they are special in a way. @@ -1005,23 +1005,23 @@ static bool loadXftFont( FcPattern* font ) } TQtFontFoundry *foundry - = family->foundry( foundry_value ? TQString::fromUtf8(foundry_value) : TQString::null, TRUE ); - TQtFontStyle *style = foundry->style( styleKey, TRUE ); + = family->foundry( foundry_value ? TQString::fromUtf8(foundry_value) : TQString::null, true ); + TQtFontStyle *style = foundry->style( styleKey, true ); if (spacing_value < XFT_MONO ) - family->fixedPitch = FALSE; + family->fixedPitch = false; TQtFontSize *size; if (scalable) { - style->smoothScalable = TRUE; - size = style->pixelSize( SMOOTH_SCALABLE, TRUE ); + style->smoothScalable = true; + size = style->pixelSize( SMOOTH_SCALABLE, true ); } else { double pixel_size = 0; XftPatternGetDouble (font, FC_PIXEL_SIZE, 0, &pixel_size); - size = style->pixelSize( (int)pixel_size, TRUE ); + size = style->pixelSize( (int)pixel_size, true ); } - TQtFontEncoding *enc = size->encodingID( -1, 0, 0, 0, 0, TRUE ); + TQtFontEncoding *enc = size->encodingID( -1, 0, 0, 0, 0, true ); enc->pitch = ( spacing_value >= XFT_CHARCELL ? 'c' : ( spacing_value >= XFT_MONO ? 'm' : 'p' ) ); @@ -1071,7 +1071,7 @@ static void load( const TQString &family = TQString::null, int script = -1 ) } } } else { - TQtFontFamily *f = db->family( family, TRUE ); + TQtFontFamily *f = db->family( family, true ); if ( !f->fullyLoaded ) { #ifndef TQT_NO_XFTFREETYPE @@ -1097,7 +1097,7 @@ static void load( const TQString &family = TQString::null, int script = -1 ) mfamily.replace(TQChar(' '), TQChar('-')); goto redo; } - f->fullyLoaded = TRUE; + f->fullyLoaded = true; return; } #endif // TQT_NO_XFTFREETYPE @@ -1107,7 +1107,7 @@ static void load( const TQString &family = TQString::null, int script = -1 ) ( !f->hasXft && !(f->scripts[script] & TQtFontFamily::Supported) && !(f->scripts[script] & TQtFontFamily::UnSupported_Xlfd) ) ) { loadXlfds( family, -1 ); - f->fullyLoaded = TRUE; + f->fullyLoaded = true; } } } @@ -1531,7 +1531,7 @@ static TQFontEngine *loadFontConfigFont(const TQFontPrivate *fp, const TQFontDef key.weight = request.weight; key.stretch = request.stretch; - double scale = addPatternProps(pattern, key, FALSE, TRUE, fp, request); + double scale = addPatternProps(pattern, key, false, true, fp, request); #ifdef FONT_MATCH_DEBUG tqDebug("original pattern contains:"); FcPatternPrint(pattern); @@ -1666,7 +1666,7 @@ static TQFontEngine *loadFontConfigFont(const TQFontPrivate *fp, const TQFontDef XftPattern *pattern = XftPatternDuplicate(font); // add properties back in as the font selected from the list doesn't contain them. - addPatternProps(pattern, key, FALSE, TRUE, fp, request); + addPatternProps(pattern, key, false, true, fp, request); XftPattern *result = XftFontMatch( TQPaintDevice::x11AppDisplay(), fp->screen, pattern, &res ); @@ -1720,7 +1720,7 @@ static TQFontEngine *loadFontConfigFont(const TQFontPrivate *fp, const TQFontDef XftPatternGetInteger(xft->pattern(), XFT_SPACING, 0, &spacing); xft->fontDef.fixedPitch = spacing != XFT_PROPORTIONAL; - xft->fontDef.ignorePitch = FALSE; + xft->fontDef.ignorePitch = false; break; } } |
