summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2003-06-20 07:33:20 +0000
committerWerner Lemberg <wl@gnu.org>2003-06-20 07:33:20 +0000
commit8048e39c0b0770f3701bda0e377a184937613ce2 (patch)
treec36ca42a61776e7309cd059bcb8d7d5cd6699a07
parentc2452e76f1100e1fed625bf3b2f5a045ce0c74b9 (diff)
downloadfreetype2-8048e39c0b0770f3701bda0e377a184937613ce2.tar.gz
* 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.
-rw-r--r--ChangeLog7
-rw-r--r--include/freetype/freetype.h6
-rw-r--r--src/cff/cffload.c2
-rw-r--r--src/cff/cffobjs.c1
-rw-r--r--src/psnames/psmodule.c41
-rw-r--r--src/winfonts/winfnt.c7
6 files changed, 52 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index eb9ca94b1..ff94a670c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* include/freetype/freetype.h (FT_Open_Flags): Replaced with
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 52faf1707..eb1a7130d 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -213,7 +213,7 @@ FT_BEGIN_HEADER
/* An extremely simple structure used to model the size of a bitmap */
/* strike (i.e., a bitmap instance of the font for a given */
/* 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> */
/* height :: The character height in pixels. */
@@ -1026,8 +1026,8 @@ FT_BEGIN_HEADER
/* */
/* @description: */
/* A macro that returns true whenever a face object contains some */
- /* embedded bitmaps. See the `fixed_sizes' field of the @FT_FaceRec */
- /* structure. */
+ /* embedded bitmaps. See the `available_sizes' field of the */
+ /* @FT_FaceRec structure. */
/* */
#define FT_HAS_FIXED_SIZES( face ) \
( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )
diff --git a/src/cff/cffload.c b/src/cff/cffload.c
index 4fa3d04d2..181b52faf 100644
--- a/src/cff/cffload.c
+++ b/src/cff/cffload.c
@@ -1679,7 +1679,6 @@
}
-
static void
cff_encoding_done( CFF_Encoding encoding )
{
@@ -1689,7 +1688,6 @@
}
-
static FT_Error
cff_encoding_load( CFF_Encoding encoding,
CFF_Charset charset,
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index a39015e9f..f0700d189 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -523,7 +523,6 @@
FT_CMap_New( clazz, NULL, &cmaprec, NULL );
}
-
}
}
diff --git a/src/psnames/psmodule.c b/src/psnames/psmodule.c
index 606ba74ea..f0be6e785 100644
--- a/src/psnames/psmodule.c
+++ b/src/psnames/psmodule.c
@@ -44,7 +44,7 @@
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. */
if ( glyph_name[0] == 'u' &&
glyph_name[1] == 'n' &&
@@ -83,7 +83,44 @@
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;
}
diff --git a/src/winfonts/winfnt.c b/src/winfonts/winfnt.c
index 320d5c2d5..5b754dd5d 100644
--- a/src/winfonts/winfnt.c
+++ b/src/winfonts/winfnt.c
@@ -133,7 +133,7 @@
/* first of all, read the FNT header */
- if ( FT_STREAM_SEEK( font->offset ) ||
+ if ( FT_STREAM_SEEK( font->offset ) ||
FT_STREAM_READ_FIELDS( winfnt_header_fields, header ) )
goto Exit;
@@ -208,7 +208,7 @@
face->num_fonts = 0;
/* does it begin with a MZ header? */
- if ( FT_STREAM_SEEK( 0 ) ||
+ if ( FT_STREAM_SEEK( 0 ) ||
FT_STREAM_READ_FIELDS( winmz_header_fields, &mz_header ) )
goto Exit;
@@ -219,7 +219,7 @@
WinNE_HeaderRec ne_header;
- if ( FT_STREAM_SEEK( mz_header.lfanew ) ||
+ if ( FT_STREAM_SEEK( mz_header.lfanew ) ||
FT_STREAM_READ_FIELDS( winne_header_fields, &ne_header ) )
goto Exit;
@@ -322,7 +322,6 @@
}
-
typedef struct FNT_CMapRec_
{
FT_CMapRec cmap;