* src/psnames/psmodule.c (ps_unicode_value): Add support to

recognize `uXXXX[X[X]]' glyph names.
Don't handle glyph names starting with `uni' which have more than
four digits.
This commit is contained in:
Werner Lemberg 2003-06-20 07:33:20 +00:00
parent 3c7f11a9b7
commit eb17a92a78
6 changed files with 52 additions and 12 deletions

View File

@ -1,3 +1,10 @@
2003-06-18 Werner Lemberg <wl@gnu.org>
* src/psnames/psmodule.c (ps_unicode_value): Add support to
recognize `uXXXX[X[X]]' glyph names.
Don't handle glyph names starting with `uni' which have more than
four digits.
2003-06-16 Werner Lemberg <wl@gnu.org> 2003-06-16 Werner Lemberg <wl@gnu.org>
* include/freetype/freetype.h (FT_Open_Flags): Replaced with * include/freetype/freetype.h (FT_Open_Flags): Replaced with

View File

@ -213,7 +213,7 @@ FT_BEGIN_HEADER
/* An extremely simple structure used to model the size of a bitmap */ /* An extremely simple structure used to model the size of a bitmap */
/* strike (i.e., a bitmap instance of the font for a given */ /* strike (i.e., a bitmap instance of the font for a given */
/* resolution) in a fixed-size font face. This is used for the */ /* resolution) in a fixed-size font face. This is used for the */
/* `available_sizes' field of the FT_Face_Properties structure. */ /* `available_sizes' field of the @FT_FaceRec structure. */
/* */ /* */
/* <Fields> */ /* <Fields> */
/* height :: The character height in pixels. */ /* height :: The character height in pixels. */
@ -1026,8 +1026,8 @@ FT_BEGIN_HEADER
/* */ /* */
/* @description: */ /* @description: */
/* A macro that returns true whenever a face object contains some */ /* A macro that returns true whenever a face object contains some */
/* embedded bitmaps. See the `fixed_sizes' field of the @FT_FaceRec */ /* embedded bitmaps. See the `available_sizes' field of the */
/* structure. */ /* @FT_FaceRec structure. */
/* */ /* */
#define FT_HAS_FIXED_SIZES( face ) \ #define FT_HAS_FIXED_SIZES( face ) \
( face->face_flags & FT_FACE_FLAG_FIXED_SIZES ) ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )

View File

@ -1679,7 +1679,6 @@
} }
static void static void
cff_encoding_done( CFF_Encoding encoding ) cff_encoding_done( CFF_Encoding encoding )
{ {
@ -1689,7 +1688,6 @@
} }
static FT_Error static FT_Error
cff_encoding_load( CFF_Encoding encoding, cff_encoding_load( CFF_Encoding encoding,
CFF_Charset charset, CFF_Charset charset,

View File

@ -523,7 +523,6 @@
FT_CMap_New( clazz, NULL, &cmaprec, NULL ); FT_CMap_New( clazz, NULL, &cmaprec, NULL );
} }
} }
} }

View File

@ -44,7 +44,7 @@
char temp[64]; char temp[64];
/* if the name begins with `uni', then the glyph name may be a */ /* If the name begins with `uni', then the glyph name may be a */
/* hard-coded unicode character code. */ /* hard-coded unicode character code. */
if ( glyph_name[0] == 'u' && if ( glyph_name[0] == 'u' &&
glyph_name[1] == 'n' && glyph_name[1] == 'n' &&
@ -83,7 +83,44 @@
value = ( value << 4 ) + d; value = ( value << 4 ) + d;
} }
if ( count == 0 )
/* there must be exactly four hex digits */
if ( *p == '\0' && count == 0 )
return value;
}
/* If the name begins with `u', followed by four to six uppercase */
/* hexadicimal digits, it is a hard-coded unicode character code. */
if ( glyph_name[0] == 'u' )
{
FT_Int count;
FT_ULong value = 0;
const char* p = glyph_name + 1;
for ( count = 6; count > 0; count--, p++ )
{
char c = *p;
unsigned int d;
d = (unsigned char)c - '0';
if ( d >= 10 )
{
d = (unsigned char)c - 'A';
if ( d >= 6 )
d = 16;
else
d += 10;
}
if ( d >= 16 )
break;
value = ( value << 4 ) + d;
}
if ( *p == '\0' && count <= 2 )
return value; return value;
} }

View File

@ -322,7 +322,6 @@
} }
typedef struct FNT_CMapRec_ typedef struct FNT_CMapRec_
{ {
FT_CMapRec cmap; FT_CMapRec cmap;