From c65defc5b1af26baebcb06b7db435bbc476219a3 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 24 Jan 2022 23:42:22 -0500 Subject: docs: Add some illustrations for extents --- docs/line-height1-dark.png | Bin 0 -> 23832 bytes docs/line-height1-light.png | Bin 0 -> 22636 bytes docs/line-height1.png | Bin 0 -> 17950 bytes docs/line-height1.svg | 1495 ++++++++++++++++++++++++++++++++++++ docs/line-height2-dark.png | Bin 0 -> 34243 bytes docs/line-height2-light.png | Bin 0 -> 28596 bytes docs/line-height2.svg | 1772 +++++++++++++++++++++++++++++++++++++++++++ docs/line-height3-dark.png | Bin 0 -> 32246 bytes docs/line-height3-light.png | Bin 0 -> 27017 bytes docs/line-height3.svg | 1752 ++++++++++++++++++++++++++++++++++++++++++ docs/meson.build | 6 + docs/pango.toml.in | 6 + pango/pango-layout-line.c | 25 + 13 files changed, 5056 insertions(+) create mode 100644 docs/line-height1-dark.png create mode 100644 docs/line-height1-light.png create mode 100644 docs/line-height1.png create mode 100644 docs/line-height1.svg create mode 100644 docs/line-height2-dark.png create mode 100644 docs/line-height2-light.png create mode 100644 docs/line-height2.svg create mode 100644 docs/line-height3-dark.png create mode 100644 docs/line-height3-light.png create mode 100644 docs/line-height3.svg diff --git a/docs/line-height1-dark.png b/docs/line-height1-dark.png new file mode 100644 index 00000000..b9db78e4 Binary files /dev/null and b/docs/line-height1-dark.png differ diff --git a/docs/line-height1-light.png b/docs/line-height1-light.png new file mode 100644 index 00000000..f080640c Binary files /dev/null and b/docs/line-height1-light.png differ diff --git a/docs/line-height1.png b/docs/line-height1.png new file mode 100644 index 00000000..16251347 Binary files /dev/null and b/docs/line-height1.png differ diff --git a/docs/line-height1.svg b/docs/line-height1.svg new file mode 100644 index 00000000..c4a073d4 --- /dev/null +++ b/docs/line-height1.svg @@ -0,0 +1,1495 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + M + Nq + + + + + + + + + + + + + Height + Ascent + Descent + Baseline + Half-Leading + + + + + + + + To + + + diff --git a/docs/line-height2-dark.png b/docs/line-height2-dark.png new file mode 100644 index 00000000..4988f208 Binary files /dev/null and b/docs/line-height2-dark.png differ diff --git a/docs/line-height2-light.png b/docs/line-height2-light.png new file mode 100644 index 00000000..a916ccde Binary files /dev/null and b/docs/line-height2-light.png differ diff --git a/docs/line-height2.svg b/docs/line-height2.svg new file mode 100644 index 00000000..0343752f --- /dev/null +++ b/docs/line-height2.svg @@ -0,0 +1,1772 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + M + Nq + + + + + + + + + + + + To + Vp + + + + + + Spacing + Height + Logical Extents + Ink Extents + Spacing + + + + + + + diff --git a/docs/line-height3-dark.png b/docs/line-height3-dark.png new file mode 100644 index 00000000..8f1f4b64 Binary files /dev/null and b/docs/line-height3-dark.png differ diff --git a/docs/line-height3-light.png b/docs/line-height3-light.png new file mode 100644 index 00000000..7f2a6657 Binary files /dev/null and b/docs/line-height3-light.png differ diff --git a/docs/line-height3.svg b/docs/line-height3.svg new file mode 100644 index 00000000..f46181ee --- /dev/null +++ b/docs/line-height3.svg @@ -0,0 +1,1752 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + M + Nq + + + + + + + + + + To + Vp + + + Line Height + Logical Extents + Ink Extents + + + + + + diff --git a/docs/meson.build b/docs/meson.build index 100deb39..4b2f09a0 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -44,6 +44,12 @@ pango_content_files = [ 'glyphstring-positions-dark.png', 'baseline-shift-light.png', 'baseline-shift-dark.png', + 'line-height1-light.png', + 'line-height1-dark.png', + 'line-height2-light.png', + 'line-height2-dark.png', + 'line-height3-light.png', + 'line-height3-dark.png', ] doc_conf = configuration_data() diff --git a/docs/pango.toml.in b/docs/pango.toml.in index 77b860a2..9babafba 100644 --- a/docs/pango.toml.in +++ b/docs/pango.toml.in @@ -103,6 +103,12 @@ content_images = [ "glyphstring-positions-dark.png", "baseline-shift-light.png", "baseline-shift-dark.png", + "line-height1-light.png", + "line-height1-dark.png", + "line-height2-light.png", + "line-height2-dark.png", + "line-height3-light.png", + "line-height3-dark.png", ] urlmap_file = "urlmap.js" diff --git a/pango/pango-layout-line.c b/pango/pango-layout-line.c index f7150598..3f1583a5 100644 --- a/pango/pango-layout-line.c +++ b/pango/pango-layout-line.c @@ -920,6 +920,31 @@ pango_layout_line_justify (PangoLayoutLine *line, * If you need extents with trimmed leading, use [method@Pango.LayoutLine.get_trimmed_extents]. * * Note that the origin is at the left end of the baseline. + * + * Pango is following CSS in splitting the external leading, and giving one half of it + * to the line above, and the other half the the line below. Unless the line height is set + * via attributes, the external leading is determined as the difference between the + * height and ascent + descent in font metrics: + * + * + * + * Pango Font Metrics + * + * + * If spacing is set, it also gets split, for the purpose of determining the + * logical extents. + * + * + * + * Pango Extents and Spacing + * + * + * If line height is set, it determines the logical extents. + * + * + * + * Pango Extents and Line Height + * */ void pango_layout_line_get_extents (PangoLayoutLine *line, -- cgit v1.2.1