* include/freetype/internal/t1types.h: Don't include

FT_INTERNAL_OBJECTS_H but FT_INTERNAL_SERVICE_H.
* src/truetype/ttobjs.c: Don't include
FT_SERVICE_POSTSCRIPT_NAMES_H.
This commit is contained in:
Werner Lemberg 2003-09-30 05:39:35 +00:00
parent c4ec973160
commit f4c0b921a1
7 changed files with 209 additions and 57 deletions

131
ChangeLog
View File

@ -1,27 +1,122 @@
2003-09-29 Werner Lemberg <wl@gnu.org>
* include/freetype/internal/t1types.h: Don't include
FT_INTERNAL_OBJECTS_H but FT_INTERNAL_SERVICE_H.
* src/truetype/ttobjs.c: Don't include
FT_SERVICE_POSTSCRIPT_NAMES_H.
2003-09-29 David Turner <david@freetype.org> 2003-09-29 David Turner <david@freetype.org>
* src/base/ftglyph.c (FT_Get_Glyph): fixing small bug, thanks Added new service to handle glyph name dictionaries, replacing the
to Henry Maddocks for spotting this old internal header named `psnames.h' by `services/svpsname.h'.
Note that this is different from `services/svpostnm.h' which only
handles the retrieval of PostScript font names for a given face.
(Should we merge these two services into a single header?)
* include/freetype/internal/services/svpsname.h (added), * include/freetype/internal/psnames.h: Removed. Most of its
include/freetype/internal/psnames.h (removed), contents is moved to...
include/freetype/internal/internal.h (FT_SERVICE_POSTSCRIPT_NAMES): * include/freetype/internal/services/svpsname.h: New file.
added new service to handle glyph name dictionaries, replacing * include/freetype/internal/services/svpostnm.h
the old internal header named "psnames.h" by "services/svpsname.h" (FT_SERVICE_ID_POSTSCRIPT_NAME): Replaced with...
note that this is different from "services/svpostnm.h" which only (FT_SERVICE_ID_POSTSCRIPT_FONT_NAME): New macro.
handles the retrieval of Postscript font name for a given face. (PsName): Service named changed to...
(should we merge these two services into a single header ??) (PsFontName): This.
Updated `FT_Service_PsName' -> `FT_Service_PsFontName' and
`POSTSCRIPT_NAME' -> `POSTSCRIPT_FONT_NAME' everywhere.
* include/freetype/internal/ftserv.h: adding
FT_FACE_FIND_GLOBAL_SERVICE (used to lookup a service globally, * include/freetype/internal/internal.h
instead of only within the current module) (FT_INTERNAL_POSTSCRIPT_NAMES_H): Removed.
* include/freetype/internal/psaux.h: Include
* include/freetype/internal/ftobjs.h, src/base/ftobjs.c: adding FT_SERVICE_POSTSCRIPT_NAMES_H.
the new base function ft_module_get_service (T1_DecoderRec): Updated type of `psnames'.
* include/freetype/internal/t1types.h: Don't include
FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H.
Include FT_INTERNAL_OBJECTS_H.
* include/freetype/internal/t42types.h: Don't include
FT_INTERNAL_POSTSCRIPT_NAMES_H.
* include/freetype/internal/tttypes.h (TT_FaceRec): Updated.
* include/freetype/internal/ftserv.h (FT_FACE_FIND_SERVICE): Changed
order of parameters. All callers updated.
(FT_FACE_FIND_GLOBAL_SERVICE): New macro to look up a service
globally, checking all modules.
(FT_ServiceCacheRec): Updated.
(FT_SERVICE_POSTSCRIPT_NAMES_H): New macro for accessing
`svpsname.h'.
* include/freetype/internal/ftobjs.h, src/base/ftobjs.c
(ft_module_get_service): New function.
* src/cff/cffdrivr.c: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H
but FT_SERVICE_POSTSCRIPT_NAMES_H.
(cff_get_glyph_name, cff_get_name_index): Use new POSTSCRIPT_NAMES
service.
* src/cff/cffcmap.c (cff_cmap_unicode_init): Updated.
* src/cff/cffload.c, src/cff/cffload.h: Don't include
FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H.
(cff_index_get_sid_string): Updated.
* src/cff/cffobjs.c: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H
but FT_SERVICE_POSTSCRIPT_NAMES_H.
(cff_face_init): Use new POSTSCRIPT_NAMES service.
* src/cff/cffobjs.h: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H
but FT_SERVICE_POSTSCRIPT_NAMES_H.
* src/cid/cidobjs.c: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H
but FT_SERVICE_POSTSCRIPT_NAMES_H.
(cid_face_init): Use new POSTSCRIPT_NAMES service.
* src/cid/cidriver.c: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H.
* src/psaux/t1cmap.c (t1_cmap_std_init, t1_cmap_unicode_init): Use
new POSTSCRIPT_NAMES service.
* src/psaux/t1decode.h (t1_lookup_glyph_by_stdcharcode,
t1_decode_init): Use new POSTSCRIPT_NAMES service.
* src/psaux/t1cmap.h, src/psaux/t1decode.h: Dont' include
FT_INTERNAL_POSTSCRIPT_NAMES_H.
* src/psnames/psmodule.c: Don't include
FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H.
(ps_build_unicode_table): Renamed to...
(ps_unicodes_init): This.
(ps_lookup_unicode): Renamed to...
(ps_unicodes_char_index): This.
(ps_next_unicode): Renamed to...
(ps_unicodes_char_next): This.
(psnames_interface): Updated.
(psnames_services): New services list.
(psnames_get_service): New function.
(psnames_module_class): Updated.
* src/sfnt/sfobjs.c: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H
but FT_SERVICE_POSTSCRIPT_NAMES_H.
(sfnt_init_face): Use new POSTSCRIPT_NAMES service.
* src/sfnt/ttpost.c: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H
but FT_SERVICE_POSTSCRIPT_NAMES_H.
(tt_face_get_ps_name): Updated.
* src/truetype/ttobjs.c: Don't include
FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H.
* src/type1/t1driver.c: Don't include
FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H.
* src/type1/t1objs.c: Don't include
FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H.
(T1_Face_Init): Use new POSTSCRIPT_NAMES service.
* src/type42/t42drivr.c (t42_get_ps_name): Renamed to...
(t42_get_ps_font_name): This.
(t42_service_ps_name): Renamed to...
(t42_service_ps_font_name): This.
(t42_services): Updated.
* src/type42/t42objs.c (T42_Face_Init): Use new POSTSCRIPT_NAMES
service.
* src/type42/t42objs.h: Don't include
FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H.
* src/base/ftglyph.c (FT_Get_Glyph): Don't access `slot' before
testing its validity. Reported by Henry Maddocks
<maddocks@metservice.com>.
2003-09-21 Werner Lemberg <wl@gnu.org> 2003-09-21 Werner Lemberg <wl@gnu.org>

