forked from minhngoc25a/freetype2
* src/cff/cffobjs.c (cff_face_init): Use symbolic names for
Adobe specific encoding IDs (there was a wrong EID value for custom encoding). * src/cff/cffcmap.h (CFF_CMapStdRec): Remove `count'. * src/cff/cffcmap.c (cff_cmap_encoding_init, cff_cmap_encoding_done): Updated. (cff_cmap_encoding_char_index, cff_cmap_encoding_char_next): Use 256 as limit for character code.
This commit is contained in:
parent
e20ab691c3
commit
f35ff80132
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2003-06-02 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
* src/cff/cffobjs.c (cff_face_init): Use symbolic names for
|
||||
Adobe specific encoding IDs (there was a wrong EID value for custom
|
||||
encoding).
|
||||
|
||||
* src/cff/cffcmap.h (CFF_CMapStdRec): Remove `count'.
|
||||
* src/cff/cffcmap.c (cff_cmap_encoding_init,
|
||||
cff_cmap_encoding_done): Updated.
|
||||
(cff_cmap_encoding_char_index, cff_cmap_encoding_char_next): Use
|
||||
256 as limit for character code.
|
||||
|
||||
2003-06-01 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
* src/winfonts/winfnt.c (FNT_Load_Glyph): Revert change from
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* CFF character mapping table (cmap) support (body). */
|
||||
/* */
|
||||
/* Copyright 2002 by */
|
||||
/* Copyright 2002, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -36,7 +36,6 @@
|
|||
CFF_Encoding encoding = &cff->encoding;
|
||||
|
||||
|
||||
cmap->count = encoding->count;
|
||||
cmap->gids = encoding->codes;
|
||||
|
||||
return 0;
|
||||
|
@ -46,7 +45,6 @@
|
|||
FT_CALLBACK_DEF( void )
|
||||
cff_cmap_encoding_done( CFF_CMapStd cmap )
|
||||
{
|
||||
cmap->count = 0;
|
||||
cmap->gids = NULL;
|
||||
}
|
||||
|
||||
|
@ -58,7 +56,7 @@
|
|||
FT_UInt result = 0;
|
||||
|
||||
|
||||
if ( char_code < cmap->count )
|
||||
if ( char_code < 256 )
|
||||
result = cmap->gids[char_code];
|
||||
|
||||
return result;
|
||||
|
@ -75,14 +73,14 @@
|
|||
|
||||
*pchar_code = 0;
|
||||
|
||||
if ( char_code < cmap->count )
|
||||
if ( char_code < 255 )
|
||||
{
|
||||
FT_UInt code = (FT_UInt)(char_code + 1);
|
||||
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if ( code >= cmap->count )
|
||||
if ( code >= 256 )
|
||||
break;
|
||||
|
||||
result = cmap->gids[code];
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
/* */
|
||||
/* CFF character mapping table (cmap) support (specification). */
|
||||
/* */
|
||||
/* Copyright 2002 by */
|
||||
/* Copyright 2002, 2003 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
|
@ -38,7 +38,6 @@ FT_BEGIN_HEADER
|
|||
typedef struct CFF_CMapStdRec_
|
||||
{
|
||||
FT_CMapRec cmap;
|
||||
FT_UInt count;
|
||||
FT_UShort* gids; /* up to 256 elements */
|
||||
|
||||
} CFF_CMapStdRec;
|
||||
|
|
|
@ -1557,7 +1557,6 @@
|
|||
|
||||
while ( j < num_glyphs )
|
||||
{
|
||||
|
||||
/* Read the first glyph sid of the range. */
|
||||
if ( FT_READ_USHORT( glyph_sid ) )
|
||||
goto Exit;
|
||||
|
@ -1720,8 +1719,8 @@
|
|||
encoding->codes[j] = 0;
|
||||
}
|
||||
|
||||
/* Note: The encoding table in a CFF font is indexed by glyph index, */
|
||||
/* where the first encoded glyph index is 1. Hence, we read the char */
|
||||
/* Note: The encoding table in a CFF font is indexed by glyph index; */
|
||||
/* the first encoded glyph index is 1. Hence, we read the character */
|
||||
/* code (`glyph_code') at index j and make the assignment: */
|
||||
/* */
|
||||
/* encoding->codes[glyph_code] = j + 1 */
|
||||
|
@ -1734,7 +1733,6 @@
|
|||
|
||||
if ( offset > 1 )
|
||||
{
|
||||
|
||||
encoding->offset = base_offset + offset;
|
||||
|
||||
/* we need to parse the table to determine its size */
|
||||
|
@ -1900,7 +1898,6 @@
|
|||
|
||||
encoding->count = 0;
|
||||
|
||||
|
||||
for ( j = 0; j < 256; j++ )
|
||||
{
|
||||
/* If j is encoded, find the GID for it. */
|
||||
|
|
|
@ -504,19 +504,19 @@
|
|||
|
||||
if ( encoding->offset == 0 )
|
||||
{
|
||||
cmaprec.encoding_id = 0;
|
||||
cmaprec.encoding_id = TT_ADOBE_ID_STANDARD;
|
||||
cmaprec.encoding = FT_ENCODING_ADOBE_STANDARD;
|
||||
clazz = &cff_cmap_encoding_class_rec;
|
||||
}
|
||||
else if ( encoding->offset == 1 )
|
||||
{
|
||||
cmaprec.encoding_id = 1;
|
||||
cmaprec.encoding_id = TT_ADOBE_ID_EXPERT;
|
||||
cmaprec.encoding = FT_ENCODING_ADOBE_EXPERT;
|
||||
clazz = &cff_cmap_encoding_class_rec;
|
||||
}
|
||||
else
|
||||
{
|
||||
cmaprec.encoding_id = 3;
|
||||
cmaprec.encoding_id = TT_ADOBE_ID_CUSTOM;
|
||||
cmaprec.encoding = FT_ENCODING_ADOBE_CUSTOM;
|
||||
clazz = &cff_cmap_encoding_class_rec;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue