|
|
|
@ -90,7 +90,7 @@ |
|
|
|
|
FT_LOCAL_DEF( FT_Error ) |
|
|
|
|
T1_Size_Init( T1_Size size ) |
|
|
|
|
{ |
|
|
|
|
FT_Error error = 0; |
|
|
|
|
FT_Error error = T1_Err_Ok; |
|
|
|
|
PSH_Globals_Funcs funcs = T1_Size_Get_Globals_Funcs( size ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -254,8 +254,8 @@ |
|
|
|
|
face->unicode_map = NULL; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
face->root.family_name = 0; |
|
|
|
|
face->root.style_name = 0; |
|
|
|
|
face->root.family_name = NULL; |
|
|
|
|
face->root.style_name = NULL; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -355,15 +355,19 @@ |
|
|
|
|
|
|
|
|
|
/* XXX: TODO -- add kerning with .afm support */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* The following code to extract the family and the style is very */ |
|
|
|
|
/* simplistic and might get some things wrong. For a full-featured */ |
|
|
|
|
/* algorithm you might have a look at the whitepaper given at */ |
|
|
|
|
/* */ |
|
|
|
|
/* http://blogs.msdn.com/text/archive/2007/04/23/wpf-font-selection-model.aspx */ |
|
|
|
|
|
|
|
|
|
/* get style name -- be careful, some broken fonts only */ |
|
|
|
|
/* have a `/FontName' dictionary entry! */ |
|
|
|
|
root->family_name = info->family_name; |
|
|
|
|
/* assume "Regular" style if we don't know better */ |
|
|
|
|
root->style_name = (char *)"Regular"; |
|
|
|
|
root->style_name = NULL; |
|
|
|
|
|
|
|
|
|
if ( info->weight ) |
|
|
|
|
root->style_name = info->weight; |
|
|
|
|
else if ( root->family_name ) |
|
|
|
|
if ( root->family_name ) |
|
|
|
|
{ |
|
|
|
|
char* full = info->full_name; |
|
|
|
|
char* family = root->family_name; |
|
|
|
@ -401,6 +405,15 @@ |
|
|
|
|
root->family_name = type1->font_name; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ( !root->style_name ) |
|
|
|
|
{ |
|
|
|
|
if ( info->weight ) |
|
|
|
|
root->style_name = info->weight; |
|
|
|
|
else |
|
|
|
|
/* assume "Regular" style because we don't know better */ |
|
|
|
|
root->style_name = (char *)"Regular"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* compute style flags */ |
|
|
|
|
root->style_flags = 0; |
|
|
|
|
if ( info->italic_angle ) |
|
|
|
@ -445,7 +458,7 @@ |
|
|
|
|
if ( !error ) |
|
|
|
|
root->max_advance_width = (FT_Short)max_advance; |
|
|
|
|
else |
|
|
|
|
error = 0; /* clear error */ |
|
|
|
|
error = T1_Err_Ok; /* clear error */ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
root->max_advance_height = root->height; |
|
|
|
|