[xorg-commit-diffs] xc/extras/freetype2/src/psnames psmodule.c,
1.1.4.1, 1.1.4.2 pstables.h, 1.1, 1.1.4.1 rules.mk, 1.1, 1.1.4.1
Egbert Eich
xorg-commit at pdx.freedesktop.org
Thu Apr 15 03:14:44 PDT 2004
- Previous message: [xorg-commit-diffs]
xc/extras/freetype2/src/pshinter pshalgo.c, NONE,
1.1.6.1 pshnterr.h, NONE, 1.1.6.1 Jamfile, 1.1.4.1,
1.1.4.2 pshalgo.h, 1.1.4.1, 1.1.4.2 pshglob.c, 1.1.4.1,
1.1.4.2 pshglob.h, 1.1.4.1, 1.1.4.2 pshinter.c, 1.1.4.1,
1.1.4.2 pshrec.c, 1.1.4.1, 1.1.4.2 pshrec.h, 1.1,
1.1.4.1 rules.mk, 1.1.4.1, 1.1.4.2 pshalgo1.c, 1.1.4.1,
NONE pshalgo1.h, 1.1.4.1, NONE pshalgo2.c, 1.1.4.1,
NONE pshalgo2.h, 1.1.4.1, NONE pshalgo3.c, 1.1,
NONE pshalgo3.h, 1.1, NONE
- Next message: [xorg-commit-diffs] xc/extras/freetype2/src/raster ftraster.c,
1.1.4.1, 1.1.4.2 ftrend1.c, 1.1.4.1, 1.1.4.2 rules.mk, 1.1, 1.1.4.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Committed by: eich
Update of /cvs/xorg/xc/extras/freetype2/src/psnames
In directory pdx:/home/eich/tstbuild/xc/extras/freetype2/src/psnames
Modified Files:
Tag: XORG-CURRENT
psmodule.c pstables.h rules.mk
Log Message:
2004-04-15 Egbert Eich <eich at freedesktop.org>
Merged changes from RELEASE-1 branch
Index: psmodule.c
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/psnames/psmodule.c,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/psmodule.c 26 Nov 2003 22:48:27 -0000 1.1.4.1
+++ b/psmodule.c 15 Apr 2004 10:14:40 -0000 1.1.4.2
@@ -4,7 +4,7 @@
/* */
/* PSNames module implementation (body). */
/* */
-/* Copyright 1996-2001, 2002 by */
+/* Copyright 1996-2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -17,8 +17,8 @@
#include <ft2build.h>
-#include FT_INTERNAL_POSTSCRIPT_NAMES_H
#include FT_INTERNAL_OBJECTS_H
+#include FT_SERVICE_POSTSCRIPT_CMAPS_H
#include "psmodule.h"
#include "pstables.h"
@@ -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' || *p == '.' ) && 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' || *p == '.' ) && count <= 2 )
return value;
}
@@ -139,10 +176,10 @@
/* Builds a table that maps Unicode values to glyph indices */
static FT_Error
- ps_build_unicode_table( FT_Memory memory,
- FT_UInt num_glyphs,
- const char** glyph_names,
- PS_Unicodes* table )
+ ps_unicodes_init( FT_Memory memory,
+ FT_UInt num_glyphs,
+ const char** glyph_names,
+ PS_Unicodes* table )
{
FT_Error error;
@@ -170,9 +207,9 @@
{
uni_char = ps_unicode_value( gname );
- if ( uni_char != 0 && uni_char != 0xFFFF )
+ if ( uni_char != 0 && uni_char != 0xFFFFL )
{
- map->unicode = uni_char;
+ map->unicode = (FT_UInt)uni_char;
map->glyph_index = n;
map++;
}
@@ -205,8 +242,8 @@
static FT_UInt
- ps_lookup_unicode( PS_Unicodes* table,
- FT_ULong unicode )
+ ps_unicodes_char_index( PS_Unicodes* table,
+ FT_ULong unicode )
{
PS_UniMap *min, *max, *mid;
@@ -231,13 +268,13 @@
max = mid - 1;
}
- return 0xFFFF;
+ return 0xFFFFU;
}
static FT_ULong
- ps_next_unicode( PS_Unicodes* table,
- FT_ULong unicode )
+ ps_unicodes_char_next( PS_Unicodes* table,
+ FT_ULong unicode )
{
PS_UniMap *min, *max, *mid;
@@ -298,40 +335,52 @@
static
- const PSNames_Interface psnames_interface =
+ const FT_Service_PsCMapsRec pscmaps_interface =
{
#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
- (PS_Unicode_Value_Func) ps_unicode_value,
- (PS_Build_Unicodes_Func) ps_build_unicode_table,
- (PS_Lookup_Unicode_Func) ps_lookup_unicode,
+ (PS_Unicode_ValueFunc) ps_unicode_value,
+ (PS_Unicodes_InitFunc) ps_unicodes_init,
+ (PS_Unicodes_CharIndexFunc)ps_unicodes_char_index,
+ (PS_Unicodes_CharNextFunc) ps_unicodes_char_next,
#else
0,
0,
0,
+ 0,
#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */
- (PS_Macintosh_Name_Func) ps_get_macintosh_name,
- (PS_Adobe_Std_Strings_Func) ps_get_standard_strings,
+ (PS_Macintosh_Name_Func) ps_get_macintosh_name,
+ (PS_Adobe_Std_Strings_Func)ps_get_standard_strings,
t1_standard_encoding,
- t1_expert_encoding,
+ t1_expert_encoding
+ };
-#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
- (PS_Next_Unicode_Func) ps_next_unicode
-#else
- 0
-#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */
+ static const FT_ServiceDescRec pscmaps_services[] =
+ {
+ { FT_SERVICE_ID_POSTSCRIPT_CMAPS, &pscmaps_interface },
+ { NULL, NULL }
};
+ static FT_Pointer
+ psnames_get_service( FT_Module module,
+ const char* service_id )
+ {
+ FT_UNUSED( module );
+
+ return ft_service_list_lookup( pscmaps_services, service_id );
+ }
+
#endif /* !FT_CONFIG_OPTION_NO_POSTSCRIPT_NAMES */
+
FT_CALLBACK_TABLE_DEF
const FT_Module_Class psnames_module_class =
{
@@ -344,13 +393,15 @@
#ifdef FT_CONFIG_OPTION_NO_POSTSCRIPT_NAMES
0,
-#else
- (void*)&psnames_interface, /* module specific interface */
-#endif
-
(FT_Module_Constructor)0,
(FT_Module_Destructor) 0,
(FT_Module_Requester) 0
+#else
+ (void*)&pscmaps_interface, /* module specific interface */
+ (FT_Module_Constructor)0,
+ (FT_Module_Destructor) 0,
+ (FT_Module_Requester) psnames_get_service
+#endif
};
Index: pstables.h
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/psnames/pstables.h,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- a/pstables.h 14 Nov 2003 16:48:24 -0000 1.1
+++ b/pstables.h 15 Apr 2004 10:14:40 -0000 1.1.4.1
@@ -1,10 +1,10 @@
/***************************************************************************/
/* */
-/* pstables.h */
+/* pstables.h.new */
/* */
/* PostScript glyph names (specification only). */
/* */
-/* Copyright 2000-2001 by */
+/* Copyright 2000-2001, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
[...9314 lines suppressed...]
+ 0x056AU,
+ 0x04C2U,
+ 0x0436U,
+ 0x0497U,
+ 0x04DDU,
+ 0x3058U,
+ 0x30B8U,
+ 0x05AEU,
+ 0x1E95U,
+ 0xFF5AU,
+ 0x305EU,
+ 0x30BEU,
+ 0x24B5U,
+ 0x0290U,
+ 0x01B6U,
+ 0x305AU,
+ 0x30BAU,
#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */
0
Index: rules.mk
===================================================================
RCS file: /cvs/xorg/xc/extras/freetype2/src/psnames/rules.mk,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- a/rules.mk 14 Nov 2003 16:48:24 -0000 1.1
+++ b/rules.mk 15 Apr 2004 10:14:40 -0000 1.1.4.1
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2001 by
+# Copyright 1996-2000, 2001, 2003 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -15,25 +15,24 @@
# PSNames driver directory
#
-PSNAMES_DIR := $(SRC_)psnames
-PSNAMES_DIR_ := $(PSNAMES_DIR)$(SEP)
+PSNAMES_DIR := $(SRC_DIR)/psnames
# compilation flags for the driver
#
-PSNAMES_COMPILE := $(FT_COMPILE) $I$(PSNAMES_DIR)
+PSNAMES_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(PSNAMES_DIR))
# PSNames driver sources (i.e., C files)
#
-PSNAMES_DRV_SRC := $(PSNAMES_DIR_)psmodule.c
+PSNAMES_DRV_SRC := $(PSNAMES_DIR)/psmodule.c
# PSNames driver headers
#
PSNAMES_DRV_H := $(PSNAMES_DRV_SRC:%.c=%.h) \
- $(PSNAMES_DIR_)pstables.h \
- $(PSNAMES_DIR_)psnamerr.h
+ $(PSNAMES_DIR)/pstables.h \
+ $(PSNAMES_DIR)/psnamerr.h
# PSNames driver object(s)
@@ -41,25 +40,25 @@
# PSNAMES_DRV_OBJ_M is used during `multi' builds
# PSNAMES_DRV_OBJ_S is used during `single' builds
#
-PSNAMES_DRV_OBJ_M := $(PSNAMES_DRV_SRC:$(PSNAMES_DIR_)%.c=$(OBJ_)%.$O)
-PSNAMES_DRV_OBJ_S := $(OBJ_)psnames.$O
+PSNAMES_DRV_OBJ_M := $(PSNAMES_DRV_SRC:$(PSNAMES_DIR)/%.c=$(OBJ_DIR)/%.$O)
+PSNAMES_DRV_OBJ_S := $(OBJ_DIR)/psnames.$O
# PSNames driver source file for single build
#
-PSNAMES_DRV_SRC_S := $(PSNAMES_DIR_)psmodule.c
+PSNAMES_DRV_SRC_S := $(PSNAMES_DIR)/psmodule.c
# PSNames driver - single object
#
$(PSNAMES_DRV_OBJ_S): $(PSNAMES_DRV_SRC_S) $(PSNAMES_DRV_SRC) \
$(FREETYPE_H) $(PSNAMES_DRV_H)
- $(PSNAMES_COMPILE) $T$@ $(PSNAMES_DRV_SRC_S)
+ $(PSNAMES_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(PSNAMES_DRV_SRC_S))
# PSNames driver - multiple objects
#
-$(OBJ_)%.$O: $(PSNAMES_DIR_)%.c $(FREETYPE_H) $(PSNAMES_DRV_H)
- $(PSNAMES_COMPILE) $T$@ $<
+$(OBJ_DIR)/%.$O: $(PSNAMES_DIR)/%.c $(FREETYPE_H) $(PSNAMES_DRV_H)
+ $(PSNAMES_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
# update main driver object lists
- Previous message: [xorg-commit-diffs]
xc/extras/freetype2/src/pshinter pshalgo.c, NONE,
1.1.6.1 pshnterr.h, NONE, 1.1.6.1 Jamfile, 1.1.4.1,
1.1.4.2 pshalgo.h, 1.1.4.1, 1.1.4.2 pshglob.c, 1.1.4.1,
1.1.4.2 pshglob.h, 1.1.4.1, 1.1.4.2 pshinter.c, 1.1.4.1,
1.1.4.2 pshrec.c, 1.1.4.1, 1.1.4.2 pshrec.h, 1.1,
1.1.4.1 rules.mk, 1.1.4.1, 1.1.4.2 pshalgo1.c, 1.1.4.1,
NONE pshalgo1.h, 1.1.4.1, NONE pshalgo2.c, 1.1.4.1,
NONE pshalgo2.h, 1.1.4.1, NONE pshalgo3.c, 1.1,
NONE pshalgo3.h, 1.1, NONE
- Next message: [xorg-commit-diffs] xc/extras/freetype2/src/raster ftraster.c,
1.1.4.1, 1.1.4.2 ftrend1.c, 1.1.4.1, 1.1.4.2 rules.mk, 1.1, 1.1.4.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the xorg-commit-diffs
mailing list