[pango/small-caps: 10/11] itemize: Handle PANGO_FONT_SCALE_PETITE_CAPS
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/small-caps: 10/11] itemize: Handle PANGO_FONT_SCALE_PETITE_CAPS
- Date: Sun, 7 Nov 2021 03:56:16 +0000 (UTC)
commit 9f691c300fb83b985c133d6bbf04a894d3c292dc
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Nov 6 23:51:09 2021 -0400
itemize: Handle PANGO_FONT_SCALE_PETITE_CAPS
For lack of a better idea, simply multiply the
value we use for Small Caps by 0.8.
This is not used by anything yet.
pango/itemize.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
diff --git a/pango/itemize.c b/pango/itemize.c
index e8267725..f115abdf 100644
--- a/pango/itemize.c
+++ b/pango/itemize.c
@@ -1103,6 +1103,18 @@ collect_font_scale (PangoContext *context,
else
entry->scale = 0.8;
break;
+ case PANGO_FONT_SCALE_PETITE_CAPS:
+ if (hb_font &&
+ hb_ot_metrics_get_position (hb_font,
+ HB_OT_METRICS_TAG_CAP_HEIGHT,
+ &cap_height) &&
+ hb_ot_metrics_get_position (hb_font,
+ HB_OT_METRICS_TAG_X_HEIGHT,
+ &x_height))
+ entry->scale = 0.8 * x_height / (double) cap_height;
+ else
+ entry->scale = 0.8 * 0.8;
+ break;
default:
g_assert_not_reached ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]