diff -u qt4-x11-4.6.2/debian/changelog qt4-x11-4.6.2/debian/changelog --- qt4-x11-4.6.2/debian/changelog +++ qt4-x11-4.6.2/debian/changelog @@ -1,3 +1,10 @@ +qt4-x11 (4:4.6.2-0ubuntu6) lucid; urgency=low + + * Use FT_Outline_Embolden instead of FT_GlyphSlot_Embolden as the latter + modifies glyph geometry and breaks monospace fonts (LP: #583526) + + -- Alexander Saltykov Fri, 21 May 2010 11:17:44 +0600 + qt4-x11 (4:4.6.2-0ubuntu5) lucid; urgency=low [ Alessandro Ghersi ] diff -u qt4-x11-4.6.2/debian/patches/kubuntu_09_use_ft_glyph_embolden_to_fake_bold.diff qt4-x11-4.6.2/debian/patches/kubuntu_09_use_ft_glyph_embolden_to_fake_bold.diff --- qt4-x11-4.6.2/debian/patches/kubuntu_09_use_ft_glyph_embolden_to_fake_bold.diff +++ qt4-x11-4.6.2/debian/patches/kubuntu_09_use_ft_glyph_embolden_to_fake_bold.diff @@ -1,7 +1,7 @@ -Index: qt4-x11-4.6.1/src/gui/text/qfontdatabase_x11.cpp +Index: qt4-x11-4.6.2/src/gui/text/qfontdatabase_x11.cpp =================================================================== ---- qt4-x11-4.6.1.orig/src/gui/text/qfontdatabase_x11.cpp 2010-01-19 19:23:53.000000000 +0100 -+++ qt4-x11-4.6.1/src/gui/text/qfontdatabase_x11.cpp 2010-01-19 19:25:16.000000000 +0100 +--- qt4-x11-4.6.2.orig/src/gui/text/qfontdatabase_x11.cpp 2010-05-21 11:14:57.000000000 +0600 ++++ qt4-x11-4.6.2/src/gui/text/qfontdatabase_x11.cpp 2010-05-21 11:17:04.000000000 +0600 @@ -781,7 +781,11 @@ : ((slant == FC_SLANT_OBLIQUE) ? QFont::StyleOblique @@ -15,20 +15,20 @@ FcBool scalable; if (FcPatternGetBool(pattern, FC_SCALABLE, 0, &scalable) != FcResultMatch) -@@ -1453,6 +1457,9 @@ - else if (request.weight < (QFont::Bold + QFont::Black) / 2) +@@ -1473,6 +1477,9 @@ weight_value = FC_WEIGHT_BOLD; FcPatternAddInteger(pattern, FC_WEIGHT, weight_value); -+ + + if(request.weight == QFont::Bold) + FcPatternAddBool(pattern, FC_EMBOLDEN, true); - ++ int slant_value = FC_SLANT_ROMAN; if (request.style == QFont::StyleItalic) -Index: qt4-x11-4.6.1/src/gui/text/qfontengine_ft.cpp + slant_value = FC_SLANT_ITALIC; +Index: qt4-x11-4.6.2/src/gui/text/qfontengine_ft.cpp =================================================================== ---- qt4-x11-4.6.1.orig/src/gui/text/qfontengine_ft.cpp 2010-01-19 18:51:30.000000000 +0100 -+++ qt4-x11-4.6.1/src/gui/text/qfontengine_ft.cpp 2010-01-19 18:55:52.000000000 +0100 +--- qt4-x11-4.6.2.orig/src/gui/text/qfontengine_ft.cpp 2010-02-11 20:55:22.000000000 +0500 ++++ qt4-x11-4.6.2/src/gui/text/qfontengine_ft.cpp 2010-05-21 11:17:14.000000000 +0600 @@ -62,6 +62,11 @@ #include FT_TYPE1_TABLES_H #include FT_GLYPH_H @@ -58,76 +58,32 @@ { defaultFormat = format; this->antialias = antialias; -@@ -656,7 +662,8 @@ - glyphFormat = QFontEngineGlyphCache::Raster_A8; +@@ -657,6 +663,7 @@ else if (format == Format_A32) glyphFormat = QFontEngineGlyphCache::Raster_RGBMask; -- -+ + + this->embolden = embolden; face_id = faceId; freetype = QFreetypeFace::getFace(face_id); if (!freetype) { -@@ -935,7 +942,48 @@ +@@ -935,7 +942,6 @@ FT_GlyphSlot slot = face->glyph; FT_Library library = qt_getFreetype(); - -+ if(embolden && (face->style_flags & FT_STYLE_FLAG_BOLD) == 0) { -+ //if not antialias and no bitmap, for example, dongwensong English characters. -+ //for DongWenSong Chinese character, if it not antialias, it will use bitmap output. -+ if(!antialias && slot->format == FT_GLYPH_FORMAT_OUTLINE) { -+ int left = slot->metrics.horiBearingX; -+ int right = slot->metrics.horiBearingX + slot->metrics.width; -+ int top = slot->metrics.horiBearingY; -+ int bottom = slot->metrics.horiBearingY - slot->metrics.height; -+ int hpixels = TRUNC(right - left)+4; -+ if (hsubpixel) -+ hpixels = hpixels*3 + 8; -+ int width = hpixels; -+ int height = TRUNC(top - bottom); -+ if (hsubpixel) -+ width /= 3; -+ int pitch = (format == Format_Mono ? ((width + 31) & ~31) >> 3 : -+ (format == Format_A8 ? (width + 3) & ~3 : width * 4)); -+ int size = pitch * height; -+ uchar *glyph_buffer = new uchar[size]; -+ slot->bitmap.rows = height*vfactor; -+ slot->bitmap.width = hpixels; -+ slot->bitmap.pitch = format == Format_Mono ? (((width + 31) & ~31) >> 3) : ((slot->bitmap.width + 3) & ~3); -+ slot->bitmap.buffer = new uchar[slot->bitmap.rows*slot->bitmap.pitch]; -+ if (!hsubpixel && vfactor == 1) -+ slot->bitmap.buffer = glyph_buffer; -+ else -+ slot->bitmap.buffer = new uchar[slot->bitmap.rows*slot->bitmap.pitch]; -+ memset(slot->bitmap.buffer, 0, slot->bitmap.rows*slot->bitmap.pitch); -+ slot->bitmap.pixel_mode = ft_pixel_mode_mono; -+ FT_Matrix matrix; -+ matrix.xx = (hsubpixel ? 3 : 1) << 16; -+ matrix.yy = vfactor << 16; -+ matrix.yx = matrix.xy = 0; -+ FT_Outline_Transform(&slot->outline, &matrix); -+ FT_Outline_Translate(&slot->outline, (hsubpixel ? -3*left +(4<<6) : -left), -bottom*vfactor); -+ FT_Outline_Get_Bitmap(library, &slot->outline, &slot->bitmap); -+ slot->format = FT_GLYPH_FORMAT_BITMAP; -+ FT_GlyphSlot_Embolden(slot); -+ } -+ else -+ FT_GlyphSlot_Embolden(slot); -+ } info.xOff = TRUNC(ROUND(slot->advance.x)); info.yOff = 0; -@@ -1016,6 +1064,8 @@ - top = CEIL(top); +@@ -1062,6 +1068,8 @@ - int hpixels = TRUNC(right - left); -+ if(!antialias && embolden && (face->style_flags & FT_STYLE_FLAG_BOLD) == 0 && transform) -+ hpixels += 4; - if (hsubpixel) - hpixels = hpixels*3 + 8; - info.width = hpixels; -@@ -1526,6 +1576,8 @@ + FT_Outline_Transform(&slot->outline, &matrix); + FT_Outline_Translate (&slot->outline, (hsubpixel ? -3*left +(4<<6) : -left), -bottom*vfactor); ++ if (embolden) ++ FT_Outline_Embolden(&slot->outline, 25); + FT_Outline_Get_Bitmap(library, &slot->outline, &bitmap); + if (hsubpixel) { + Q_ASSERT (bitmap.pixel_mode == FT_PIXEL_MODE_GRAY); +@@ -1526,6 +1534,8 @@ FT_GlyphSlot g = face->glyph; if (g->format != FT_GLYPH_FORMAT_OUTLINE) continue; @@ -136,10 +92,10 @@ QFreetypeFace::addGlyphToPath(face, g, positions[gl], path, xsize, ysize); } unlockFace(); -Index: qt4-x11-4.6.1/src/gui/text/qfontengine_ft_p.h +Index: qt4-x11-4.6.2/src/gui/text/qfontengine_ft_p.h =================================================================== ---- qt4-x11-4.6.1.orig/src/gui/text/qfontengine_ft_p.h 2010-01-19 18:56:31.000000000 +0100 -+++ qt4-x11-4.6.1/src/gui/text/qfontengine_ft_p.h 2010-01-19 18:57:12.000000000 +0100 +--- qt4-x11-4.6.2.orig/src/gui/text/qfontengine_ft_p.h 2010-02-11 20:55:22.000000000 +0500 ++++ qt4-x11-4.6.2/src/gui/text/qfontengine_ft_p.h 2010-05-21 11:14:57.000000000 +0600 @@ -264,7 +264,7 @@ QFontEngineFT(const QFontDef &fd); virtual ~QFontEngineFT(); @@ -157,10 +113,10 @@ SubpixelAntialiasingType subpixelType; int lcdFilterType; bool canUploadGlyphsToServer; -Index: qt4-x11-4.6.1/src/gui/text/qfontengine_x11.cpp +Index: qt4-x11-4.6.2/src/gui/text/qfontengine_x11.cpp =================================================================== ---- qt4-x11-4.6.1.orig/src/gui/text/qfontengine_x11.cpp 2010-01-19 18:57:20.000000000 +0100 -+++ qt4-x11-4.6.1/src/gui/text/qfontengine_x11.cpp 2010-01-19 19:04:03.000000000 +0100 +--- qt4-x11-4.6.2.orig/src/gui/text/qfontengine_x11.cpp 2010-02-11 20:55:22.000000000 +0500 ++++ qt4-x11-4.6.2/src/gui/text/qfontengine_x11.cpp 2010-05-21 11:16:56.000000000 +0600 @@ -966,7 +966,7 @@ @@ -175,7 +131,7 @@ if (FcPatternGetBool(pattern, FC_ANTIALIAS, 0, &b) == FcResultMatch) *antialias = b; + if (FcPatternGetBool(pattern, FC_EMBOLDEN, 0, &b) == FcResultMatch) -+ *embolden = b; ++ *embolden = b; }