summaryrefslogtreecommitdiffstats
path: root/src/cff/cffdrivr.c
diff options
context:
space:
mode:
authorEric Vannier <evannier@google.com>2012-03-22 16:08:33 -0700
committerGeremy Condra <gcondra@google.com>2012-04-20 14:53:55 -0700
commit41371e1e39c8528eb0c4bc40683c736e6683e60c (patch)
treeba563af45d79cd0832305fe3833919bb2475f186 /src/cff/cffdrivr.c
parent27811904d8de0ce5591417812ca31163bf5aad60 (diff)
downloadandroid_external_freetype-41371e1e39c8528eb0c4bc40683c736e6683e60c.tar.gz
android_external_freetype-41371e1e39c8528eb0c4bc40683c736e6683e60c.tar.bz2
android_external_freetype-41371e1e39c8528eb0c4bc40683c736e6683e60c.zip
Update to freetype 2.4.9
This was done by applying the entire 2.4.9 except for the following exceptions: - files that were new, or were not present originally in the version of freetype we were using (meaning that they are present in 2.4.8, and in 2.4.9, but were never integrated into the Android tree because they are not used in the Android tree). - ftmodule.h: given that we support fewer modules than in upstream 2.4.9 (same as Android), the file was left unchanged (and there were no changes from the official 2.4.8 to 2.4.9 - ftoption.h: same reasons as ftmodule.h Change-Id: Id251f2cc5ca1c864f9a4cc0c67b94025ee3ccc4a
Diffstat (limited to 'src/cff/cffdrivr.c')
-rw-r--r--src/cff/cffdrivr.c59
1 files changed, 38 insertions, 21 deletions
diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c
index bf2d016..eb4c14e 100644
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -4,7 +4,7 @@
/* */
/* OpenType font driver implementation (body). */
/* */
-/* Copyright 1996-2011 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, */
@@ -125,7 +125,7 @@
/*************************************************************************/
/* */
/* <Function> */
- /* Load_Glyph */
+ /* cff_glyph_load */
/* */
/* <Description> */
/* A driver method used to load a glyph within a given glyph slot. */
@@ -149,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;
@@ -203,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;
@@ -239,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;
}
@@ -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,