mirror of
https://gitlab.freedesktop.org/freetype/freetype.git
synced 2025-12-26 03:30:05 +01:00
[cff] Handle underline position and thickness as integers.
This is done for consistency with Type 1 fonts. * include/freetype/internal/cfftypes.h (CFF_FontRecDic): Change the variable types. * include/cff/cfftoken.h (CFF_FontRecDic): Change the parsing macros. * src/cff/cffobjs.c (cff_face_init), src/cff/cffload.c (cff_subfont_load), src/cff/cffdrivr.c (cff_ps_get_font_info): Update users.
This commit is contained in:
parent
c97efd28ca
commit
fc9cc5038e
5 changed files with 10 additions and 14 deletions
|
|
@ -191,8 +191,8 @@ FT_BEGIN_HEADER
|
|||
FT_UInt weight;
|
||||
FT_Bool is_fixed_pitch;
|
||||
FT_Fixed italic_angle;
|
||||
FT_Fixed underline_position;
|
||||
FT_Fixed underline_thickness;
|
||||
FT_Short underline_position;
|
||||
FT_UShort underline_thickness;
|
||||
FT_Int paint_type;
|
||||
FT_Int charstring_type;
|
||||
FT_Matrix font_matrix;
|
||||
|
|
|
|||
|
|
@ -456,10 +456,8 @@
|
|||
dict->weight );
|
||||
font_info->italic_angle = dict->italic_angle;
|
||||
font_info->is_fixed_pitch = dict->is_fixed_pitch;
|
||||
font_info->underline_position =
|
||||
(FT_Short)( dict->underline_position >> 16 );
|
||||
font_info->underline_thickness =
|
||||
(FT_UShort)( dict->underline_thickness >> 16 );
|
||||
font_info->underline_position = dict->underline_position;
|
||||
font_info->underline_thickness = dict->underline_thickness;
|
||||
|
||||
cff->font_info = font_info;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2014,8 +2014,8 @@
|
|||
/* set defaults */
|
||||
FT_ZERO( top );
|
||||
|
||||
top->underline_position = -( 100L << 16 );
|
||||
top->underline_thickness = 50L << 16;
|
||||
top->underline_position = -100;
|
||||
top->underline_thickness = 50;
|
||||
top->charstring_type = 2;
|
||||
top->font_matrix.xx = 0x10000L;
|
||||
top->font_matrix.yy = 0x10000L;
|
||||
|
|
|
|||
|
|
@ -846,10 +846,8 @@
|
|||
cffface->height = (FT_Short)( cffface->ascender -
|
||||
cffface->descender );
|
||||
|
||||
cffface->underline_position =
|
||||
(FT_Short)( dict->underline_position >> 16 );
|
||||
cffface->underline_thickness =
|
||||
(FT_Short)( dict->underline_thickness >> 16 );
|
||||
cffface->underline_position = (FT_Short)dict->underline_position;
|
||||
cffface->underline_thickness = (FT_Short)dict->underline_thickness;
|
||||
|
||||
/* retrieve font family & style name */
|
||||
if ( dict->family_name )
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@
|
|||
CFF_FIELD_STRING ( 4, weight, "Weight" )
|
||||
CFF_FIELD_BOOL ( 0x101, is_fixed_pitch, "isFixedPitch" )
|
||||
CFF_FIELD_FIXED ( 0x102, italic_angle, "ItalicAngle" )
|
||||
CFF_FIELD_FIXED ( 0x103, underline_position, "UnderlinePosition" )
|
||||
CFF_FIELD_FIXED ( 0x104, underline_thickness, "UnderlineThickness" )
|
||||
CFF_FIELD_NUM ( 0x103, underline_position, "UnderlinePosition" )
|
||||
CFF_FIELD_NUM ( 0x104, underline_thickness, "UnderlineThickness" )
|
||||
CFF_FIELD_NUM ( 0x105, paint_type, "PaintType" )
|
||||
CFF_FIELD_NUM ( 0x106, charstring_type, "CharstringType" )
|
||||
CFF_FIELD_CALLBACK( 0x107, font_matrix, "FontMatrix" )
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue