[gtk/wip/otte/inscription: 2/2] reftests: Add test for inscription markup parsing




commit 185752b27a95f74439c309f2bac478d02f9cffa7
Author: Benjamin Otte <otte redhat com>
Date:   Thu Jun 9 02:45:59 2022 +0200

    reftests: Add test for inscription markup parsing
    
    Compare with label markup parsing as the reference.

 testsuite/reftests/inscription-markup.ref.ui | 43 ++++++++++++++++++++++++++++
 testsuite/reftests/inscription-markup.ui     | 41 ++++++++++++++++++++++++++
 testsuite/reftests/meson.build               |  2 ++
 3 files changed, 86 insertions(+)
---
diff --git a/testsuite/reftests/inscription-markup.ref.ui b/testsuite/reftests/inscription-markup.ref.ui
new file mode 100644
index 0000000000..9c337c0b24
--- /dev/null
+++ b/testsuite/reftests/inscription-markup.ref.ui
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <object class="GtkWindow">
+    <property name="decorated">0</property>
+    <property name="default-width">800</property>
+    <property name="default-height">1000</property>
+    <child>
+      <object class="GtkLabel">
+        <property name="use-markup">1</property>
+        <property name="wrap">1</property>
+        <property name="label" translatable="yes">Text sizes: &lt;span size="xx-small"&gt;tiny 
&lt;/span&gt;&lt;span size="x-small"&gt;very small &lt;/span&gt;&lt;span size="small"&gt;small 
&lt;/span&gt;&lt;span size="medium"&gt;normal &lt;/span&gt;&lt;span size="large"&gt;large 
&lt;/span&gt;&lt;span size="x-large"&gt;very large &lt;/span&gt;&lt;span size="xx-large"&gt;huge&lt;/span&gt;
+
+Text styles: &lt;span style="normal"&gt;Normal&lt;/span&gt; &lt;span style="italic"&gt;Italic&lt;/span&gt; 
&lt;span style="oblique"&gt;Olique&lt;/span&gt;
+
+Text weights: &lt;span weight="thin"&gt;thin&lt;/span&gt; &lt;span weight="light"&gt;light&lt;/span&gt; 
&lt;span weight="normal"&gt;normal&lt;/span&gt; &lt;span weight="bold"&gt;bold&lt;/span&gt; &lt;span 
weight="ultraheavy"&gt;ultraheavy&lt;/span&gt;
+
+Text &lt;span color="gray"&gt;c&lt;span color="green"&gt;o&lt;/span&gt;l&lt;span 
color="tomato"&gt;o&lt;/span&gt;rs&lt;/span&gt; and &lt;span background="pink"&gt;backgrounds&lt;/span&gt;
+
+Colorful &lt;span underline="low" underline-color="blue"&gt;&lt;span underline="double" 
underline-color="red"&gt;under&lt;/span&gt;lines&lt;/span&gt; and &lt;span background="pink"&gt;&lt;span 
underline="error"&gt;mo&lt;/span&gt;&lt;span underline="error" 
underline-color="green"&gt;re&lt;/span&gt;&lt;/span&gt;
+
+Colorful &lt;span strikethrough="true" strikethrough-color="magenta"&gt;strikethroughs&lt;/span&gt; and 
&lt;span overline="single" overline_color="green"&gt;overlines&lt;/span&gt;
+
+Superscripts and subscripts: 𝜀&lt;span rise="-6000" size="x-small" font_desc="italic"&gt;0&lt;/span&gt; = 
𝜔&lt;span rise="8000" size="smaller"&gt;𝜔&lt;span rise="14000" size="smaller"&gt;𝜔&lt;span 
rise="20000"&gt;.&lt;span rise="23000"&gt;.&lt;span 
rise="26000"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
+
+&lt;span letter_spacing="3000"&gt;Letterspacing&lt;/span&gt;
+
+OpenType font features: &lt;span font_desc="sans regular" font_features="dlig=0"&gt;feast&lt;/span&gt; 
versus &lt;span font_desc="sans regular" font_features="dlig=1"&gt;feast&lt;/span&gt;
+
+Shortcuts: &lt;tt&gt;Monospace&lt;/tt&gt; – &lt;b&gt;Bold&lt;/b&gt; – &lt;i&gt;Italic&lt;/i&gt; – 
&lt;big&gt;Big&lt;/big&gt; – &lt;small&gt;Small&lt;/small&gt; – &lt;u&gt;Underlined&lt;/u&gt; – 
&lt;s&gt;Strikethrough&lt;/s&gt; – Super&lt;sup&gt;script&lt;/sup&gt; – Sub&lt;sub&gt;script&lt;/sub&gt;
+
+hy­phen­ation al­go­rithm is a &lt;span allow_breaks="false" style="italic"&gt;set of rules&lt;/span&gt;, 
espe­ci­ally one co­di­fied for im­ple­men­tation in a com­pu­ter pro­gram, that de­ci­des at which points a 
word can be bro­ken over two lines with a hy­phen. For ex­am­ple, a hy­phen­ation al­go­rithm might de­cide 
that im­peach­ment can be broken as impeach‧ment or im‧peachment but not impe‧achment.
+
+&lt;span insert_hyphens="false"&gt;one/two three/four five/six seven/eight nine/ten&lt;/span&gt;
+
+&lt;span line_height='1.33'&gt;Line height: This is an example of widely spaced text. It was achieved by 
setting the line-height factor to 1.33. You can set the line-height factor to any value between 0 and 10.
+
+Note that the line height affects the spacing between paragraphs as well as between the wrapped lines inside 
a paragraph.&lt;/span&gt;
+
+Transforms: &lt;span text_transform='uppercase'&gt;straße&lt;/span&gt; &lt;span 
text_transform='capitalize'&gt;up, up and away&lt;/span&gt;</property>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/reftests/inscription-markup.ui b/testsuite/reftests/inscription-markup.ui
new file mode 100644
index 0000000000..181d7ffbd6
--- /dev/null
+++ b/testsuite/reftests/inscription-markup.ui
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <object class="GtkWindow">
+    <property name="decorated">0</property>
+    <property name="default-width">800</property>
+    <property name="default-height">1000</property>
+    <child>
+      <object class="GtkInscription">
+        <property name="markup" translatable="yes">Text sizes: &lt;span size="xx-small"&gt;tiny 
&lt;/span&gt;&lt;span size="x-small"&gt;very small &lt;/span&gt;&lt;span size="small"&gt;small 
&lt;/span&gt;&lt;span size="medium"&gt;normal &lt;/span&gt;&lt;span size="large"&gt;large 
&lt;/span&gt;&lt;span size="x-large"&gt;very large &lt;/span&gt;&lt;span size="xx-large"&gt;huge&lt;/span&gt;
+
+Text styles: &lt;span style="normal"&gt;Normal&lt;/span&gt; &lt;span style="italic"&gt;Italic&lt;/span&gt; 
&lt;span style="oblique"&gt;Olique&lt;/span&gt;
+
+Text weights: &lt;span weight="thin"&gt;thin&lt;/span&gt; &lt;span weight="light"&gt;light&lt;/span&gt; 
&lt;span weight="normal"&gt;normal&lt;/span&gt; &lt;span weight="bold"&gt;bold&lt;/span&gt; &lt;span 
weight="ultraheavy"&gt;ultraheavy&lt;/span&gt;
+
+Text &lt;span color="gray"&gt;c&lt;span color="green"&gt;o&lt;/span&gt;l&lt;span 
color="tomato"&gt;o&lt;/span&gt;rs&lt;/span&gt; and &lt;span background="pink"&gt;backgrounds&lt;/span&gt;
+
+Colorful &lt;span underline="low" underline-color="blue"&gt;&lt;span underline="double" 
underline-color="red"&gt;under&lt;/span&gt;lines&lt;/span&gt; and &lt;span background="pink"&gt;&lt;span 
underline="error"&gt;mo&lt;/span&gt;&lt;span underline="error" 
underline-color="green"&gt;re&lt;/span&gt;&lt;/span&gt;
+
+Colorful &lt;span strikethrough="true" strikethrough-color="magenta"&gt;strikethroughs&lt;/span&gt; and 
&lt;span overline="single" overline_color="green"&gt;overlines&lt;/span&gt;
+
+Superscripts and subscripts: 𝜀&lt;span rise="-6000" size="x-small" font_desc="italic"&gt;0&lt;/span&gt; = 
𝜔&lt;span rise="8000" size="smaller"&gt;𝜔&lt;span rise="14000" size="smaller"&gt;𝜔&lt;span 
rise="20000"&gt;.&lt;span rise="23000"&gt;.&lt;span 
rise="26000"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
+
+&lt;span letter_spacing="3000"&gt;Letterspacing&lt;/span&gt;
+
+OpenType font features: &lt;span font_desc="sans regular" font_features="dlig=0"&gt;feast&lt;/span&gt; 
versus &lt;span font_desc="sans regular" font_features="dlig=1"&gt;feast&lt;/span&gt;
+
+Shortcuts: &lt;tt&gt;Monospace&lt;/tt&gt; – &lt;b&gt;Bold&lt;/b&gt; – &lt;i&gt;Italic&lt;/i&gt; – 
&lt;big&gt;Big&lt;/big&gt; – &lt;small&gt;Small&lt;/small&gt; – &lt;u&gt;Underlined&lt;/u&gt; – 
&lt;s&gt;Strikethrough&lt;/s&gt; – Super&lt;sup&gt;script&lt;/sup&gt; – Sub&lt;sub&gt;script&lt;/sub&gt;
+
+hy­phen­ation al­go­rithm is a &lt;span allow_breaks="false" style="italic"&gt;set of rules&lt;/span&gt;, 
espe­ci­ally one co­di­fied for im­ple­men­tation in a com­pu­ter pro­gram, that de­ci­des at which points a 
word can be bro­ken over two lines with a hy­phen. For ex­am­ple, a hy­phen­ation al­go­rithm might de­cide 
that im­peach­ment can be broken as impeach‧ment or im‧peachment but not impe‧achment.
+
+&lt;span insert_hyphens="false"&gt;one/two three/four five/six seven/eight nine/ten&lt;/span&gt;
+
+&lt;span line_height='1.33'&gt;Line height: This is an example of widely spaced text. It was achieved by 
setting the line-height factor to 1.33. You can set the line-height factor to any value between 0 and 10.
+
+Note that the line height affects the spacing between paragraphs as well as between the wrapped lines inside 
a paragraph.&lt;/span&gt;
+
+Transforms: &lt;span text_transform='uppercase'&gt;straße&lt;/span&gt; &lt;span 
text_transform='capitalize'&gt;up, up and away&lt;/span&gt;</property>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/reftests/meson.build b/testsuite/reftests/meson.build
index 301f8bd0c5..3001d0e127 100644
--- a/testsuite/reftests/meson.build
+++ b/testsuite/reftests/meson.build
@@ -367,6 +367,8 @@ testdata = [
   'image-load-from-file.css',
   'image-load-from-file.ref.ui',
   'image-load-from-file.ui',
+  'inscription-markup.ref.ui',
+  'inscription-markup.ui',
   'label-attribute-preference.css',
   'label-attribute-preference.ref.ui',
   'label-attribute-preference.ui',


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