Index: src/cff/cffdrivr.c |
diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c |
index 4fd3436cc072c4068f3b63f5932d94bc76372eb3..eb4c14ee5d3578570b41d2e0beb2155d6d825862 100644 |
--- a/src/cff/cffdrivr.c |
+++ b/src/cff/cffdrivr.c |
@@ -4,8 +4,7 @@ |
/* */ |
/* OpenType font driver implementation (body). */ |
/* */ |
-/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */ |
-/* 2010 by */ |
+/* Copyright 1996-2012 by */ |
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
/* */ |
/* This file is part of the FreeType project, and may only be used, */ |
@@ -126,7 +125,7 @@ |
/*************************************************************************/ |
/* */ |
/* <Function> */ |
- /* Load_Glyph */ |
+ /* cff_glyph_load */ |
/* */ |
/* <Description> */ |
/* A driver method used to load a glyph within a given glyph slot. */ |
@@ -150,10 +149,10 @@ |
/* FreeType error code. 0 means success. */ |
/* */ |
FT_CALLBACK_DEF( FT_Error ) |
- Load_Glyph( FT_GlyphSlot cffslot, /* CFF_GlyphSlot */ |
- FT_Size cffsize, /* CFF_Size */ |
- FT_UInt glyph_index, |
- FT_Int32 load_flags ) |
+ cff_glyph_load( FT_GlyphSlot cffslot, /* CFF_GlyphSlot */ |
+ FT_Size cffsize, /* CFF_Size */ |
+ FT_UInt glyph_index, |
+ FT_Int32 load_flags ) |
{ |
FT_Error error; |
CFF_GlyphSlot slot = (CFF_GlyphSlot)cffslot; |
@@ -204,7 +203,7 @@ |
for ( nn = 0; nn < count; nn++ ) |
{ |
- error = Load_Glyph( slot, face->size, start + nn, flags ); |
+ error = cff_glyph_load( slot, face->size, start + nn, flags ); |
if ( error ) |
break; |
@@ -240,7 +239,7 @@ |
" cannot get glyph name from CFF & CEF fonts\n" |
" " |
" without the `PSNames' module\n" )); |
- error = CFF_Err_Unknown_File_Format; |
+ error = CFF_Err_Missing_Module; |
goto Exit; |
} |
@@ -365,7 +364,8 @@ |
(PS_GetFontInfoFunc) cff_ps_get_font_info, |
(PS_GetFontExtraFunc) NULL, |
(PS_HasGlyphNamesFunc) cff_ps_has_glyph_names, |
- (PS_GetFontPrivateFunc)NULL /* unsupported with CFF fonts */ |
+ (PS_GetFontPrivateFunc)NULL, /* unsupported with CFF fonts */ |
+ (PS_GetFontValueFunc) NULL /* not implemented */ |
) |
@@ -466,7 +466,7 @@ |
dict->cid_registry ); |
*registry = cff->registry; |
} |
- |
+ |
if ( ordering ) |
{ |
if ( cff->ordering == NULL ) |
@@ -489,7 +489,7 @@ |
*supplement = (FT_Int)dict->cid_supplement; |
} |
} |
- |
+ |
Fail: |
return error; |
} |
@@ -599,19 +599,35 @@ |
cff_get_interface( FT_Module driver, /* CFF_Driver */ |
const char* module_interface ) |
{ |
+ FT_Library library; |
FT_Module sfnt; |
FT_Module_Interface result; |
+ /* FT_CFF_SERVICES_GET derefers `library' in PIC mode */ |
+#ifdef FT_CONFIG_OPTION_PIC |
+ if ( !driver ) |
+ return NULL; |
+ library = driver->library; |
+ if ( !library ) |
+ return NULL; |
+#endif |
+ |
result = ft_service_list_lookup( FT_CFF_SERVICES_GET, module_interface ); |
if ( result != NULL ) |
- return result; |
+ return result; |
+ /* `driver' is not yet evaluated in non-PIC mode */ |
+#ifndef FT_CONFIG_OPTION_PIC |
if ( !driver ) |
return NULL; |
+ library = driver->library; |
+ if ( !library ) |
+ return NULL; |
+#endif |
/* we pass our request to the `sfnt' module */ |
- sfnt = FT_Get_Module( driver->library, "sfnt" ); |
+ sfnt = FT_Get_Module( library, "sfnt" ); |
return sfnt ? sfnt->clazz->get_interface( sfnt, module_interface ) : 0; |
} |
@@ -625,12 +641,13 @@ |
#define CFF_SIZE_SELECT 0 |
#endif |
- FT_DEFINE_DRIVER(cff_driver_class, |
+ FT_DEFINE_DRIVER( cff_driver_class, |
+ |
FT_MODULE_FONT_DRIVER | |
FT_MODULE_DRIVER_SCALABLE | |
FT_MODULE_DRIVER_HAS_HINTER, |
- sizeof( CFF_DriverRec ), |
+ sizeof ( CFF_DriverRec ), |
"cff", |
0x10000L, |
0x20000L, |
@@ -642,9 +659,9 @@ |
cff_get_interface, |
/* now the specific driver fields */ |
- sizeof( TT_FaceRec ), |
- sizeof( CFF_SizeRec ), |
- sizeof( CFF_GlyphSlotRec ), |
+ sizeof ( TT_FaceRec ), |
+ sizeof ( CFF_SizeRec ), |
+ sizeof ( CFF_GlyphSlotRec ), |
cff_face_init, |
cff_face_done, |
@@ -653,14 +670,14 @@ |
cff_slot_init, |
cff_slot_done, |
- ft_stub_set_char_sizes, /* FT_CONFIG_OPTION_OLD_INTERNALS */ |
+ ft_stub_set_char_sizes, /* FT_CONFIG_OPTION_OLD_INTERNALS */ |
ft_stub_set_pixel_sizes, /* FT_CONFIG_OPTION_OLD_INTERNALS */ |
- Load_Glyph, |
+ cff_glyph_load, |
cff_get_kerning, |
- 0, /* FT_Face_AttachFunc */ |
- cff_get_advances, /* FT_Face_GetAdvancesFunc */ |
+ 0, /* FT_Face_AttachFunc */ |
+ cff_get_advances, |
cff_size_request, |