* src/sfnt/ttcmap.c: 16bit fixes (0xFFFF -> 0xFFFFU).
* src/sfnt/ttcmap0.c: 16bit fixes. (TT_Build_CMaps): Simplify debug messages. (tt_cmap12_char_next): Fix offset. * src/sfnt/ttload.c (TT_Load_Names, TT_Load_CMap): Fix debug messages. (TT_Load_OS2): 16bit fix.
This commit is contained in:
parent
545a75fdd7
commit
b7b163cb07
15
ChangeLog
15
ChangeLog
|
@ -6,12 +6,23 @@
|
|||
|
||||
* src/otlayout/otlcommn.c, src/otlayout/otlcommn.h: s/index/idx/.
|
||||
* src/psaux/t1cmap.c: Ditto.
|
||||
* src/sfnt/ttcmap0.c: Ditto.
|
||||
|
||||
* include/freetype/internal/tttypes.h,
|
||||
include/freetype/internal/sfnt.h (TT_Goto_Table_Func): Renamed to ...
|
||||
(TT_Loader_GotoTableFunc): This.
|
||||
* src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Fix debug
|
||||
messages.
|
||||
* src/psnames/psmodule.c (psnames_interface)
|
||||
[!FT_CONFIG_OPTION_ADOBE_GLYPH_LIST]: Fix typo.
|
||||
* src/sfnt/sfdriver.c (get_sfnt_table): 16bit fix.
|
||||
* src/sfnt/ttcmap.c: 16bit fixes (0xFFFF -> 0xFFFFU).
|
||||
* src/sfnt/ttcmap0.c: 16bit fixes.
|
||||
(TT_Build_CMaps): Simplify debug messages.
|
||||
(tt_cmap12_char_next): Fix offset.
|
||||
* src/sfnt/ttload.c (TT_Load_Names, TT_Load_CMap): Fix debug
|
||||
messages.
|
||||
(TT_Load_OS2): 16bit fix.
|
||||
|
||||
2002-03-30 David Turner <david@freetype.org>
|
||||
|
||||
|
@ -439,8 +450,8 @@
|
|||
* src/type1/t1cmap.h, src/type1/t1cmap.c: Adding (still
|
||||
experimental) code for Type 1 charmap processing.
|
||||
|
||||
* src/sfnt/ttcmap0.c: Completing the experimental SFNT charmap
|
||||
processing.
|
||||
* src/sfnt/ttcmap0.c: New file. It contains a new, still
|
||||
experimental SFNT charmap processing support.
|
||||
|
||||
* include/freetype/internal/ftobjs.h: Adding validation support as
|
||||
well as internal charmap object definitions (FT_CMap != FT_CharMap).
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
|
||||
|
||||
# Copyright 2001 by
|
||||
# Copyright 2001, 2002 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* PostScript hinting algorithm 1 (body). */
|
||||
/* */
|
||||
/* Copyright 2001 by */
|
||||
/* Copyright 2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* PostScript hinting algorithm 2 (body). */
|
||||
/* */
|
||||
/* Copyright 2001 by */
|
||||
/* Copyright 2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used */
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
/* PostScript hinter global hinting management (body). */
|
||||
/* Inspired by the new auto-hinter module. */
|
||||
/* */
|
||||
/* Copyright 2001 by */
|
||||
/* Copyright 2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* PostScript hinter global hinting management. */
|
||||
/* */
|
||||
/* Copyright 2001 by */
|
||||
/* Copyright 2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType PostScript hinter module implementation (body). */
|
||||
/* */
|
||||
/* Copyright 2001 by */
|
||||
/* Copyright 2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* FreeType PostScript hints recorder (body). */
|
||||
/* */
|
||||
/* Copyright 2001 by */
|
||||
/* Copyright 2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Postscript (Type1/Type2) hints recorder (specification). */
|
||||
/* */
|
||||
/* Copyright 2001 by */
|
||||
/* Copyright 2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
|
||||
|
||||
# Copyright 2001 by
|
||||
# Copyright 2001, 2002 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* PSNames module implementation (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -314,7 +314,6 @@
|
|||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
|
||||
|
||||
# Copyright 1996-2000 by
|
||||
# Copyright 1996-2000, 2001 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* The FreeType glyph rasterizer (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* The FreeType glyph rasterizer interface (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
|
||||
|
||||
# Copyright 1996-2000 by
|
||||
# Copyright 1996-2000, 2001 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# FreeType 2 src/sfnt Jamfile (c) 2001 David Turner
|
||||
# FreeType 2 src/sfnt Jamfile (c) 2001, 2002 David Turner
|
||||
#
|
||||
|
||||
SubDir FT2_TOP src sfnt ;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
|
||||
|
||||
# Copyright 2001 by
|
||||
# Copyright 2001, 2002 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
|
||||
|
||||
# Copyright 1996-2000 by
|
||||
# Copyright 1996-2000, 2002 by
|
||||
# David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||
#
|
||||
# This file is part of the FreeType project, and may only be used, modified,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* High-level SFNT driver interface (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -58,7 +58,7 @@
|
|||
break;
|
||||
|
||||
case ft_sfnt_os2:
|
||||
table = face->os2.version == 0xFFFF ? 0 : &face->os2;
|
||||
table = face->os2.version == 0xFFFFU ? 0 : &face->os2;
|
||||
break;
|
||||
|
||||
case ft_sfnt_post:
|
||||
|
@ -153,11 +153,13 @@
|
|||
FT_UInt len = name->stringLength / 2;
|
||||
FT_Error error;
|
||||
|
||||
|
||||
if ( !FT_ALLOC( result, len + 1 ) )
|
||||
{
|
||||
FT_String* r = (FT_String*)result;
|
||||
FT_Byte* p = (FT_Byte*)name->string;
|
||||
|
||||
|
||||
for ( ; len > 0; len--, p += 2 )
|
||||
{
|
||||
if ( p[0] == 0 && p[1] >= 32 && p[1] < 128 )
|
||||
|
@ -175,6 +177,7 @@
|
|||
FT_UInt len = name->stringLength;
|
||||
FT_Error error;
|
||||
|
||||
|
||||
if ( !FT_ALLOC( result, len + 1 ) )
|
||||
{
|
||||
FT_MEM_COPY( (char*)result, name->string, len );
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* Single object library component. */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* SFNT object management (base). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -48,6 +48,7 @@
|
|||
FT_UInt len, code, n;
|
||||
FT_Byte* read = (FT_Byte*)entry->string;
|
||||
|
||||
|
||||
len = (FT_UInt)entry->stringLength / 2;
|
||||
|
||||
if ( FT_MEM_NEW_ARRAY( string, len + 1 ) )
|
||||
|
@ -77,6 +78,7 @@
|
|||
FT_UInt len, code, n;
|
||||
FT_Byte* read = (FT_Byte*)entry->string;
|
||||
|
||||
|
||||
len = (FT_UInt)entry->stringLength / 4;
|
||||
|
||||
if ( FT_MEM_NEW_ARRAY( string, len + 1 ) )
|
||||
|
@ -106,6 +108,7 @@
|
|||
FT_UInt len, code, n;
|
||||
FT_Byte* read = (FT_Byte*)entry->string;
|
||||
|
||||
|
||||
len = (FT_UInt)entry->stringLength;
|
||||
|
||||
if ( FT_MEM_NEW_ARRAY( string, len + 1 ) )
|
||||
|
@ -158,43 +161,37 @@
|
|||
rec = face->name_table.names;
|
||||
for ( n = 0; n < face->name_table.numNameRecords; n++, rec++ )
|
||||
{
|
||||
/* according to the OpenType 1.3 specification, only Microsoft of */
|
||||
/* Apple platform ids might be used in the 'name' table. The */
|
||||
/* 'Unicode' platform is reserved for the 'cmap' table, and */
|
||||
/* the 'Iso' one is deprecated */
|
||||
|
||||
/* however the Apple TrueType specification doesn't says the same */
|
||||
/* thing and goes to suggest that all Unicode 'name' table entries */
|
||||
/* should be coded in UTF-16 (in big-endian format I suppose) */
|
||||
/* According to the OpenType 1.3 specification, only Microsoft or */
|
||||
/* Apple platform IDs might be used in the `name' table. The */
|
||||
/* `Unicode' platform is reserved for the `cmap' table, and the */
|
||||
/* `Iso' one is deprecated. */
|
||||
/* */
|
||||
/* However, the Apple TrueType specification doesn't say the same */
|
||||
/* thing and goes to suggest that all Unicode `name' table entries */
|
||||
/* should be coded in UTF-16 (in big-endian format I suppose). */
|
||||
/* */
|
||||
if ( rec->nameID == nameid && rec->string )
|
||||
{
|
||||
switch ( rec->platformID )
|
||||
{
|
||||
|
||||
case TT_PLATFORM_APPLE_UNICODE:
|
||||
case TT_PLATFORM_ISO:
|
||||
{
|
||||
/* there is 'languageID' to check there. We should use this */
|
||||
/* there is `languageID' to check there. We should use this */
|
||||
/* field only as a last solution when nothing else is */
|
||||
/* available.. */
|
||||
/* available. */
|
||||
/* */
|
||||
found_unicode = n;
|
||||
break;
|
||||
}
|
||||
|
||||
case TT_PLATFORM_MACINTOSH:
|
||||
{
|
||||
if ( rec->languageID == TT_MAC_LANGID_ENGLISH )
|
||||
found_apple = n;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case TT_PLATFORM_MICROSOFT:
|
||||
{
|
||||
/* we only take a non-English name when there is nothing */
|
||||
/* else available in the font.. */
|
||||
/* else available in the font */
|
||||
/* */
|
||||
if ( found_win == -1 || ( rec->languageID & 0x3FF ) == 0x009 )
|
||||
{
|
||||
|
@ -211,7 +208,6 @@
|
|||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
;
|
||||
|
@ -219,9 +215,8 @@
|
|||
}
|
||||
}
|
||||
|
||||
/* some fonts contain invalid Unicode or Macintosh formatted entries */
|
||||
/* we will thus favor name encoded in Windows formats when they're */
|
||||
/* available.. */
|
||||
/* some fonts contain invalid Unicode or Macintosh formatted entries; */
|
||||
/* we will thus favor names encoded in Windows formats if available */
|
||||
/* */
|
||||
if ( found_win >= 0 )
|
||||
{
|
||||
|
@ -230,16 +225,12 @@
|
|||
{
|
||||
case TT_MS_ID_UNICODE_CS:
|
||||
case TT_MS_ID_SYMBOL_CS:
|
||||
{
|
||||
result = tt_name_entry_ascii_from_utf16( rec, memory );
|
||||
break;
|
||||
}
|
||||
|
||||
case TT_MS_ID_UCS_4:
|
||||
{
|
||||
result = tt_name_entry_ascii_from_ucs4( rec, memory );
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
;
|
||||
|
@ -327,6 +318,7 @@
|
|||
FT_UNUSED( num_params );
|
||||
FT_UNUSED( params );
|
||||
|
||||
|
||||
sfnt = (SFNT_Service)face->sfnt;
|
||||
if ( !sfnt )
|
||||
{
|
||||
|
@ -433,7 +425,6 @@
|
|||
(void)LOAD_( max_profile );
|
||||
(void)LOAD_( charmaps );
|
||||
|
||||
|
||||
/* the following tables are optional in PCL fonts -- */
|
||||
/* don't check for errors */
|
||||
(void)LOAD_( names );
|
||||
|
@ -470,6 +461,7 @@
|
|||
else
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
|
||||
|
||||
if ( LOAD_( hdmx ) ||
|
||||
|
@ -478,8 +470,10 @@
|
|||
LOAD_( pclt ) )
|
||||
goto Exit;
|
||||
|
||||
face->root.family_name = tt_face_get_name( face, TT_NAME_ID_FONT_FAMILY );
|
||||
face->root.style_name = tt_face_get_name( face, TT_NAME_ID_FONT_SUBFAMILY );
|
||||
face->root.family_name = tt_face_get_name( face,
|
||||
TT_NAME_ID_FONT_FAMILY );
|
||||
face->root.style_name = tt_face_get_name( face,
|
||||
TT_NAME_ID_FONT_SUBFAMILY );
|
||||
|
||||
/* now set up root fields */
|
||||
{
|
||||
|
@ -563,10 +557,12 @@
|
|||
{
|
||||
FT_Int m;
|
||||
|
||||
|
||||
for ( m = 0; m < root->num_charmaps; m++ )
|
||||
{
|
||||
FT_CharMap charmap = root->charmaps[m];
|
||||
|
||||
|
||||
charmap->encoding = sfnt_find_encoding( charmap->platform_id,
|
||||
charmap->encoding_id );
|
||||
|
||||
|
@ -584,6 +580,7 @@
|
|||
{
|
||||
TT_CharMap charmap = face->charmaps;
|
||||
|
||||
|
||||
charmap = face->charmaps;
|
||||
root->num_charmaps = face->num_charmaps;
|
||||
|
||||
|
@ -622,7 +619,8 @@
|
|||
root->face_flags |= FT_FACE_FLAG_FIXED_SIZES;
|
||||
|
||||
#if 0
|
||||
/* I don't know criteria whether layout is horizontal or vertical */
|
||||
/* XXX: I don't know criteria whether layout is horizontal */
|
||||
/* or vertical. */
|
||||
if ( has_outline.... )
|
||||
{
|
||||
...
|
||||
|
@ -785,6 +783,7 @@
|
|||
{
|
||||
FT_Stream stream = FT_FACE_STREAM( face );
|
||||
|
||||
|
||||
/* simply release the 'cmap' table frame */
|
||||
FT_FRAME_RELEASE( face->cmap_table );
|
||||
face->cmap_size = 0;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* SFNT object management (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* TrueType character mapping table (cmap) support (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -93,6 +93,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the parent face object. */
|
||||
/* */
|
||||
/* stream :: A handle to the current stream object. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
|
@ -178,7 +179,7 @@
|
|||
/* load subheaders */
|
||||
|
||||
cmap2->numGlyphId = l = (FT_UShort)(
|
||||
( ( cmap->length - 2L * ( 256 + 3 ) - num_SH * 8L ) & 0xFFFF ) / 2 );
|
||||
( ( cmap->length - 2L * ( 256 + 3 ) - num_SH * 8L ) & 0xFFFFU ) / 2 );
|
||||
|
||||
if ( FT_NEW_ARRAY( cmap2->subHeaders, num_SH + 1 ) ||
|
||||
FT_FRAME_ENTER( ( num_SH + 1 ) * 8L ) )
|
||||
|
@ -265,7 +266,7 @@
|
|||
FT_FRAME_EXIT();
|
||||
|
||||
cmap4->numGlyphId = l = (FT_UShort)(
|
||||
( ( cmap->length - ( 16L + 8L * num_Seg ) ) & 0xFFFF ) / 2 );
|
||||
( ( cmap->length - ( 16L + 8L * num_Seg ) ) & 0xFFFFU ) / 2 );
|
||||
|
||||
/* load IDs */
|
||||
|
||||
|
@ -405,6 +406,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the parent face object. */
|
||||
/* */
|
||||
/* cmap :: A handle to a cmap object. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -478,6 +480,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* charCode :: The wanted character code. */
|
||||
/* */
|
||||
/* cmap0 :: A pointer to a cmap table in format 0. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -506,6 +509,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* charCode :: The wanted character code. */
|
||||
/* */
|
||||
/* cmap0 :: A pointer to a cmap table in format 0. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -535,6 +539,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* charCode :: The wanted character code. */
|
||||
/* */
|
||||
/* cmap2 :: A pointer to a cmap table in format 2. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -582,7 +587,7 @@
|
|||
{
|
||||
result = cmap2->glyphIdArray[offset];
|
||||
if ( result )
|
||||
result = ( result + sh2->idDelta ) & 0xFFFF;
|
||||
result = ( result + sh2->idDelta ) & 0xFFFFU;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -600,6 +605,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* charCode :: The wanted character code. */
|
||||
/* */
|
||||
/* cmap2 :: A pointer to a cmap table in format 2. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -683,6 +689,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* charCode :: The wanted character code. */
|
||||
/* */
|
||||
/* cmap4 :: A pointer to a cmap table in format 4. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -739,7 +746,7 @@
|
|||
/* directly */
|
||||
|
||||
if ( seg4->idRangeOffset == 0 )
|
||||
result = ( charCode + seg4->idDelta ) & 0xFFFF;
|
||||
result = ( charCode + seg4->idDelta ) & 0xFFFFU;
|
||||
else
|
||||
{
|
||||
/* otherwise, we must use the glyphIdArray to do it */
|
||||
|
@ -750,7 +757,7 @@
|
|||
|
||||
if ( index1 < (FT_UInt)cmap4->numGlyphId &&
|
||||
cmap4->glyphIdArray[index1] != 0 )
|
||||
result = ( cmap4->glyphIdArray[index1] + seg4->idDelta ) & 0xFFFF;
|
||||
result = ( cmap4->glyphIdArray[index1] + seg4->idDelta ) & 0xFFFFU;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -767,6 +774,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* charCode :: The wanted character code. */
|
||||
/* */
|
||||
/* cmap :: A pointer to a cmap table in format 4. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -834,6 +842,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* charCode :: The wanted character code. */
|
||||
/* */
|
||||
/* cmap6 :: A pointer to a cmap table in format 6. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -867,6 +876,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* charCode :: The wanted character code. */
|
||||
/* */
|
||||
/* cmap :: A pointer to a cmap table in format 6. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -910,6 +920,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* charCode :: The wanted character code. */
|
||||
/* */
|
||||
/* cmap8_12 :: A pointer to a cmap table in format 8 or 12. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -974,6 +985,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* charCode :: The wanted character code. */
|
||||
/* */
|
||||
/* cmap :: A pointer to a cmap table in format 8 or 12. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -1020,6 +1032,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* charCode :: The wanted character code. */
|
||||
/* */
|
||||
/* cmap10 :: A pointer to a cmap table in format 10. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -1057,6 +1070,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* charCode :: The wanted character code. */
|
||||
/* */
|
||||
/* cmap :: A pointer to a cmap table in format 10. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* TrueType character mapping table (cmap) support (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,10 +1,10 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* ttcmap.h */
|
||||
/* ttcmap0.h */
|
||||
/* */
|
||||
/* TrueType character mapping table (cmap) support (specification). */
|
||||
/* TrueType new character mapping table (cmap) support (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -36,7 +36,9 @@ FT_BEGIN_HEADER
|
|||
|
||||
typedef const struct TT_CMap_ClassRec_* TT_CMap_Class;
|
||||
|
||||
typedef FT_Error (*TT_CMap_ValidateFunc)( FT_Byte* data,
|
||||
|
||||
typedef FT_Error
|
||||
(*TT_CMap_ValidateFunc)( FT_Byte* data,
|
||||
FT_Validator valid );
|
||||
|
||||
typedef struct TT_CMap_ClassRec_
|
||||
|
@ -47,6 +49,7 @@ FT_BEGIN_HEADER
|
|||
|
||||
} TT_CMap_ClassRec;
|
||||
|
||||
|
||||
typedef struct TT_ValidatorRec_
|
||||
{
|
||||
FT_ValidatorRec validator;
|
||||
|
@ -54,8 +57,9 @@ FT_BEGIN_HEADER
|
|||
|
||||
} TT_ValidatorRec, *TT_Validator;
|
||||
|
||||
|
||||
#define TT_VALIDATOR( x ) ((TT_Validator)( x ))
|
||||
#define TT_VALID_GLYPH_COUNT(v) TT_VALIDATOR(v)->num_glyphs
|
||||
#define TT_VALID_GLYPH_COUNT( x ) TT_VALIDATOR( x )->num_glyphs
|
||||
|
||||
|
||||
FT_LOCAL( FT_Error )
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
/* Load the basic TrueType tables, i.e., tables that can be either in */
|
||||
/* TTF or OTF fonts (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include <stdlib.h> /* for qsort */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
||||
|
@ -48,6 +49,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A face object handle. */
|
||||
/* */
|
||||
/* tag :: The searched tag. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -95,7 +97,9 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A face object handle. */
|
||||
/* */
|
||||
/* tag :: The searched tag. */
|
||||
/* */
|
||||
/* stream :: The stream to seek when the table is found. */
|
||||
/* */
|
||||
/* <Output> */
|
||||
|
@ -141,7 +145,9 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* face_index :: If the font is a collection, the number of the font */
|
||||
/* in the collection, ignored otherwise. */
|
||||
/* */
|
||||
|
@ -190,7 +196,8 @@
|
|||
FT_FRAME_START( 8 ),
|
||||
FT_FRAME_LONG( version ),
|
||||
FT_FRAME_LONG( count ),
|
||||
FT_FRAME_END };
|
||||
FT_FRAME_END
|
||||
};
|
||||
|
||||
|
||||
FT_TRACE2(( "TT_Load_SFNT_HeaderRec: %08p, %ld\n",
|
||||
|
@ -205,6 +212,7 @@
|
|||
/* first of all, read the first 4 bytes. If it is `ttcf', then the */
|
||||
/* file is a TrueType collection, otherwise it can be any other */
|
||||
/* kind of font. */
|
||||
/* */
|
||||
if ( FT_READ_ULONG( format_tag ) )
|
||||
goto Exit;
|
||||
|
||||
|
@ -215,7 +223,7 @@
|
|||
|
||||
FT_TRACE3(( "TT_Load_SFNT_HeaderRec: file is a collection\n" ));
|
||||
|
||||
/* it's a TrueType collection, i.e. a file containing several */
|
||||
/* It is a TrueType collection, i.e. a file containing several */
|
||||
/* font files. Read the font directory now */
|
||||
if ( FT_STREAM_READ_FIELDS( ttc_header_fields, &face->ttc_header ) )
|
||||
goto Exit;
|
||||
|
@ -284,6 +292,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* sfnt :: The SFNT directory header. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -444,6 +453,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -545,6 +555,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -666,7 +677,9 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* vertical :: A boolean flag. If set, load vertical metrics. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -694,6 +707,7 @@
|
|||
if ( vertical )
|
||||
{
|
||||
/* The table is optional, quit silently if it wasn't found */
|
||||
/* */
|
||||
/* XXX: Some fonts have a valid vertical header with a non-null */
|
||||
/* `number_of_VMetrics' fields, but no corresponding `vmtx' */
|
||||
/* table to get the metrics from (e.g. mingliu). */
|
||||
|
@ -806,7 +820,9 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* vertical :: A boolean flag. If set, load vertical metrics. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -906,6 +922,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -975,7 +992,7 @@
|
|||
if ( storageOffset < (FT_ULong)( 6 + 12 * names->numNameRecords ) ||
|
||||
table_len <= storageOffset )
|
||||
{
|
||||
FT_ERROR(( "TT.load_names: invalid 'name' table\n" ));
|
||||
FT_ERROR(( "TT_Load_Names: invalid `name' table\n" ));
|
||||
error = SFNT_Err_Name_Table_Missing;
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -984,7 +1001,8 @@
|
|||
|
||||
/* Allocate the array of name records. */
|
||||
if ( FT_ALLOC( names->names,
|
||||
names->numNameRecords*sizeof(TT_NameEntryRec) + storageSize ) ||
|
||||
names->numNameRecords * sizeof ( TT_NameEntryRec ) +
|
||||
storageSize ) ||
|
||||
FT_FRAME_ENTER( names->numNameRecords * 12L ) )
|
||||
goto Exit;
|
||||
|
||||
|
@ -1002,7 +1020,7 @@
|
|||
if ( FT_STREAM_READ_FIELDS( name_record_fields, cur ) )
|
||||
break;
|
||||
|
||||
/* invalid name entries will have "cur->string" set to NULL !! */
|
||||
/* invalid name entries will have "cur->string" set to NULL! */
|
||||
if ( (FT_ULong)( cur->stringOffset + cur->stringLength ) < storageSize )
|
||||
cur->string = storage + cur->stringOffset;
|
||||
else
|
||||
|
@ -1024,10 +1042,9 @@
|
|||
FT_STREAM_READ( storage, storageSize ) )
|
||||
goto Exit;
|
||||
|
||||
|
||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||
|
||||
/* Print Name Record Table in case of debugging */
|
||||
/* print Name Record Table in case of debugging */
|
||||
{
|
||||
TT_NameEntryRec* cur = names->names;
|
||||
TT_NameEntryRec* limit = cur + names->numNameRecords;
|
||||
|
@ -1056,7 +1073,7 @@
|
|||
FT_TRACE3(( "%c", c ));
|
||||
}
|
||||
else
|
||||
FT_TRACE3(( "INVALID ENTRY !!\n" ));
|
||||
FT_TRACE3(( "Invalid entry!\n" ));
|
||||
|
||||
FT_TRACE3(( "\n" ));
|
||||
}
|
||||
|
@ -1115,6 +1132,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: A handle to the input stream. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -1129,19 +1147,20 @@
|
|||
{
|
||||
FT_Error error;
|
||||
|
||||
|
||||
error = face->goto_table( face, TTAG_cmap, stream, &face->cmap_size );
|
||||
if ( error )
|
||||
{
|
||||
FT_TRACE2(( "No 'cmap' table in font !\n" ));
|
||||
FT_TRACE2(( "No `cmap' table in font !\n" ));
|
||||
error = SFNT_Err_CMap_Table_Missing;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
if ( !FT_FRAME_EXTRACT( face->cmap_size, face->cmap_table ) )
|
||||
FT_TRACE2(( "'cmap' table loaded\n" ));
|
||||
FT_TRACE2(( "`cmap' table loaded\n" ));
|
||||
else
|
||||
{
|
||||
FT_ERROR(( "'cmap' table is too short !!\n" ));
|
||||
FT_ERROR(( "`cmap' table is too short!\n" ));
|
||||
face->cmap_size = 0;
|
||||
}
|
||||
|
||||
|
@ -1249,6 +1268,7 @@
|
|||
|
||||
#endif /* !FT_CONFIG_OPTION_USE_CMAPS */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
|
@ -1259,6 +1279,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: A handle to the input stream. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -1352,7 +1373,7 @@
|
|||
if ( error )
|
||||
{
|
||||
FT_TRACE2(( "is missing!\n" ));
|
||||
face->os2.version = 0xFFFF;
|
||||
face->os2.version = 0xFFFFU;
|
||||
error = SFNT_Err_Ok;
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -1401,6 +1422,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: A handle to the input stream. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -1459,6 +1481,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: A handle to the input stream. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -1526,6 +1549,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -1603,6 +1627,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: The input stream. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
@ -1722,6 +1747,7 @@
|
|||
#undef TT_KERN_INDEX
|
||||
#define TT_KERN_INDEX( g1, g2 ) ( ( (FT_ULong)g1 << 16 ) | g2 )
|
||||
|
||||
|
||||
FT_CALLBACK_DEF( int )
|
||||
tt_kern_pair_compare( const void* a,
|
||||
const void* b )
|
||||
|
@ -1737,6 +1763,7 @@
|
|||
( index1 > index2 ? 1 : 0 ));
|
||||
}
|
||||
|
||||
|
||||
#undef TT_KERN_INDEX
|
||||
|
||||
|
||||
|
@ -1750,6 +1777,7 @@
|
|||
/* */
|
||||
/* <Input> */
|
||||
/* face :: A handle to the target face object. */
|
||||
/* */
|
||||
/* stream :: A handle to the input stream. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
/* Load the basic TrueType tables, i.e., tables that can be either in */
|
||||
/* TTF or OTF fonts (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
/* Postcript name table processing for TrueType and OpenType fonts */
|
||||
/* (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -33,6 +33,7 @@
|
|||
|
||||
#include "sferrors.h"
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
||||
|
@ -251,7 +252,6 @@
|
|||
}
|
||||
return SFNT_Err_Ok;
|
||||
|
||||
|
||||
Fail1:
|
||||
{
|
||||
FT_UShort n;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
/* Postcript name table processing for TrueType and OpenType fonts */
|
||||
/* (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* TrueType and OpenType embedded bitmap support (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -532,8 +532,8 @@
|
|||
{
|
||||
range->first_glyph = FT_GET_USHORT();
|
||||
range->last_glyph = FT_GET_USHORT();
|
||||
range->table_offset = table_base + strike->ranges_offset
|
||||
+ FT_GET_ULONG();
|
||||
range->table_offset = table_base + strike->ranges_offset +
|
||||
FT_GET_ULONG();
|
||||
count2--;
|
||||
range++;
|
||||
}
|
||||
|
@ -1160,10 +1160,17 @@
|
|||
|
||||
switch ( pix_bits )
|
||||
{
|
||||
case 1: line_length = ( glyph_width + 7 ) >> 3; break;
|
||||
case 2: line_length = ( glyph_width + 3 ) >> 2; break;
|
||||
case 4: line_length = ( glyph_width + 1 ) >> 1; break;
|
||||
default: line_length = glyph_width;
|
||||
case 1:
|
||||
line_length = ( glyph_width + 7 ) >> 3;
|
||||
break;
|
||||
case 2:
|
||||
line_length = ( glyph_width + 3 ) >> 2;
|
||||
break;
|
||||
case 4:
|
||||
line_length = ( glyph_width + 1 ) >> 1;
|
||||
break;
|
||||
default:
|
||||
line_length = glyph_width;
|
||||
}
|
||||
|
||||
glyph_size = glyph_height * line_length;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* TrueType and OpenType embedded bitmap support (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2001 by */
|
||||
/* Copyright 1996-2001, 2002 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
|
Loading…
Reference in New Issue