diff -Nur qt4-x11-4.5.0-orig/src/gui/text/qfontengine_ft.cpp qt4-x11-4.5.0/src/gui/text/qfontengine_ft.cpp --- qt4-x11-4.5.0-orig/src/gui/text/qfontengine_ft.cpp 2009-04-25 20:27:02.000000000 +0900 +++ qt4-x11-4.5.0/src/gui/text/qfontengine_ft.cpp 2009-04-25 20:35:55.000000000 +0900 @@ -60,6 +60,7 @@ #include #include FT_FREETYPE_H #include FT_OUTLINE_H +#include FT_SYNTHESIS_H #include FT_TRUETYPE_TABLES_H #include FT_TYPE1_TABLES_H #include FT_GLYPH_H @@ -610,6 +611,7 @@ cache_cost = 100; kerning_pairs_loaded = false; transform = false; + embolden = false; antialias = true; embolden = false; default_load_flags = 0; @@ -667,10 +669,7 @@ FT_Face face = lockFace(); - //underline metrics if (FT_IS_SCALABLE(face)) { - line_thickness = QFixed::fromFixed(FT_MulFix(face->underline_thickness, face->size->metrics.y_scale)); - underline_position = QFixed::fromFixed(-FT_MulFix(face->underline_position, face->size->metrics.y_scale)); bool fake_oblique = (fontDef.style != QFont::StyleNormal) && !(face->style_flags & FT_STYLE_FLAG_ITALIC); if (fake_oblique) matrix.xy = 0x10000*3/10; @@ -678,6 +677,12 @@ freetype->matrix = matrix; if (fake_oblique) transform = true; + // fake bold + if ((fontDef.weight == QFont::Bold) && !(face->style_flags & FT_STYLE_FLAG_BOLD)) + embolden = true; + // underline metrics + line_thickness = QFixed::fromFixed(FT_MulFix(face->underline_thickness, face->size->metrics.y_scale)); + underline_position = QFixed::fromFixed(-FT_MulFix(face->underline_position, face->size->metrics.y_scale)); } else { // copied from QFontEngineQPF // ad hoc algorithm @@ -1229,6 +1234,8 @@ int s = 0; if ((fontDef.style != QFont::StyleNormal) && !(freetype->face->style_flags & FT_STYLE_FLAG_ITALIC)) s = SynthesizedItalic; + if ((fontDef.weight == QFont::Bold) && !(freetype->face->style_flags & FT_STYLE_FLAG_BOLD)) + s |= SynthesizedBold; if (fontDef.stretch != 100 && FT_IS_SCALABLE(freetype->face)) s |= SynthesizedStretch; return s;