summaryrefslogtreecommitdiffstats
path: root/src/kernel/qfontengine_x11.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/qfontengine_x11.cpp')
-rw-r--r--src/kernel/qfontengine_x11.cpp100
1 files changed, 50 insertions, 50 deletions
diff --git a/src/kernel/qfontengine_x11.cpp b/src/kernel/qfontengine_x11.cpp
index 290e3519d..3802a13c1 100644
--- a/src/kernel/qfontengine_x11.cpp
+++ b/src/kernel/qfontengine_x11.cpp
@@ -153,8 +153,8 @@ static void drawScaled(int x, int y, const TQTextEngine *engine, const TQScriptI
const TQWMatrix &xmat, float scale)
{
// font doesn't support transformations, need to do it by hand
- int w = qRound(si->width/scale);
- int h = qRound((si->ascent + si->descent + 1)/scale);
+ int w = tqRound(si->width/scale);
+ int h = tqRound((si->ascent + si->descent + 1)/scale);
if (w == 0 || h == 0)
return;
TQWMatrix mat1 = xmat;
@@ -362,7 +362,7 @@ int TQFontEngineBox::descent() const
int TQFontEngineBox::leading() const
{
- int l = qRound( _size * 0.15 );
+ int l = tqRound( _size * 0.15 );
return (l > 0) ? l : 1;
}
@@ -531,7 +531,7 @@ TQFontEngine::Error TQFontEngineXLFD::stringToCMap( const TQChar *str, int len,
}
if ( _scale != 1. ) {
for ( int i = 0; i < len; i++ )
- advances[i] = qRound(advances[i]*_scale);
+ advances[i] = tqRound(advances[i]*_scale);
}
}
return NoError;
@@ -786,7 +786,7 @@ glyph_metrics_t TQFontEngineXLFD::boundingBox( const glyph_t *glyphs, const adva
overall.y = TQMIN( overall.y, y );
xmax = TQMAX( xmax, overall.xoff + offsets[i].x + xcs->rbearing );
ymax = TQMAX( ymax, y + xcs->ascent + xcs->descent );
- overall.xoff += qRound(advances[i]/_scale);
+ overall.xoff += tqRound(advances[i]/_scale);
} else {
int size = _fs->ascent;
overall.x = TQMIN(overall.x, overall.xoff );
@@ -800,12 +800,12 @@ glyph_metrics_t TQFontEngineXLFD::boundingBox( const glyph_t *glyphs, const adva
overall.width = xmax - overall.x;
if ( _scale != 1. ) {
- overall.x = qRound(overall.x * _scale);
- overall.y = qRound(overall.y * _scale);
- overall.height = qRound(overall.height * _scale);
- overall.width = qRound(overall.width * _scale);
- overall.xoff = qRound(overall.xoff * _scale);
- overall.yoff = qRound(overall.yoff * _scale);
+ overall.x = tqRound(overall.x * _scale);
+ overall.y = tqRound(overall.y * _scale);
+ overall.height = tqRound(overall.height * _scale);
+ overall.width = tqRound(overall.width * _scale);
+ overall.xoff = tqRound(overall.xoff * _scale);
+ overall.yoff = tqRound(overall.yoff * _scale);
}
return overall;
}
@@ -822,12 +822,12 @@ glyph_metrics_t TQFontEngineXLFD::boundingBox( glyph_t glyph )
gm = glyph_metrics_t( 0, size, size, size, size, 0 );
}
if ( _scale != 1. ) {
- gm.x = qRound(gm.x * _scale);
- gm.y = qRound(gm.y * _scale);
- gm.height = qRound(gm.height * _scale);
- gm.width = qRound(gm.width * _scale);
- gm.xoff = qRound(gm.xoff * _scale);
- gm.yoff = qRound(gm.yoff * _scale);
+ gm.x = tqRound(gm.x * _scale);
+ gm.y = tqRound(gm.y * _scale);
+ gm.height = tqRound(gm.height * _scale);
+ gm.width = tqRound(gm.width * _scale);
+ gm.xoff = tqRound(gm.xoff * _scale);
+ gm.yoff = tqRound(gm.yoff * _scale);
}
return gm;
}
@@ -835,24 +835,24 @@ glyph_metrics_t TQFontEngineXLFD::boundingBox( glyph_t glyph )
int TQFontEngineXLFD::ascent() const
{
- return qRound(_fs->ascent*_scale);
+ return tqRound(_fs->ascent*_scale);
}
int TQFontEngineXLFD::descent() const
{
- return qRound((_fs->descent-1)*_scale);
+ return tqRound((_fs->descent-1)*_scale);
}
int TQFontEngineXLFD::leading() const
{
- int l = qRound((TQMIN(_fs->ascent, _fs->max_bounds.ascent)
+ int l = tqRound((TQMIN(_fs->ascent, _fs->max_bounds.ascent)
+ TQMIN(_fs->descent, _fs->max_bounds.descent)) * _scale * 0.15 );
return (l > 0) ? l : 1;
}
int TQFontEngineXLFD::maxCharWidth() const
{
- return qRound(_fs->max_bounds.width*_scale);
+ return tqRound(_fs->max_bounds.width*_scale);
}
@@ -888,7 +888,7 @@ int TQFontEngineXLFD::minLeftBearing() const
} else
((TQFontEngineXLFD *)this)->lbearing = _fs->min_bounds.lbearing;
}
- return qRound (lbearing*_scale);
+ return tqRound (lbearing*_scale);
}
int TQFontEngineXLFD::minRightBearing() const
@@ -916,7 +916,7 @@ int TQFontEngineXLFD::minRightBearing() const
} else
((TQFontEngineXLFD *)this)->rbearing = _fs->min_bounds.rbearing;
}
- return qRound (rbearing*_scale);
+ return tqRound (rbearing*_scale);
}
int TQFontEngineXLFD::cmap() const
@@ -1628,7 +1628,7 @@ TQFontEngine::Error TQFontEngineXft::stringToCMap( const TQChar *str, int len, g
}
if ( _scale != 1. ) {
for ( int i = 0; i < len; i++ )
- advances[i] = qRound(advances[i]*_scale);
+ advances[i] = tqRound(advances[i]*_scale);
}
}
#else
@@ -1694,7 +1694,7 @@ TQFontEngine::Error TQFontEngineXft::stringToCMap( const TQChar *str, int len, g
}
if ( _scale != 1. ) {
for ( int i = 0; i < len; i++ )
- advances[i] = qRound(advances[i]*_scale);
+ advances[i] = tqRound(advances[i]*_scale);
}
}
#endif // QT_XFT2
@@ -1720,7 +1720,7 @@ void TQFontEngineXft::recalcAdvances( int len, glyph_t *glyphs, advance_t *advan
}
if ( _scale != 1. ) {
for ( int i = 0; i < len; i++ )
- advances[i] = qRound(advances[i]*_scale);
+ advances[i] = tqRound(advances[i]*_scale);
}
}
#else
@@ -1737,7 +1737,7 @@ void TQFontEngineXft::recalcAdvances( int len, glyph_t *glyphs, advance_t *advan
}
if ( _scale != 1. ) {
for ( int i = 0; i < len; i++ )
- advances[i] = qRound(advances[i]*_scale);
+ advances[i] = tqRound(advances[i]*_scale);
}
#endif // QT_XFT2
}
@@ -2005,14 +2005,14 @@ glyph_metrics_t TQFontEngineXft::boundingBox( const glyph_t *glyphs, const advan
overall.y = TQMIN( overall.y, y );
xmax = TQMAX( xmax, x + xgi.width );
ymax = TQMAX( ymax, y + xgi.height );
- overall.xoff += qRound(advances[i]/_scale);
+ overall.xoff += tqRound(advances[i]/_scale);
}
- overall.x = qRound(overall.x * _scale);
- overall.y = qRound(overall.y * _scale);
- overall.xoff = qRound(overall.xoff * _scale);
- overall.yoff = qRound(overall.yoff * _scale);
- xmax = qRound(xmax * _scale);
- ymax = qRound(ymax * _scale);
+ overall.x = tqRound(overall.x * _scale);
+ overall.y = tqRound(overall.y * _scale);
+ overall.xoff = tqRound(overall.xoff * _scale);
+ overall.yoff = tqRound(overall.yoff * _scale);
+ xmax = tqRound(xmax * _scale);
+ ymax = tqRound(ymax * _scale);
} else {
for (int i = 0; i < numGlyphs; i++) {
getGlyphInfo( &xgi, _font, glyphs[i] );
@@ -2036,12 +2036,12 @@ glyph_metrics_t TQFontEngineXft::boundingBox( glyph_t glyph )
getGlyphInfo( &xgi, _font, glyph );
glyph_metrics_t gm = glyph_metrics_t( -xgi.x, -xgi.y, xgi.width, xgi.height, xgi.xOff, -xgi.yOff );
if ( _scale != 1. ) {
- gm.x = qRound(gm.x * _scale);
- gm.y = qRound(gm.y * _scale);
- gm.height = qRound(gm.height * _scale);
- gm.width = qRound(gm.width * _scale);
- gm.xoff = qRound(gm.xoff * _scale);
- gm.yoff = qRound(gm.yoff * _scale);
+ gm.x = tqRound(gm.x * _scale);
+ gm.y = tqRound(gm.y * _scale);
+ gm.height = tqRound(gm.height * _scale);
+ gm.width = tqRound(gm.width * _scale);
+ gm.xoff = tqRound(gm.xoff * _scale);
+ gm.yoff = tqRound(gm.yoff * _scale);
}
return gm;
}
@@ -2050,18 +2050,18 @@ glyph_metrics_t TQFontEngineXft::boundingBox( glyph_t glyph )
int TQFontEngineXft::ascent() const
{
- return qRound(_font->ascent*_scale);
+ return tqRound(_font->ascent*_scale);
}
int TQFontEngineXft::descent() const
{
- return qRound((_font->descent-1)*_scale);
+ return tqRound((_font->descent-1)*_scale);
}
// #### use Freetype to determine this
int TQFontEngineXft::leading() const
{
- int l = qRound(TQMIN( _font->height - (_font->ascent + _font->descent),
+ int l = tqRound(TQMIN( _font->height - (_font->ascent + _font->descent),
((_font->ascent + _font->descent) >> 4)*_scale ));
return (l > 0) ? l : 1;
}
@@ -2089,7 +2089,7 @@ int TQFontEngineXft::underlinePosition() const
int TQFontEngineXft::maxCharWidth() const
{
- return qRound(_font->max_advance_width*_scale);
+ return tqRound(_font->max_advance_width*_scale);
}
static const ushort char_table[] = {
@@ -2675,15 +2675,15 @@ bool TQOpenType::positionAndAdd(TQShaperItem *item, bool doLogClusters)
// ###### fix the case where we have y advances. How do we handle this in Uniscribe?????
if (positions[i].new_advance) {
item->advances[i] = item->flags & TQTextEngine::RightToLeft
- ? -qRound((positions[i].x_advance >> 6)*scale)
- : qRound((positions[i].x_advance >> 6)*scale);
+ ? -tqRound((positions[i].x_advance >> 6)*scale)
+ : tqRound((positions[i].x_advance >> 6)*scale);
} else {
item->advances[i] += item->flags & TQTextEngine::RightToLeft
- ? -qRound((positions[i].x_advance >> 6)*scale)
- : qRound((positions[i].x_advance >> 6)*scale);
+ ? -tqRound((positions[i].x_advance >> 6)*scale)
+ : tqRound((positions[i].x_advance >> 6)*scale);
}
- item->offsets[i].x = qRound((positions[i].x_pos >> 6)*scale);
- item->offsets[i].y = -qRound((positions[i].y_pos >> 6)*scale);
+ item->offsets[i].x = tqRound((positions[i].x_pos >> 6)*scale);
+ item->offsets[i].y = -tqRound((positions[i].y_pos >> 6)*scale);
int back = positions[i].back;
if (item->flags & TQTextEngine::RightToLeft) {
while (back--) {