diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2022-05-19 09:58:31 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2022-05-23 19:25:46 +0000 |
commit | d88da0b2b0a8abaaa521bef864378fe1dbf86709 (patch) | |
tree | 4795f260c1ceaaeeb2cbe64f8314d604e0a7cbe7 /src/3rdparty/harfbuzz-ng/src/hb-style.cc | |
parent | 0d97723ee2778203af0cfd13599572110fb69dd5 (diff) |
Update Harfbuzz to version 4.2.1
[ChangeLog][QtGui][Text] Updated the Harfbuzz code included with
Qt to version 4.2.1.
Pick-to: 6.2 6.3
Fixes: QTBUG-103603
Change-Id: I45fdde8fd0772e4470304c5f6f5a876666356d04
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src/hb-style.cc')
-rw-r--r-- | src/3rdparty/harfbuzz-ng/src/hb-style.cc | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-style.cc b/src/3rdparty/harfbuzz-ng/src/hb-style.cc index dfb1017c88..c7d7d713c2 100644 --- a/src/3rdparty/harfbuzz-ng/src/hb-style.cc +++ b/src/3rdparty/harfbuzz-ng/src/hb-style.cc @@ -46,15 +46,14 @@ static inline float _hb_angle_to_ratio (float a) { - return tanf (a * float (M_PI / 180.)); + return tanf (a * float (-M_PI / 180.)); } -#if 0 + static inline float _hb_ratio_to_angle (float r) { - return atanf (r) * float (180. / M_PI); + return atanf (r) * float (-180. / M_PI); } -#endif /** * hb_style_get_value: @@ -109,11 +108,20 @@ hb_style_get_value (hb_font_t *font, hb_style_tag_t style_tag) : 12.f; } case HB_STYLE_TAG_SLANT_ANGLE: - return face->table.post->table->italicAngle.to_float (); + { + float angle = face->table.post->table->italicAngle.to_float (); + + if (font->slant) + angle = _hb_ratio_to_angle (font->slant + _hb_angle_to_ratio (angle)); + + return angle; + } case HB_STYLE_TAG_WIDTH: return face->table.OS2->has_data () ? face->table.OS2->get_width () - : (face->table.head->is_condensed () ? 75 : 100); + : (face->table.head->is_condensed () ? 75 : + face->table.head->is_expanded () ? 125 : + 100); case HB_STYLE_TAG_WEIGHT: return face->table.OS2->has_data () ? face->table.OS2->usWeightClass |