summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/pfr/pfrobjs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/src/pfr/pfrobjs.c')
-rw-r--r--src/3rdparty/freetype/src/pfr/pfrobjs.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/src/3rdparty/freetype/src/pfr/pfrobjs.c b/src/3rdparty/freetype/src/pfr/pfrobjs.c
index b854b00ba8..737b97b5ff 100644
--- a/src/3rdparty/freetype/src/pfr/pfrobjs.c
+++ b/src/3rdparty/freetype/src/pfr/pfrobjs.c
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR object methods (body). */
/* */
-/* Copyright 2002-2015 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -118,9 +118,11 @@
/* load the face */
error = pfr_log_font_load(
- &face->log_font, stream, (FT_UInt)( face_index & 0xFFFF ),
- face->header.log_dir_offset,
- FT_BOOL( face->header.phy_font_max_size_high != 0 ) );
+ &face->log_font,
+ stream,
+ (FT_UInt)( face_index & 0xFFFF ),
+ face->header.log_dir_offset,
+ FT_BOOL( face->header.phy_font_max_size_high != 0 ) );
if ( error )
goto Exit;
@@ -141,8 +143,8 @@
pfrface->face_flags |= FT_FACE_FLAG_SCALABLE;
- /* if all characters point to the same gps_offset 0, we */
- /* assume that the font only contains bitmaps */
+ /* if gps_offset == 0 for all characters, we */
+ /* assume that the font only contains bitmaps */
{
FT_UInt nn;
@@ -164,7 +166,7 @@
}
}
- if ( (phy_font->flags & PFR_PHY_PROPORTIONAL) == 0 )
+ if ( ( phy_font->flags & PFR_PHY_PROPORTIONAL ) == 0 )
pfrface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
if ( phy_font->flags & PFR_PHY_VERTICAL )
@@ -178,16 +180,16 @@
if ( phy_font->num_kern_pairs > 0 )
pfrface->face_flags |= FT_FACE_FLAG_KERNING;
- /* If no family name was found in the "undocumented" auxiliary
+ /* If no family name was found in the `undocumented' auxiliary
* data, use the font ID instead. This sucks but is better than
* nothing.
*/
pfrface->family_name = phy_font->family_name;
- if ( pfrface->family_name == NULL )
+ if ( !pfrface->family_name )
pfrface->family_name = phy_font->font_id;
/* note that the style name can be NULL in certain PFR fonts,
- * probably meaning "Regular"
+ * probably meaning `Regular'
*/
pfrface->style_name = phy_font->style_name;
@@ -262,15 +264,9 @@
charmap.encoding = FT_ENCODING_UNICODE;
error = FT_CMap_New( &pfr_cmap_class_rec, NULL, &charmap, NULL );
-
-#if 0
- /* Select default charmap */
- if ( pfrface->num_charmaps )
- pfrface->charmap = pfrface->charmaps[0];
-#endif
}
- /* check whether we've loaded any kerning pairs */
+ /* check whether we have loaded any kerning pairs */
if ( phy_font->num_kern_pairs )
pfrface->face_flags |= FT_FACE_FLAG_KERNING;
}
@@ -340,8 +336,12 @@
/* try to load an embedded bitmap */
if ( ( load_flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP ) ) == 0 )
{
- error = pfr_slot_load_bitmap( slot, size, gindex );
- if ( error == 0 )
+ error = pfr_slot_load_bitmap(
+ slot,
+ size,
+ gindex,
+ ( load_flags & FT_LOAD_BITMAP_METRICS_ONLY ) != 0 );
+ if ( !error )
goto Exit;
}
@@ -402,7 +402,7 @@
pfrslot->linearHoriAdvance = metrics->horiAdvance;
pfrslot->linearVertAdvance = metrics->vertAdvance;
- /* make-up vertical metrics(?) */
+ /* make up vertical metrics(?) */
metrics->vertBearingX = 0;
metrics->vertBearingY = 0;
@@ -522,8 +522,8 @@
FT_UInt probe = power * size;
FT_UInt extra = count - power;
FT_Byte* base = stream->cursor;
- FT_Bool twobytes = FT_BOOL( item->flags & 1 );
- FT_Bool twobyte_adj = FT_BOOL( item->flags & 2 );
+ FT_Bool twobytes = FT_BOOL( item->flags & PFR_KERN_2BYTE_CHAR );
+ FT_Bool twobyte_adj = FT_BOOL( item->flags & PFR_KERN_2BYTE_ADJ );
FT_Byte* p;
FT_UInt32 cpair;
@@ -596,4 +596,5 @@
return error;
}
+
/* END */