View File

@ -40,18 +40,18 @@ FT_BEGIN_HEADER
* FT_FACE_FIND_SERVICE * FT_FACE_FIND_SERVICE
* *
* @description: * @description:
* This macro is used to lookup a service from a face's driver module. * This macro is used to look up a service from a face's driver module.
* *
* @input: * @input:
* face ::
* The source face handle.
*
* id :: * id ::
* A string describing the service as defined in the service's * A string describing the service as defined in the service's
* header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to * header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
* `multi-masters'). It is automatically prefixed with * `multi-masters'). It is automatically prefixed with
* `FT_SERVICE_ID_'. * `FT_SERVICE_ID_'.
* *
* face ::
* The source face handle.
*
* @output: * @output:
* ptr :: * ptr ::
* A variable that receives the service pointer. Will be NULL * A variable that receives the service pointer. Will be NULL
@ -60,23 +60,49 @@ FT_BEGIN_HEADER
#define FT_FACE_FIND_SERVICE( face, ptr, id ) \ #define FT_FACE_FIND_SERVICE( face, ptr, id ) \
FT_BEGIN_STMNT \ FT_BEGIN_STMNT \
FT_Module module = FT_MODULE( FT_FACE(face)->driver ); \ FT_Module module = FT_MODULE( FT_FACE(face)->driver ); \
FT_Pointer* Pptr = (FT_Pointer*) &(ptr); \
/* the strange cast is to allow C++ compilation */ \ /* the strange cast is to allow C++ compilation */ \
FT_Pointer* Pptr = (FT_Pointer*) &(ptr); \
\
\
*Pptr = NULL; \ *Pptr = NULL; \
if ( module->clazz->get_interface ) \ if ( module->clazz->get_interface ) \
*Pptr = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \ *Pptr = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \
FT_END_STMNT FT_END_STMNT
#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \ /*
FT_BEGIN_STMNT \ * @macro:
FT_Module module = FT_MODULE( FT_FACE(face)->driver ); \ * FT_FACE_FIND_GLOBAL_SERVICE
FT_Pointer* Pptr = (FT_Pointer*) &(ptr); \ *
\ * @description:
/* the strange cast is to allow C++ compilation */ \ * This macro is used to look up a service from all modules.
*Pptr = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \ *
* @input:
* face ::
* The source face handle.
*
* id ::
* A string describing the service as defined in the service's
* header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to
* `multi-masters'). It is automatically prefixed with
* `FT_SERVICE_ID_'.
*
* @output:
* ptr ::
* A variable that receives the service pointer. Will be NULL
* if not found.
*/
#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \
FT_BEGIN_STMNT \
FT_Module module = FT_MODULE( FT_FACE(face)->driver ); \
/* the strange cast is to allow C++ compilation */ \
FT_Pointer* Pptr = (FT_Pointer*) &(ptr); \
\
\
*Pptr = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \
FT_END_STMNT FT_END_STMNT
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/***** *****/ /***** *****/

