[pango/layout-docs] docs: Add more details




commit b69c5063162d779020f331f291431e250a769d5c
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Aug 8 14:02:25 2021 -0400

    docs: Add more details
    
    Add some visualization of alignment and justification
    to the PangoLayout docs.

 docs/align-center-justify.png | Bin 0 -> 649 bytes
 docs/align-center.png         | Bin 0 -> 539 bytes
 docs/align-left-justify.png   | Bin 0 -> 622 bytes
 docs/align-left.png           | Bin 0 -> 513 bytes
 docs/align-right-justify.png  | Bin 0 -> 628 bytes
 docs/align-right.png          | Bin 0 -> 497 bytes
 docs/pango.toml.in            |   8 +++++++-
 pango/pango-layout.c          |  10 ++++++++++
 8 files changed, 17 insertions(+), 1 deletion(-)
---
diff --git a/docs/align-center-justify.png b/docs/align-center-justify.png
new file mode 100644
index 00000000..c9244853
Binary files /dev/null and b/docs/align-center-justify.png differ
diff --git a/docs/align-center.png b/docs/align-center.png
new file mode 100644
index 00000000..a32ba3ca
Binary files /dev/null and b/docs/align-center.png differ
diff --git a/docs/align-left-justify.png b/docs/align-left-justify.png
new file mode 100644
index 00000000..4c6f3970
Binary files /dev/null and b/docs/align-left-justify.png differ
diff --git a/docs/align-left.png b/docs/align-left.png
new file mode 100644
index 00000000..775c0721
Binary files /dev/null and b/docs/align-left.png differ
diff --git a/docs/align-right-justify.png b/docs/align-right-justify.png
new file mode 100644
index 00000000..430c57e5
Binary files /dev/null and b/docs/align-right-justify.png differ
diff --git a/docs/align-right.png b/docs/align-right.png
new file mode 100644
index 00000000..05968f2a
Binary files /dev/null and b/docs/align-right.png differ
diff --git a/docs/pango.toml.in b/docs/pango.toml.in
index c4a1c11e..0b1cef06 100644
--- a/docs/pango.toml.in
+++ b/docs/pango.toml.in
@@ -71,5 +71,11 @@ content_images = [
   "rects1.png",
   "rects2.png",
   "arabic-markup.png",
-  "blue-text.png"
+  "blue-text.png",
+  "align-left.png",
+  "align-center.png",
+  "align-right.png",
+  "align-left-justify.png",
+  "align-center-justify.png",
+  "align-right-justify.png",
 ]
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index b39ca62b..e0475a5e 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -45,6 +45,16 @@
  *
  * ![Pango Layout Parameters](layout.png)
  *
+ * The following images demonstrate the effect of alignment and
+ * justification on the layout of text:
+ *
+ * | | |
+ * | --- | --- |
+ * | ![align=left](align-left.png) | ![align=left, justify](align-left-justify.png) |
+ * | ![align=center](align-center.png) | ![align=center, justify](align-center-justify.png) |
+ * | ![align=right](align-right.png) | ![align=right, justify](align-right-justify.png) |
+ *
+ *
  * It is possible, as well, to ignore the 2-D setup,
  * and simply treat the results of a `PangoLayout` as a list of lines.
  */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]