[sfnt] Fix `OS/2' table version 5 support. We now follow the `official' announcement from Microsoft (on the OpenType mailing list, which unfortunately hasn't a public archive). * include/freetype/tttables.h (TT_OS2): s/usLowerPointSize/usLowerOpticalPointSize/, s/usUpperPointSize/usUpperOpticalPointSize/. * src/sfnt/ttload.c (tt_face_load_os2): Update, and set correct default values.
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
diff --git a/ChangeLog b/ChangeLog
index dcbc16b..b358116 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2013-11-16 Werner Lemberg <wl@gnu.org>
+
+ [sfnt] Fix `OS/2' table version 5 support.
+
+ We now follow the `official' announcement from Microsoft (on the
+ OpenType mailing list, which unfortunately hasn't a public archive).
+
+ * include/freetype/tttables.h (TT_OS2):
+ s/usLowerPointSize/usLowerOpticalPointSize/,
+ s/usUpperPointSize/usUpperOpticalPointSize/.
+
+ * src/sfnt/ttload.c (tt_face_load_os2): Update, and set correct
+ default values.
+
2013-11-13 Werner Lemberg <wl@gnu.org>
* builds/unix/ft2unix.h: Remove. No longer necessary.
diff --git a/include/tttables.h b/include/tttables.h
index a2077be..bb49dc0 100644
--- a/include/tttables.h
+++ b/include/tttables.h
@@ -398,8 +398,8 @@ FT_BEGIN_HEADER
/* only version 5 and higher: */
- FT_UShort usLowerPointSize; /* in twips (1/20th points) */
- FT_UShort usUpperPointSize; /* in twips (1/20th points) */
+ FT_UShort usLowerOpticalPointSize; /* in twips (1/20th points) */
+ FT_UShort usUpperOpticalPointSize; /* in twips (1/20th points) */
} TT_OS2;
diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c
index af9e311..0a3cd29 100644
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -1028,8 +1028,8 @@
static const FT_Frame_Field os2_fields_extra5[] =
{
FT_FRAME_START( 4 ),
- FT_FRAME_USHORT( usLowerPointSize ),
- FT_FRAME_USHORT( usUpperPointSize ),
+ FT_FRAME_USHORT( usLowerOpticalPointSize ),
+ FT_FRAME_USHORT( usUpperOpticalPointSize ),
FT_FRAME_END
};
@@ -1046,15 +1046,15 @@
if ( FT_STREAM_READ_FIELDS( os2_fields, os2 ) )
goto Exit;
- os2->ulCodePageRange1 = 0;
- os2->ulCodePageRange2 = 0;
- os2->sxHeight = 0;
- os2->sCapHeight = 0;
- os2->usDefaultChar = 0;
- os2->usBreakChar = 0;
- os2->usMaxContext = 0;
- os2->usLowerPointSize = 0;
- os2->usUpperPointSize = 0;
+ os2->ulCodePageRange1 = 0;
+ os2->ulCodePageRange2 = 0;
+ os2->sxHeight = 0;
+ os2->sCapHeight = 0;
+ os2->usDefaultChar = 0;
+ os2->usBreakChar = 0;
+ os2->usMaxContext = 0;
+ os2->usLowerOpticalPointSize = 0;
+ os2->usUpperOpticalPointSize = 0xFFFF;
if ( os2->version >= 0x0001 )
{