summaryrefslogtreecommitdiffstats
path: root/thirdparty/harfbuzz/src/hb-style.cc
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2022-02-02 16:04:28 +0200
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2022-02-02 22:29:31 +0200
commit5676b3c022874c6a636073792e4be5ee3abd170d (patch)
treec035a23fc7e9273160ac5004d46f096e42a89ed7 /thirdparty/harfbuzz/src/hb-style.cc
parentca42bfb2a5c91a52ea14302aa3bbf7292e387b9b (diff)
downloadredot-engine-5676b3c022874c6a636073792e4be5ee3abd170d.tar.gz
HarfBuzz: Update to version 3.3.1
Diffstat (limited to 'thirdparty/harfbuzz/src/hb-style.cc')
-rw-r--r--thirdparty/harfbuzz/src/hb-style.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/thirdparty/harfbuzz/src/hb-style.cc b/thirdparty/harfbuzz/src/hb-style.cc
index f1b44cea53..c0c5c4832c 100644
--- a/thirdparty/harfbuzz/src/hb-style.cc
+++ b/thirdparty/harfbuzz/src/hb-style.cc
@@ -48,13 +48,12 @@ _hb_angle_to_ratio (float a)
{
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);
}
-#endif
/**
* hb_style_get_value:
@@ -73,7 +72,8 @@ float
hb_style_get_value (hb_font_t *font, hb_style_tag_t style_tag)
{
if (unlikely (style_tag == HB_STYLE_TAG_SLANT_RATIO))
- return _hb_angle_to_ratio (hb_style_get_value (font, HB_STYLE_TAG_SLANT_ANGLE));
+ return _hb_angle_to_ratio (hb_style_get_value (font, HB_STYLE_TAG_SLANT_ANGLE))
+ + font->slant;
hb_face_t *face = font->face;
@@ -109,7 +109,14 @@ 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 ()