From bc25de66c112a9ff4722264330ada77b6e651408 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Sat, 16 Nov 2013 07:52:20 +0100 Subject: [PATCH] [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. --- ChangeLog | 14 ++++++++++++++ include/tttables.h | 4 ++-- src/sfnt/ttload.c | 22 +++++++++++----------- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index dcbc16b8b..b358116f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2013-11-16 Werner Lemberg + + [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 * builds/unix/ft2unix.h: Remove. No longer necessary. diff --git a/include/tttables.h b/include/tttables.h index a2077be1a..bb49dc0da 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 af9e311d8..0a3cd29db 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 ) {