diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-08-09 01:29:36 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-08-09 01:29:36 -0400 |
commit | 2606e8e02580894a483beb2f2a282b37cdf05631 (patch) | |
tree | 185248260832095e436d34fa5f28c01c31196e40 | |
parent | 2cad08ac322c5601d3f86e0fd676abdfcd23aea8 (diff) | |
download | pango-2606e8e02580894a483beb2f2a282b37cdf05631.tar.gz |
docs: Add an example for split cursors
Show how weak and strong cursors look in
practice.
Fixes: #77
-rw-r--r-- | docs/meson.build | 3 | ||||
-rw-r--r-- | docs/pango.toml.in | 2 | ||||
-rw-r--r-- | docs/split-cursor-dark.png | bin | 0 -> 10603 bytes | |||
-rw-r--r-- | docs/split-cursor-light.png | bin | 0 -> 10248 bytes | |||
-rw-r--r-- | docs/split-cursor.png | bin | 0 -> 10944 bytes | |||
-rw-r--r-- | pango/pango-layout.c | 16 |
6 files changed, 20 insertions, 1 deletions
diff --git a/docs/meson.build b/docs/meson.build index 37a2a9b3..6bdfc1f7 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -31,6 +31,9 @@ pango_content_files = [ 'bidi-input-dark.png', 'bidi-annotate-light.png', 'bidi-annotate-dark.png', + 'split-cursor.png', + 'split-cursor-light.png', + 'split-cursor-dark.png' ] doc_conf = configuration_data() diff --git a/docs/pango.toml.in b/docs/pango.toml.in index 4317adf4..f5e58194 100644 --- a/docs/pango.toml.in +++ b/docs/pango.toml.in @@ -90,4 +90,6 @@ content_images = [ "bidi-input-dark.png", "bidi-annotate-light.png", "bidi-annotate-dark.png", + "split-cursor-light.png", + "split-cursor-dark.png", ] diff --git a/docs/split-cursor-dark.png b/docs/split-cursor-dark.png Binary files differnew file mode 100644 index 00000000..141d818c --- /dev/null +++ b/docs/split-cursor-dark.png diff --git a/docs/split-cursor-light.png b/docs/split-cursor-light.png Binary files differnew file mode 100644 index 00000000..2ace0c18 --- /dev/null +++ b/docs/split-cursor-light.png diff --git a/docs/split-cursor.png b/docs/split-cursor.png Binary files differnew file mode 100644 index 00000000..b2be8021 --- /dev/null +++ b/docs/split-cursor.png diff --git a/pango/pango-layout.c b/pango/pango-layout.c index 557f16f5..fa13ad59 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -2431,11 +2431,25 @@ pango_layout_get_direction (PangoLayout *layout, * Given an index within a layout, determines the positions that of the * strong and weak cursors if the insertion point is at that index. * - * The position of each cursor is stored as a zero-width rectangle. + * The position of each cursor is stored as a zero-width rectangle + * with the height of the run extents. + * * The strong cursor location is the location where characters of the * directionality equal to the base direction of the layout are inserted. * The weak cursor location is the location where characters of the * directionality opposite to the base direction of the layout are inserted. + * + * The following example shows text with both a strong and a weak cursor. + * + * <picture> + * <source srcset="split-cursor-dark.png" media="(prefers-color-scheme: dark)"> + * <img alt="strong and weak cursors" src="split-cursor-light.png"> + * </picture> + * + * The strong cursor has a little arrow pointing to the right, the weak + * cursor to the left. Typing a 'c' in this situation will insert the + * character after the 'b', and typing another Hebrew character, like 'ג', + * will insert it at the end. */ void pango_layout_get_cursor_pos (PangoLayout *layout, |