# HG changeset patch
# User Edouard Tisserant
# Date 1614702613 -3600
# Node ID b2ba6eeb61ec3654f4e4fa545f38263b482449d4
# Parent bc4194b734380000922146ffda5fc07a6b65805f
SVGHMI: attempt to prevent crazy styling with HMI:TextStyleList when inkscape store style in tspan instead of text element.
diff -r bc4194b73438 -r b2ba6eeb61ec svghmi/gen_index_xhtml.xslt
--- a/svghmi/gen_index_xhtml.xslt Tue Mar 02 10:11:45 2021 +0100
+++ b/svghmi/gen_index_xhtml.xslt Tue Mar 02 17:30:13 2021 +0100
@@ -5513,7 +5513,21 @@
styles: {
-
+
+
+
+
+
+
+ ;
+
+
+
+
+
+
+
+
: "
diff -r bc4194b73438 -r b2ba6eeb61ec svghmi/widget_list.ysl2
--- a/svghmi/widget_list.ysl2 Tue Mar 02 10:11:45 2021 +0100
+++ b/svghmi/widget_list.ysl2 Tue Mar 02 17:30:13 2021 +0100
@@ -13,7 +13,13 @@
param "hmi_element";
| styles: {
foreach "$hmi_element/*[@inkscape:label]" {
- const "style", "func:refered_elements(.)[self::svg:text]/@style";
+ const "text", "func:refered_elements(.)[self::svg:text][1]";
+ const "tspan", "$text/svg:tspan[1]";
+ const "style" choose {
+ when "$text/@style and $tspan/@style" > «$text/@style»;«$tspan/@style»
+ otherwise > «$text/@style»«$tspan/@style»
+
+ }
| «@inkscape:label»: "«$style»",
}
| },