summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/type1/t1objs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/src/type1/t1objs.c')
-rw-r--r--src/3rdparty/freetype/src/type1/t1objs.c84
1 files changed, 53 insertions, 31 deletions
diff --git a/src/3rdparty/freetype/src/type1/t1objs.c b/src/3rdparty/freetype/src/type1/t1objs.c
index b1de687196..e11770feef 100644
--- a/src/3rdparty/freetype/src/type1/t1objs.c
+++ b/src/3rdparty/freetype/src/type1/t1objs.c
@@ -4,7 +4,7 @@
/* */
/* Type 1 objects manager (body). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
+/* Copyright 1996-2009, 2011, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -72,8 +72,11 @@
FT_LOCAL_DEF( void )
- T1_Size_Done( T1_Size size )
+ T1_Size_Done( FT_Size t1size ) /* T1_Size */
{
+ T1_Size size = (T1_Size)t1size;
+
+
if ( size->root.internal )
{
PSH_Globals_Funcs funcs;
@@ -89,9 +92,10 @@
FT_LOCAL_DEF( FT_Error )
- T1_Size_Init( T1_Size size )
+ T1_Size_Init( FT_Size t1size ) /* T1_Size */
{
- FT_Error error = T1_Err_Ok;
+ T1_Size size = (T1_Size)t1size;
+ FT_Error error = FT_Err_Ok;
PSH_Globals_Funcs funcs = T1_Size_Get_Globals_Funcs( size );
@@ -112,9 +116,10 @@
FT_LOCAL_DEF( FT_Error )
- T1_Size_Request( T1_Size size,
+ T1_Size_Request( FT_Size t1size, /* T1_Size */
FT_Size_Request req )
{
+ T1_Size size = (T1_Size)t1size;
PSH_Globals_Funcs funcs = T1_Size_Get_Globals_Funcs( size );
@@ -126,7 +131,7 @@
size->root.metrics.y_scale,
0, 0 );
- return T1_Err_Ok;
+ return FT_Err_Ok;
}
@@ -137,20 +142,20 @@
/*************************************************************************/
FT_LOCAL_DEF( void )
- T1_GlyphSlot_Done( T1_GlyphSlot slot )
+ T1_GlyphSlot_Done( FT_GlyphSlot slot )
{
- slot->root.internal->glyph_hints = 0;
+ slot->internal->glyph_hints = 0;
}
FT_LOCAL_DEF( FT_Error )
- T1_GlyphSlot_Init( T1_GlyphSlot slot )
+ T1_GlyphSlot_Init( FT_GlyphSlot slot )
{
T1_Face face;
PSHinter_Service pshinter;
- face = (T1_Face)slot->root.face;
+ face = (T1_Face)slot->face;
pshinter = (PSHinter_Service)face->pshinter;
if ( pshinter )
@@ -158,15 +163,18 @@
FT_Module module;
- module = FT_Get_Module( slot->root.face->driver->root.library, "pshinter" );
- if (module)
+ module = FT_Get_Module( slot->face->driver->root.library,
+ "pshinter" );
+ if ( module )
{
T1_Hints_Funcs funcs;
+
funcs = pshinter->get_t1_funcs( module );
- slot->root.internal->glyph_hints = (void*)funcs;
+ slot->internal->glyph_hints = (void*)funcs;
}
}
+
return 0;
}
@@ -190,8 +198,9 @@
/* face :: A typeless pointer to the face object to destroy. */
/* */
FT_LOCAL_DEF( void )
- T1_Face_Done( T1_Face face )
+ T1_Face_Done( FT_Face t1face ) /* T1_Face */
{
+ T1_Face face = (T1_Face)t1face;
FT_Memory memory;
T1_Font type1;
@@ -289,11 +298,12 @@
/* */
FT_LOCAL_DEF( FT_Error )
T1_Face_Init( FT_Stream stream,
- T1_Face face,
+ FT_Face t1face, /* T1_Face */
FT_Int face_index,
FT_Int num_params,
FT_Parameter* params )
{
+ T1_Face face = (T1_Face)t1face;
FT_Error error;
FT_Service_PsCMaps psnames;
PSAux_Service psaux;
@@ -313,10 +323,18 @@
face->psaux = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ),
"psaux" );
psaux = (PSAux_Service)face->psaux;
+ if ( !psaux )
+ {
+ FT_ERROR(( "T1_Face_Init: cannot access `psaux' module\n" ));
+ error = FT_THROW( Missing_Module );
+ goto Exit;
+ }
face->pshinter = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ),
"pshinter" );
+ FT_TRACE2(( "Type 1 driver\n" ));
+
/* open the tokenizer; this will also check the font format */
error = T1_Open_Face( face );
if ( error )
@@ -330,7 +348,7 @@
if ( face_index > 0 )
{
FT_ERROR(( "T1_Face_Init: invalid face index\n" ));
- error = T1_Err_Invalid_Argument;
+ error = FT_THROW( Invalid_Argument );
goto Exit;
}
@@ -346,10 +364,10 @@
root->num_glyphs = type1->num_glyphs;
root->face_index = 0;
- root->face_flags = FT_FACE_FLAG_SCALABLE |
- FT_FACE_FLAG_HORIZONTAL |
- FT_FACE_FLAG_GLYPH_NAMES |
- FT_FACE_FLAG_HINTER;
+ root->face_flags |= FT_FACE_FLAG_SCALABLE |
+ FT_FACE_FLAG_HORIZONTAL |
+ FT_FACE_FLAG_GLYPH_NAMES |
+ FT_FACE_FLAG_HINTER;
if ( info->is_fixed_pitch )
root->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
@@ -447,7 +465,7 @@
root->bbox.xMax = ( type1->font_bbox.xMax + 0xFFFF ) >> 16;
root->bbox.yMax = ( type1->font_bbox.yMax + 0xFFFF ) >> 16;
- /* Set units_per_EM if we didn't set it in parse_font_matrix. */
+ /* Set units_per_EM if we didn't set it in t1_parse_font_matrix. */
if ( !root->units_per_EM )
root->units_per_EM = 1000;
@@ -471,7 +489,7 @@
if ( !error )
root->max_advance_width = (FT_Short)FIXED_TO_INT( max_advance );
else
- error = T1_Err_Ok; /* clear error */
+ error = FT_Err_Ok; /* clear error */
}
root->max_advance_height = root->height;
@@ -484,7 +502,7 @@
FT_Face root = &face->root;
- if ( psnames && psaux )
+ if ( psnames )
{
FT_CharMapRec charmap;
T1_CMap_Classes cmap_classes = psaux->t1_cmap_classes;
@@ -494,14 +512,18 @@
charmap.face = root;
/* first of all, try to synthesize a Unicode charmap */
- charmap.platform_id = 3;
- charmap.encoding_id = 1;
+ charmap.platform_id = TT_PLATFORM_MICROSOFT;
+ charmap.encoding_id = TT_MS_ID_UNICODE_CS;
charmap.encoding = FT_ENCODING_UNICODE;
- FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL );
+ error = FT_CMap_New( cmap_classes->unicode, NULL, &charmap, NULL );
+ if ( error &&
+ FT_ERR_NEQ( error, No_Unicode_Glyph_Name ) )
+ goto Exit;
+ error = FT_Err_Ok;
/* now, generate an Adobe Standard encoding when appropriate */
- charmap.platform_id = 7;
+ charmap.platform_id = TT_PLATFORM_ADOBE;
clazz = NULL;
switch ( type1->encoding_type )
@@ -535,7 +557,7 @@
}
if ( clazz )
- FT_CMap_New( clazz, NULL, &charmap, NULL );
+ error = FT_CMap_New( clazz, NULL, &charmap, NULL );
#if 0
/* Select default charmap */
@@ -565,11 +587,11 @@
/* FreeType error code. 0 means success. */
/* */
FT_LOCAL_DEF( FT_Error )
- T1_Driver_Init( T1_Driver driver )
+ T1_Driver_Init( FT_Module driver )
{
FT_UNUSED( driver );
- return T1_Err_Ok;
+ return FT_Err_Ok;
}
@@ -585,7 +607,7 @@
/* driver :: A handle to the target Type 1 driver. */
/* */
FT_LOCAL_DEF( void )
- T1_Driver_Done( T1_Driver driver )
+ T1_Driver_Done( FT_Module driver )
{
FT_UNUSED( driver );
}