478 |
CFF_FontRecDict dict; |
CFF_FontRecDict dict; |
479 |
FT_Memory memory = cffface->memory; |
FT_Memory memory = cffface->memory; |
480 |
FT_Int32 flags; |
FT_Int32 flags; |
481 |
|
FT_UInt i; |
482 |
|
|
483 |
|
|
484 |
if ( FT_NEW( cff ) ) |
if ( FT_NEW( cff ) ) |
536 |
cffface->height = (FT_Short)( |
cffface->height = (FT_Short)( |
537 |
( ( cffface->ascender - cffface->descender ) * 12 ) / 10 ); |
( ( cffface->ascender - cffface->descender ) * 12 ) / 10 ); |
538 |
|
|
539 |
if ( dict->units_per_em ) |
if ( !dict->units_per_em ) |
540 |
cffface->units_per_EM = dict->units_per_em; |
dict->units_per_em = 1000; |
541 |
else |
|
542 |
cffface->units_per_EM = 1000; |
cffface->units_per_EM = dict->units_per_em; |
543 |
|
|
544 |
cffface->underline_position = |
cffface->underline_position = |
545 |
(FT_Short)( dict->underline_position >> 16 ); |
(FT_Short)( dict->underline_position >> 16 ); |
686 |
cffface->style_flags = flags; |
cffface->style_flags = flags; |
687 |
} |
} |
688 |
|
|
689 |
|
/* handle font matrix settings in subfonts (if any) */ |
690 |
|
for ( i = cff->num_subfonts; i > 0; i-- ) |
691 |
|
{ |
692 |
|
CFF_FontRecDict sub = &cff->subfonts[i - 1]->font_dict; |
693 |
|
CFF_FontRecDict top = &cff->top_font.font_dict; |
694 |
|
|
695 |
|
|
696 |
|
if ( sub->units_per_em ) |
697 |
|
{ |
698 |
|
FT_Matrix scale; |
699 |
|
|
700 |
|
|
701 |
|
scale.xx = scale.yy = (FT_Fixed)FT_DivFix( top->units_per_em, |
702 |
|
sub->units_per_em ); |
703 |
|
scale.xy = scale.yx = 0; |
704 |
|
|
705 |
|
FT_Matrix_Multiply( &scale, &sub->font_matrix ); |
706 |
|
FT_Vector_Transform( &sub->font_offset, &scale ); |
707 |
|
} |
708 |
|
else |
709 |
|
{ |
710 |
|
sub->font_matrix = top->font_matrix; |
711 |
|
sub->font_offset = top->font_offset; |
712 |
|
} |
713 |
|
} |
714 |
|
|
715 |
#ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES |
#ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES |
716 |
/* CID-keyed CFF fonts don't have glyph names -- the SFNT loader */ |
/* CID-keyed CFF fonts don't have glyph names -- the SFNT loader */ |
717 |
/* has unset this flag because of the 3.0 `post' table */ |
/* has unset this flag because of the 3.0 `post' table */ |