View File

@ -1,36 +1,61 @@
/***************************************************************************/
/* */
/* svpsname.h */
/* */
/* The FreeType glyph PS name services (specification). */
/* */
/* Copyright 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __SVPSNAME_H__ #ifndef __SVPSNAME_H__
#define __SVPSNAME_H__ #define __SVPSNAME_H__
FT_BEGIN_HEADER FT_BEGIN_HEADER
#define FT_SERVICE_ID_POSTSCRIPT_NAMES "postscript-names"
/* Adobe glyph name to unicode value #define FT_SERVICE_ID_POSTSCRIPT_NAMES "postscript-names"
*/
/*
* Adobe glyph name to unicode value
*/
typedef FT_UInt32 typedef FT_UInt32
(*PS_Unicode_ValueFunc)( const char* glyph_name ); (*PS_Unicode_ValueFunc)( const char* glyph_name );
/* Unicode value to Adobe glyph name index. 0xFFFF if not found /*
*/ * Unicode value to Adobe glyph name index. 0xFFFF if not found
*/
typedef FT_UInt typedef FT_UInt
(*PS_Unicode_Index_Func)( FT_UInt num_glyphs, (*PS_Unicode_Index_Func)( FT_UInt num_glyphs,
const char** glyph_names, const char** glyph_names,
FT_ULong unicode ); FT_ULong unicode );
/* Macintosh name id to glyph name, NULL if invalid index /*
*/ * Macintosh name id to glyph name, NULL if invalid index
*/
typedef const char* typedef const char*
(*PS_Macintosh_Name_Func)( FT_UInt name_index ); (*PS_Macintosh_Name_Func)( FT_UInt name_index );
/* Adobe standard string id to glyph name, NULL if invalid index /*
*/ * Adobe standard string id to glyph name, NULL if invalid index
*/
typedef const char* typedef const char*
(*PS_Adobe_Std_Strings_Func)( FT_UInt string_index ); (*PS_Adobe_Std_Strings_Func)( FT_UInt string_index );
/*
/* Simple unicode -> glyph index charmap built from font glyph names * Simple unicode -> glyph index charmap built from font glyph names
* table * table.
*/ */
typedef struct PS_UniMap_ typedef struct PS_UniMap_
{ {
FT_UInt unicode; FT_UInt unicode;
@ -61,6 +86,7 @@ FT_BEGIN_HEADER
(*PS_Unicodes_CharNextFunc)( PS_Unicodes* unicodes, (*PS_Unicodes_CharNextFunc)( PS_Unicodes* unicodes,
FT_ULong unicode ); FT_ULong unicode );
FT_DEFINE_SERVICE( PsNames ) FT_DEFINE_SERVICE( PsNames )
{ {
PS_Unicode_ValueFunc unicode_value; PS_Unicode_ValueFunc unicode_value;
@ -77,6 +103,8 @@ FT_BEGIN_HEADER
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __SVPSNAME_H__ */ #endif /* __SVPSNAME_H__ */

View File

@ -23,8 +23,8 @@
#include <ft2build.h> #include <ft2build.h>
#include FT_TYPE1_TABLES_H #include FT_TYPE1_TABLES_H
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_POSTSCRIPT_HINTS_H #include FT_INTERNAL_POSTSCRIPT_HINTS_H
#include FT_INTERNAL_SERVICE_H
#include FT_SERVICE_POSTSCRIPT_NAMES_H #include FT_SERVICE_POSTSCRIPT_NAMES_H

View File

@ -1375,7 +1375,9 @@ FT_BEGIN_HEADER
/* It must be called after the header was */ /* It must be called after the header was */
/* read, and before the `forget'. */ /* read, and before the `forget'. */
/* */ /* */
/* sfnt :: A pointer to the SFNT `driver' interface. */ /* sfnt :: A pointer to the SFNT service. */
/* */
/* psnames :: A pointer to the PostScript names service. */
/* */ /* */
/* hdmx :: The face's horizontal device metrics */ /* hdmx :: The face's horizontal device metrics */
/* (`hdmx' table). This table is optional in */ /* (`hdmx' table). This table is optional in */
@ -1494,14 +1496,15 @@ FT_BEGIN_HEADER
TT_Loader_ReadGlyphFunc read_simple_glyph; TT_Loader_ReadGlyphFunc read_simple_glyph;
TT_Loader_ReadGlyphFunc read_composite_glyph; TT_Loader_ReadGlyphFunc read_composite_glyph;
/* a typeless pointer to the SFNT_Interface table used to load */ /* a typeless pointer to the SFNT_Interface table used to load */
/* the basic TrueType tables in the face object */ /* the basic TrueType tables in the face object */
void* sfnt; void* sfnt;
/* a typeless pointer to the FT_Service_PsNamesRec table used to */ /* a typeless pointer to the FT_Service_PsNamesRec table used to */
/* handle glyph names <-> unicode & Mac values */ /* handle glyph names <-> unicode & Mac values */
void* psnames; void* psnames;
/***********************************************************************/ /***********************************************************************/
/* */ /* */
/* Optional TrueType/OpenType tables */ /* Optional TrueType/OpenType tables */

View File

@ -339,10 +339,10 @@
{ {
#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST #ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
(PS_Unicode_ValueFunc) ps_unicode_value, (PS_Unicode_ValueFunc) ps_unicode_value,
(PS_Unicodes_InitFunc) ps_unicodes_init, (PS_Unicodes_InitFunc) ps_unicodes_init,
(PS_Unicodes_CharIndexFunc) ps_unicodes_char_index, (PS_Unicodes_CharIndexFunc)ps_unicodes_char_index,
(PS_Unicodes_CharNextFunc) ps_unicodes_char_next, (PS_Unicodes_CharNextFunc) ps_unicodes_char_next,
#else #else
@ -353,8 +353,8 @@
#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */ #endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */
(PS_Macintosh_Name_Func) ps_get_macintosh_name, (PS_Macintosh_Name_Func) ps_get_macintosh_name,
(PS_Adobe_Std_Strings_Func) ps_get_standard_strings, (PS_Adobe_Std_Strings_Func)ps_get_standard_strings,
t1_standard_encoding, t1_standard_encoding,
t1_expert_encoding t1_expert_encoding
@ -363,10 +363,11 @@
static const FT_ServiceDescRec psnames_services[] = static const FT_ServiceDescRec psnames_services[] =
{ {
{ FT_SERVICE_ID_POSTSCRIPT_NAMES, & psnames_interface }, { FT_SERVICE_ID_POSTSCRIPT_NAMES, &psnames_interface },
{ NULL, NULL } { NULL, NULL }
}; };
static FT_Pointer static FT_Pointer
psnames_get_service( FT_Module module, psnames_get_service( FT_Module module,
const char* service_id ) const char* service_id )

View File

@ -23,7 +23,6 @@
#include FT_TRUETYPE_IDS_H #include FT_TRUETYPE_IDS_H
#include FT_TRUETYPE_TAGS_H #include FT_TRUETYPE_TAGS_H
#include FT_INTERNAL_SFNT_H #include FT_INTERNAL_SFNT_H
#include FT_SERVICE_POSTSCRIPT_NAMES_H
#include "ttgload.h" #include "ttgload.h"
#include "ttpload.h" #include "ttpload.h"