Hello community, here is the log from the commit of package xorg-x11-libs checked in at Sun Aug 6 22:09:01 CEST 2006. -------- --- xorg-x11-libs/xorg-x11-libs.changes 2006-08-02 10:55:58.000000000 +0200 +++ xorg-x11-libs/xorg-x11-libs.changes 2006-08-06 17:28:05.000000000 +0200 @@ -1,0 +2,8 @@ +Sat Aug 5 22:47:55 CEST 2006 - sndirsch@suse.de + +- p_xft_cjk.diff: + * adds fake bold support to Xft library (Bug #38202) +- p_xft_register.diff: + * new fontconfig objects needs to be registered first (Bug #141216) + +------------------------------------------------------------------- New: ---- p_xft_cjk.diff p_xft_register.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ xorg-x11-libs.spec ++++++ --- /var/tmp/diff_new_pack.FEzduT/_old 2006-08-06 22:08:43.000000000 +0200 +++ /var/tmp/diff_new_pack.FEzduT/_new 2006-08-06 22:08:43.000000000 +0200 @@ -15,11 +15,11 @@ Provides: libXaw.so.8 libXaw.so.7 libXaw.so.6 URL: http://xorg.freedesktop.org/ Version: 7.1 -Release: 7 +Release: 8 License: X11/MIT BuildRoot: %{_tmppath}/%{name}-%{version}-build Group: System/Libraries -Summary: X Window System shared libraries +Summary: Remaining X.Org libraries Source0: libAppleWM-X11R7.0-1.0.0.tar.bz2 Source1: libFS-X11R7.0-1.0.0.tar.bz2 Source2: libWindowsWM-X11R7.0-1.0.0.tar.bz2 @@ -50,13 +50,12 @@ Source27: libXres-X11R7.1-1.0.1.tar.bz2 Patch1: libXcursor.diff Patch2: libXfont-pcfread.diff +Patch3: p_xft_cjk.diff +Patch4: p_xft_register.diff %description -Since some programs were linked with the X Window System libraries, but -do work on a text console as well (emacs for example), we have put the -X Window System dynamic libraries into an extra package so that you can -use these programs without installing the entire X Window System. +This package contains the remaining X.Org libraries. @@ -110,7 +109,7 @@ Jim Gettys %package -n xorg-x11-devel -Summary: Include Files and Libraries mandatory for Development +Summary: Include Files and Libraries mandatory for X11 Development. Group: Development/Libraries/X11 Provides: xorg-x11-compat70-devel xorg-x11-man XFree86-devel Obsoletes: xorg-x11-compat70-devel xorg-x11-man @@ -119,7 +118,7 @@ %description -n xorg-x11-devel This package contains all necessary include files and libraries needed -to develop applications that require these. +to develop X11 applications that require these. @@ -182,6 +181,10 @@ pushd libXfont-* %patch2 -p1 popd +pushd libXft-*/src +%patch3 -p2 +%patch4 -p3 +popd %build for dir in xbitmaps-* $(ls | grep -v xbitmaps); do @@ -237,6 +240,11 @@ %{_mandir}/man3/* %changelog -n xorg-x11-libs +* Sat Aug 05 2006 - sndirsch@suse.de +- p_xft_cjk.diff: + * adds fake bold support to Xft library (Bug #38202) +- p_xft_register.diff: + * new fontconfig objects needs to be registered first (Bug #141216) * Wed Aug 02 2006 - sndirsch@suse.de - added /usr/include/X11/pixmaps/ to filelist * Mon Jul 31 2006 - sndirsch@suse.de ++++++ p_xft_cjk.diff ++++++ diff -u -r ../libXft-2.1.10.orig/src/xftfreetype.c ./src/xftfreetype.c --- ../libXft-2.1.10.orig/src/xftfreetype.c 2006-06-03 12:30:56.000000000 +0200 +++ ./src/xftfreetype.c 2006-08-05 20:58:43.000000000 +0200 @@ -387,6 +387,7 @@ FcChar32 hash, *hashp; FT_Face face; int nhash; + FcBool bitmap; if (!info) return FcFalse; @@ -509,8 +510,22 @@ */ fi->load_flags = FT_LOAD_DEFAULT; +#ifndef XFT_EMBEDDED_BITMAP +#define XFT_EMBEDDED_BITMAP "embeddedbitmap" +#endif + + switch (FcPatternGetBool (pattern, XFT_EMBEDDED_BITMAP, 0, &bitmap)) { + case FcResultNoMatch: + bitmap = FcFalse; + break; + case FcResultMatch: + break; + default: + goto bail1; + } + /* disable bitmaps when anti-aliasing or transforming glyphs */ - if (fi->antialias || fi->transform) + if ((!bitmap && fi->antialias) || fi->transform) fi->load_flags |= FT_LOAD_NO_BITMAP; /* disable hinting if requested */ @@ -680,6 +695,19 @@ default: goto bail1; } + + /* + * Check for weight + */ + switch (FcPatternGetInteger (pattern, FC_WEIGHT, 0, &fi->weight_value)) { + case FcResultNoMatch: + fi->weight_value = FC_WEIGHT_MEDIUM; + break; + case FcResultMatch: + break; + default: + goto bail1; + } /* * Step over hash value in the structure @@ -991,6 +1019,54 @@ font->max_glyph_memory = max_glyph_memory; font->use_free_glyphs = info->use_free_glyphs; + /* + * Extra bitmap strokes + */ + font->extra_strokes = 0; + font->extra_advanceX = 0; + if (fi->weight_value >= FC_WEIGHT_DEMIBOLD && + (face->style_flags & FT_STYLE_FLAG_BOLD) == 0) + { + font->extra_strokes = + 32 + FT_MulDiv (fi->xsize, fi->weight_value - 160, 1600); + + if (fi->weight_value >= FC_WEIGHT_BOLD) + font->extra_advanceX = + (font->extra_strokes > 64)? font->extra_strokes : 64; + } + + /* + * CJK fixed widths fields + */ + font->long_advance.x = 0; + font->long_advance.y = 0; + font->short_advance.x = 0; + font->short_advance.y = 0; + if (font->info.spacing == FC_MONO && fi->char_width == 0 && + (fi->load_flags & FT_LOAD_VERTICAL_LAYOUT) == 0 && + (fi->load_flags & FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH) != 0) + { + if (!FT_Select_Charmap (face, ft_encoding_unicode)) + { + font->long_advance.x = + face->size->metrics.max_advance + font->extra_advanceX; + if (fi->transform) + FT_Vector_Transform (&font->long_advance, &fi->matrix); + font->long_advance.x = (font->long_advance.x + 32) >> 6; + font->long_advance.y = (font->long_advance.y + 32) >> 6; + + if (font->long_advance.x > 0) + font->short_advance.x = (font->long_advance.x + 1) >> 1; + else + font->short_advance.x = font->long_advance.x >> 1; + + if (font->long_advance.y > 0) + font->short_advance.y = (font->long_advance.y + 1) >> 1; + else + font->short_advance.y = font->long_advance.y >> 1; + } + } + _XftUnlockFile (fi->file); return &font->public; diff -u -r ../libXft-2.1.10.orig/src/xftglyphs.c ./src/xftglyphs.c --- ../libXft-2.1.10.orig/src/xftglyphs.c 2006-06-03 12:30:56.000000000 +0200 +++ ./src/xftglyphs.c 2006-08-05 20:58:43.000000000 +0200 @@ -219,6 +219,7 @@ bottom = FLOOR( glyphslot->metrics.horiBearingY - glyphslot->metrics.height ); } + right += CEIL(font->extra_strokes); width = TRUNC(right - left); height = TRUNC( top - bottom ); @@ -226,7 +227,8 @@ * Clip charcell glyphs to the bounding box * XXX transformed? */ - if (font->info.spacing >= FC_CHARCELL && !font->info.transform) + if (font->info.spacing >= FC_CHARCELL && !font->info.transform && + font->long_advance.x == 0 && font->long_advance.y == 0) { if (font->info.load_flags & FT_LOAD_VERTICAL_LAYOUT) { @@ -267,12 +269,26 @@ xftg->metrics.width = width; xftg->metrics.height = height; - xftg->metrics.x = -TRUNC(left); + xftg->metrics.x = -TRUNC(left) + TRUNC((font->extra_strokes +32) * 1/2); xftg->metrics.y = TRUNC(top); if (font->info.spacing >= FC_MONO) { - if (font->info.transform) + if (font->long_advance.x != 0 || font->long_advance.y != 0) + { + if (glyphslot->metrics.horiAdvance > + face->size->metrics.max_advance * 3/4) + { + xftg->metrics.xOff = font->long_advance.x; + xftg->metrics.yOff = -font->long_advance.y; + } + else + { + xftg->metrics.xOff = font->short_advance.x; + xftg->metrics.yOff = -font->short_advance.y; + } + } + else if (font->info.transform) { if (font->info.load_flags & FT_LOAD_VERTICAL_LAYOUT) { @@ -304,6 +320,15 @@ } else { + if (font->extra_advanceX > 0 && + (font->info.load_flags & FT_LOAD_VERTICAL_LAYOUT) == 0) + { + glyphslot->advance.x = + glyphslot->metrics.horiAdvance + font->extra_advanceX; + glyphslot->advance.y = 0; + if (font->info.transform) + FT_Vector_Transform (&glyphslot->advance, &font->info.matrix); + } xftg->metrics.xOff = TRUNC(ROUND(glyphslot->advance.x)); xftg->metrics.yOff = -TRUNC(ROUND(glyphslot->advance.y)); } @@ -406,6 +431,53 @@ continue; } + if (font->extra_strokes > 0) + { + int extra = font->extra_strokes; + int degree; + int i, h, g, d, k; + + if (glyphslot->format == ft_glyph_format_bitmap) + extra += 8; + extra *= hmul; + degree = TRUNC(CEIL(extra)); + + for (i = 0; i < degree; i++) + { + d = (i == 0)? (extra % 64) : 64; + if (d == 0) + d = 64; + for (h = 0; h < height; h++) + { + unsigned char *pos = bufBitmap + h * pitch; + k = pitch; + if (font->info.antialias) + { + if (i > 0) + while (--k > 0) + pos[k] = (pos[k] > pos[k - 1])? pos[k] : pos[k - 1]; + else + { + while (--k > 0) + { + g = pos[k]; + g += d * ((pos[k - 1] > 0)? pos[k - 1]/64 : g/128); + pos[k] = (g > 0xff)? 0xff : g; + } + g = pos[0] + pos[0] * d / 128; + pos[0] = (g > 0xff)? 0xff : g; + } + } + else + { + while (--k > 0) + pos[k] = pos[k] | (pos[k] >> 1) | (pos[k - 1] << 7); + pos[0] = pos[0] | (pos[0] >> 1); + } + } + } + } + if (XftDebug() & XFT_DBG_GLYPH) { printf ("glyph %d:\n", (int) glyphindex); diff -u -r ../libXft-2.1.10.orig/src/xftint.h ./src/xftint.h --- ../libXft-2.1.10.orig/src/xftint.h 2006-06-06 18:35:37.000000000 +0200 +++ ./src/xftint.h 2006-08-05 20:58:43.000000000 +0200 @@ -157,6 +157,7 @@ int spacing; FcBool minspace; int char_width; + int weight_value; }; /* @@ -193,6 +194,16 @@ unsigned long glyph_memory; unsigned long max_glyph_memory; FcBool use_free_glyphs; /* Use XRenderFreeGlyphs */ + /* + * CJK fixed widths infomation + */ + FT_Vector long_advance; + FT_Vector short_advance; + /* + * Extra bitmap strokes + */ + int extra_strokes; + int extra_advanceX; } XftFontInt; typedef enum _XftClipType { diff -u -r ../libXft-2.1.10.orig/src/xftname.c ./src/xftname.c --- ../libXft-2.1.10.orig/src/xftname.c 2006-06-06 18:34:54.000000000 +0200 +++ ./src/xftname.c 2006-08-05 20:59:52.000000000 +0200 @@ -32,7 +32,7 @@ #define NUM_OBJECT_TYPES (sizeof _XftObjectTypes / sizeof _XftObjectTypes[0]) -_X_HIDDEN FcBool _XftNameInitialized; +_X_HIDDEN FcBool _XftNameInitialized = FcFalse; _X_HIDDEN void _XftNameInit (void) ++++++ p_xft_register.diff ++++++ diff -ru xc.orig/lib/Xft/xftname.c xc/lib/Xft/xftname.c --- xc.orig/lib/Xft/xftname.c 2005-11-30 11:34:57.000000000 +0100 +++ xc/lib/Xft/xftname.c 2006-01-03 11:27:05.000000000 +0100 @@ -28,6 +28,7 @@ { XFT_CORE, FcTypeBool, }, { XFT_XLFD, FcTypeString, }, { XFT_RENDER, FcTypeBool, }, + { XFT_MAX_GLYPH_MEMORY, FcTypeInteger, }, }; #define NUM_OBJECT_TYPES (sizeof _XftObjectTypes / sizeof _XftObjectTypes[0]) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun...