Xml
xml file structure
All xml files have the following structure:
They all start with a <?xml ... line.
They all have <richtext ... second line and a </richtext> final line.
<paragraphlayout ...> xxx </paragraphlayout> works the same way.
Everything else works in <paragraph ...> xxx <paragraph> pairs and <text ...> xxx </text> pairs inside the <paragraph ...> xxx <paragraph> pairs. As long as you don't break the pairs it's all fine.
Generally the <text> tag can only take character-level formatting attributes like fontsize="10", but <paragraph> and <paragraphlayout> can take character-level attributes but also paragraph-level attributes like parspacingbefore="10". This means that if you set <paragraphlayout fontunderline = "1"> then <paragraph fontunderline = "0"> will over-ride that and <text fontunderline = "1"> will reset fontunderline for that text only. After the end of the </text> tag fontunderline will revert to "0". (Please could someone comment on this).
Attributes should generally be set by the commands defined in [1].
xml tag
First line of file. Has no closing tag. Looks like this:
<?xml version="1.0" encoding="UTF-8"?>
richtext tag
Second line of file. Has closing tag. Looks like this:
<richtext version="1.0.0.0" xmlns="https://www.wxwidgets.org"> . . . </richtext>
paragraphlayout tag
Third line of file and can occur in pairs through out the file changing the paragraph layout (style). Has closing tag. Sets defaults for all paragraphs contained within it. Can contain character-level attributes described for the <text> tag and paragraph-level attributes described for the <paragraph> tag. Looks like this:
<paragraphlayout textcolor="#E0DEDB" fontsize="10" fontstyle="90" fontweight="90"> . . . </paragraphlayout>
paragraph tag
Occurs in pairs throughout the file within <paragraphlayout> tags. Takes paragraph-level attributes but can also take charater-level attributes described for the <text> tag. Looks like this:
<paragraph textcolor="#000000" fontsize="11" parspacingafter="0"> . . . </paragraph>
alignment
Sets alignment to integer. 1 = left align, 2 = centre align, 3 = right align.
<paragraph alignment="1">
parspacingafter
Sets paragraph spacing preceding paragraph to integer. 10 means single-spacing, 15 means 1.5 spacing, and 20 means double spacing.
<paragraph parspacingafter="10">
parspacingbefore
Sets paragraph spacing preceding paragraph to integer. 10 means single-spacing, 15 means 1.5 spacing, and 20 means double spacing.
<paragraph parspacingbefore="10">
linespacing
Sets line spacing to integer. 10 means single-spacing, 15 means 1.5 spacing, and 20 means double spacing.
<paragraph linespacing="10">
pagebreak
pagebreak=1 inserts a page break before paragraph. Takes value 1 or 0. 1 means page break, 0 means no page break.
<paragraph pagebreak=1>
leftindent
leftindent="50" inserts left indent. Takes value in tenths of a millimetre.
<paragraph leftindent="50">
leftsubindent
leftsubindent="50" inserts left sub-indent. Takes value in tenths of a millimetre.
<paragraph leftsubindent="50">
bulletstyle
bulletstyle="512" sets bullet syle. Takes integer value.
<paragraph bulletstyle="512">
bulletname
bulletname="standard/Square" sets bullet name. Takes string value.
<paragraph bulletname="standard/Square">
text tag
Occurs in pairs throughout the file within <paragraph> tags. Looks like this:
<text textcolor="#000000" fontsize="11" fontstyle="90" fontweight="92" fontunderlined="0"> Impressão diagnóstica – laudo . . . </text>
The - sign is written as –.
textcolor
Sets text colour to hex RGB #xxxxxx.
<paragraph textcolor="#E0DEDB">
bgcolor
Sets background colour to hex RGB #xxxxxx.
<paragraph bgcolor="#FF0000">
fontsize
Sets font size to integer.
<paragraph fontsize="10">
fontstyle
Sets font style to integer.
<paragraph fontstyle="90">
fontweight
Sets font weight to integer. 90 is normal, 92 is bold.
<paragraph fontweight="90">
fontface
Sets font face to string value.
<paragraph fontface="Sans Serif">
fontunderlined
fontunderlined=1 underlines text. Takes values 1 or 0. 1 means underline, 0 means no underline.
<text fontunderlined=1>
Other font effects (capitals, strikethrough, superscript and subscript)
These are set through the texteffects and texteffectflags attributes. You should use wxTextAttr::SetTextEffects and wxTextAttr::SetTextEffectFlags to set the values for these to wxTEXT_ATTR_EFFECT_CAPITALS, wxTEXT_ATTR_EFFECT_STRIKETHROUGH, wxTEXT_ATTR_EFFECT_SUPERSCRIPT and wxTEXT_ATTR_EFFECT_SUBSCRIPT.