diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-02-20 01:01:00 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2019-02-20 09:51:12 +0100 |
commit | 035f934d7a798e97bf0213a5d42a3d511132f03d (patch) | |
tree | 89aa6efdc86864ce479cddca6b9c4ba523c2754a /src/3rdparty/freetype/src/pfr/pfrobjs.c | |
parent | f4cc23cffbe3005f0a522cac938695e87ecd6407 (diff) | |
parent | da4ab444ffac37514435364d4d3f0ad59d4f9bc3 (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
Added tests/auto/testlib/selftests/expected_crashes_5.txt to work
round the output of the crashes test (which exercises UB, see
QTBUG-73903) being truncated on one test platform.
Change-Id: I9cd3f2639b4e50c3c4513e14629a40bdca8f8273
Diffstat (limited to 'src/3rdparty/freetype/src/pfr/pfrobjs.c')
-rw-r--r-- | src/3rdparty/freetype/src/pfr/pfrobjs.c | 45 |
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 */ |