diff options
author | Egbert Eich <eich@suse.de> | 2004-03-23 18:34:40 +0000 |
---|---|---|
committer | Egbert Eich <eich@suse.de> | 2004-03-23 18:34:40 +0000 |
commit | c5dfd171ed278ea020289ef5dd1bf282f7b8c3c9 (patch) | |
tree | 4db22f0a4ff0761e5013f9467e9b94d9b8fb799e | |
parent | b8724c4b62876397a17265abe2edc3525588fc25 (diff) | |
download | xorg-lib-libXft-c5dfd171ed278ea020289ef5dd1bf282f7b8c3c9.tar.gz |
20. Moving Xft update to RELEASE-1 (Egbert Eich).
-rw-r--r-- | include/X11/Xft/Xft.h | 2 | ||||
-rw-r--r-- | src/xftfreetype.c | 53 |
2 files changed, 22 insertions, 33 deletions
diff --git a/include/X11/Xft/Xft.h b/include/X11/Xft/Xft.h index 1c67265..d495b58 100644 --- a/include/X11/Xft/Xft.h +++ b/include/X11/Xft/Xft.h @@ -33,7 +33,7 @@ #define XFT_MAJOR 2 #define XFT_MINOR 1 -#define XFT_REVISION 6 +#define XFT_REVISION 5 #define XFT_VERSION ((XFT_MAJOR * 10000) + (XFT_MINOR * 100) + (XFT_REVISION)) #define XftVersion XFT_VERSION diff --git a/src/xftfreetype.c b/src/xftfreetype.c index 1a52c21..d6285b4 100644 --- a/src/xftfreetype.c +++ b/src/xftfreetype.c @@ -182,14 +182,6 @@ _XftUnlockFile (XftFtFile *f) _XftLockError ("too many file unlocks"); } -#if HAVE_FT_BITMAP_SIZE_Y_PPEM -#define X_SIZE(face,i) ((face)->available_sizes[i].x_ppem) -#define Y_SIZE(face,i) ((face)->available_sizes[i].y_ppem) -#else -#define X_SIZE(face,i) ((face)->available_sizes[i].width << 6) -#define Y_SIZE(face,i) ((face)->available_sizes[i].height << 6) -#endif - FcBool _XftSetFace (XftFtFile *f, FT_F26Dot6 xsize, FT_F26Dot6 ysize, FT_Matrix *matrix) { @@ -206,42 +198,39 @@ _XftSetFace (XftFtFile *f, FT_F26Dot6 xsize, FT_F26Dot6 ysize, FT_Matrix *matrix */ if (!(face->face_flags & FT_FACE_FLAG_SCALABLE)) { - int i, best = 0; + FT_Short width = xsize >> 6; + FT_Short height = ysize >> 6; + int i, best = -1; #define xft_abs(a) ((a) < 0 ? -(a) : (a)) #define dist(a,b) (xft_abs((a)-(b))) - for (i = 1; i < face->num_fixed_sizes; i++) +#if !HAVE_FT_BITMAP_SIZE_Y_PPEM +#define y_ppem height +#define x_ppem width +#endif + for (i = 0; i < face->num_fixed_sizes; i++) { - if (dist (ysize, Y_SIZE(face,i)) < - dist (ysize, Y_SIZE(face, best)) || - (dist (ysize, Y_SIZE(face, i)) == - dist (ysize, Y_SIZE(face, best)) && - dist (xsize, X_SIZE(face, i)) < - dist (xsize, X_SIZE(face, best)))) + if (best == -1 || + dist (height, face->available_sizes[i].y_ppem >> 6) < + dist (height, face->available_sizes[best].y_ppem >> 6) || + (dist (height, face->available_sizes[i].y_ppem >> 6) == + dist (height, face->available_sizes[best].y_ppem >> 6) && + dist (width, face->available_sizes[i].x_ppem >> 6) < + dist (width, face->available_sizes[best].x_ppem >> 6))) { best = i; } } - /* - * Freetype 2.1.7 and earlier used width/height - * for matching sizes in the BDF and PCF loaders. - * This has been fixed for 2.1.8. Because BDF and PCF - * files have but a single strike per file, we can - * simply try both sizes. - */ - if ( -#if HAVE_FT_BITMAP_SIZE_Y_PPEM - FT_Set_Char_Size (face, face->available_sizes[best].x_ppem, - face->available_sizes[best].y_ppem, 0, 0) != 0 - && -#endif - FT_Set_Char_Size (face, face->available_sizes[best].width << 6, - face->available_sizes[best].height << 6, - 0, 0) != 0) + if (FT_Set_Char_Size (face, face->available_sizes[best].x_ppem, + face->available_sizes[best].y_ppem, 0, 0) != 0) { return False; } +#if !HAVE_FT_BITMAP_SIZE_Y_PPEM +#undef y_ppem +#undef x_ppem +#endif } else { |