freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Devel] clean up in cidload.c


From: 山内 英敏
Subject: [Devel] clean up in cidload.c
Date: Tue, 06 May 2003 22:33:05 +0900 (JST)

Hello,

Here is a patch to remove is_alpha in cid/cidload.c.
It is obsoleted and we should use ps_parser_skip_alpha.

P.S.
My CID CMap support code already works. Two functions, Get_Char and
Next_Char, work with CMaps with usecmap operator. (e.g. Euc-v) But it
is not the time to post it because it is not clean yet.

----- YAMANO-UCHI, Hidetoshi

diff -ur /usr/local/work/FreeType/freetype2/src/cid/cidload.c 
freetype2/src/cid/cidload.c
--- /usr/local/work/FreeType/freetype2/src/cid/cidload.c        Fri Sep 27 
20:09:22 2002
+++ freetype2/src/cid/cidload.c Tue May  6 22:06:01 2003
@@ -279,15 +279,6 @@
   };
 
 
-  static int
-  is_alpha( char  c )
-  {
-    return ( ft_isalnum( (int)c ) ||
-             c == '.'             ||
-             c == '_'             );
-  }
-
-
   static FT_Error
   cid_parse_dict( CID_Face     face,
                   CID_Loader*  loader,
@@ -322,17 +313,15 @@
         /* look for immediates */
         else if ( *cur == '/' && cur + 2 < limit )
         {
-          FT_Byte*  cur2;
           FT_Int    len;
 
 
           cur++;
 
-          cur2 = cur;
-          while ( cur2 < limit && is_alpha( *cur2 ) )
-            cur2++;
+          parser->root.cursor = cur;
+          cid_parser_skip_alpha( parser );
 
-          len = (FT_Int)( cur2 - cur );
+          len = (FT_Int)( parser->root.cursor - cur );
           if ( len > 0 && len < 22 )
           {
             /* now compare the immediate name to the keyword table */
@@ -361,7 +350,6 @@
                 if ( n >= len )
                 {
                   /* we found it - run the parsing callback */
-                  parser->root.cursor = cur2;
                   cid_parser_skip_spaces( parser );
                   parser->root.error = cid_load_keyword( face,
                                                          loader,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]