|
|
|
@ -4,7 +4,7 @@ |
|
|
|
|
/* */ |
|
|
|
|
/* OpenType font driver implementation (body). */ |
|
|
|
|
/* */ |
|
|
|
|
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */ |
|
|
|
|
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ |
|
|
|
|
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
|
|
|
|
/* */ |
|
|
|
|
/* This file is part of the FreeType project, and may only be used, */ |
|
|
|
@ -302,9 +302,57 @@ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static FT_Error |
|
|
|
|
cff_ps_get_font_info( CFF_Face face, |
|
|
|
|
PS_FontInfoRec* afont_info ) |
|
|
|
|
{ |
|
|
|
|
CFF_Font cff = (CFF_Font)face->extra.data; |
|
|
|
|
FT_Error error = FT_Err_Ok; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( cff && cff->font_info == NULL ) |
|
|
|
|
{ |
|
|
|
|
CFF_FontRecDict dict = &cff->top_font.font_dict; |
|
|
|
|
PS_FontInfoRec *font_info; |
|
|
|
|
FT_Memory memory = face->root.memory; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( FT_ALLOC( font_info, sizeof ( *font_info ) ) ) |
|
|
|
|
goto Fail; |
|
|
|
|
|
|
|
|
|
font_info->version = cff_index_get_sid_string( &cff->string_index, |
|
|
|
|
dict->version, |
|
|
|
|
cff->psnames ); |
|
|
|
|
font_info->notice = cff_index_get_sid_string( &cff->string_index, |
|
|
|
|
dict->notice, |
|
|
|
|
cff->psnames ); |
|
|
|
|
font_info->full_name = cff_index_get_sid_string( &cff->string_index, |
|
|
|
|
dict->full_name, |
|
|
|
|
cff->psnames ); |
|
|
|
|
font_info->family_name = cff_index_get_sid_string( &cff->string_index, |
|
|
|
|
dict->family_name, |
|
|
|
|
cff->psnames ); |
|
|
|
|
font_info->weight = cff_index_get_sid_string( &cff->string_index, |
|
|
|
|
dict->weight, |
|
|
|
|
cff->psnames ); |
|
|
|
|
font_info->italic_angle = dict->italic_angle; |
|
|
|
|
font_info->is_fixed_pitch = dict->is_fixed_pitch; |
|
|
|
|
font_info->underline_position = dict->underline_position; |
|
|
|
|
font_info->underline_thickness = dict->underline_thickness; |
|
|
|
|
|
|
|
|
|
cff->font_info = font_info; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
*afont_info = *cff->font_info; |
|
|
|
|
|
|
|
|
|
Fail: |
|
|
|
|
return error; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const FT_Service_PsInfoRec cff_service_ps_info = |
|
|
|
|
{ |
|
|
|
|
(PS_GetFontInfoFunc) NULL, /* unsupported with CFF fonts */ |
|
|
|
|
(PS_GetFontInfoFunc) cff_ps_get_font_info, |
|
|
|
|
(PS_HasGlyphNamesFunc) cff_ps_has_glyph_names, |
|
|
|
|
(PS_GetFontPrivateFunc)NULL /* unsupported with CFF fonts */ |
|
|
|
|
}; |
|
|
|
|