* src/winfonts/winfnt.c (FNT_Face_Init): Set x_ppem and y_ppem based on pixel_width and pixel_height. (FNT_Size_Set_Pixels): Updated.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
diff --git a/ChangeLog b/ChangeLog
index 6931201..5dbb153 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-06-14 Huw D M Davies <h.davies1@physics.ox.ac.uk>
+
+ * src/winfonts/winfnt.c (FNT_Face_Init): Set x_ppem and y_ppem
+ based on pixel_width and pixel_height.
+ (FNT_Size_Set_Pixels): Updated.
+
2004-06-14 Werner Lemberg <wl@gnu.org>
* src/lzw/zopen.c: Comment out inclusion of signal.h and unistd.h.
@@ -658,8 +664,8 @@
Handle broken FNT files which don't have a trailing NULL byte
in the face name string.
- * src/winfnt/winfnt.h (FNT_FontRec): New member `family_name'.
- * src/winfnt/winfnt.c (fnt_font_done): Free font->family_name.
+ * src/winfonts/winfnt.h (FNT_FontRec): New member `family_name'.
+ * src/winfonts/winfnt.c (fnt_font_done): Free font->family_name.
(FNT_Face_Init): Append a final zero byte to the font face name.
2004-03-30 Werner Lemberg <wl@gnu.org>
@@ -7449,7 +7455,7 @@
(tt_driver_class): Add it.
* src/type1/t1driver.c (Get_Next_Char): New function.
(t1_driver_class): Add it.
- * src/winfnt/winfnt.c (FNT_Get_Next_Char): New function.
+ * src/winfonts/winfnt.c (FNT_Get_Next_Char): New function.
(winfnt_driver_class): Add it.
* src/pcf/pcfread.c (pcf_load_font): For now, report Unicode for
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index a77e004..80a3b63 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -271,10 +271,10 @@ FT_BEGIN_HEADER
/* where `size' is in points. */
/* */
/* Windows FNT: */
- /* The `size', `x_ppem', and `y_ppem' parameters are not reliable: */
- /* There exist fonts (e.g. app850.fon) which have a wrong size for */
- /* some subfonts; since FNT files don't contain ppem but dpi values */
- /* the computed x_ppem and y_ppem numbers are thus wrong also. */
+ /* The `size' parameter is not reliable: There exist fonts (e.g., */
+ /* app850.fon) which have a wrong size for some subfonts; x_ppem */
+ /* and y_ppem are thus set equal to pixel width and height given in */
+ /* in the Windows FNT header. */
/* */
/* TrueType embedded bitmaps: */
/* `size', `width', and `height' values are not contained in the */
diff --git a/src/winfonts/winfnt.c b/src/winfonts/winfnt.c
index 66ceef7..92174ae 100644
--- a/src/winfonts/winfnt.c
+++ b/src/winfonts/winfnt.c
@@ -466,12 +466,8 @@
bsize->height = (FT_Short)(
font->header.pixel_height + font->header.external_leading );
bsize->size = font->header.nominal_point_size << 6;
- bsize->x_ppem =
- (FT_Pos)( ( font->header.horizontal_resolution * bsize->size + 36 )
- / 72 );
- bsize->y_ppem =
- (FT_Pos)( ( font->header.vertical_resolution* bsize->size + 36 )
- / 72 );
+ bsize->x_ppem = font->header.pixel_width << 6;
+ bsize->y_ppem = font->header.pixel_height << 6;
}
{
@@ -553,7 +549,7 @@
FT_Face root = FT_FACE( face );
- if ( size->metrics.y_ppem == root->available_sizes->height )
+ if ( size->metrics.y_ppem == root->available_sizes->y_ppem >> 6 )
{
FNT_Font font = face->font;