<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://cegui.org.uk/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mboeni</id>
		<title>CEGUI Wiki - Crazy Eddie's GUI System (Open Source) - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://cegui.org.uk/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mboeni"/>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/Special:Contributions/Mboeni"/>
		<updated>2026-04-14T20:01:16Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3460</id>
		<title>Formatting Tags in CEGUI</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3460"/>
				<updated>2010-09-25T13:00:55Z</updated>
		
		<summary type="html">&lt;p&gt;Mboeni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Some Basics ==&lt;br /&gt;
CEGUI has a nice feature that allows for formatted text in a widget, called “formatting tags”. Basically, you insert tags like:&lt;br /&gt;
&lt;br /&gt;
 [tag-name='value']&lt;br /&gt;
&lt;br /&gt;
into your strings and CEGUI does the necessary parsing (see [http://www.cegui.org.uk/docs/current/classCEGUI_1_1BasicRenderedStringParser.html CEGUI::BasicRenderedStringParser] class reference for details).&lt;br /&gt;
&lt;br /&gt;
It is important to note that these tags are like a ‘state change’, that means if you set a specific formatting option, it stays active until changed by another tag. You will see some examples later on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Available Tags ==&lt;br /&gt;
=== Font Colours ===&lt;br /&gt;
Changing the text colour in a string is quite easy, so let’s start with that. In the following example, we will have some text shown in red, green and blue. Here’s how the tags work:&lt;br /&gt;
&lt;br /&gt;
 &amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI can format strings.[colour='FF00FF00']&lt;br /&gt;
 and this is just colour [colour='FF0000FF'] formatting!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In code, it looks like this:&lt;br /&gt;
&lt;br /&gt;
 CEGUI::Window* textComponent =  &lt;br /&gt;
 (CEGUI::Window*)CEGUI::WindowManager::getSingleton().getWindow(&amp;quot;generat0r/AboutDialog/StaticText&amp;quot;);&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI &lt;br /&gt;
 can format strings.[colour='FF00FF00'] and this is just colour [colour='FF0000FF'] formatting!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And that's how it looks in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_colours.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A note:&lt;br /&gt;
* In case you have wondered why 4 sets of values are needed for each colour:  Red, for example, is described by [colour=’FFFF0000’] where the first ‘FF’ is the Alpha value (fully opaque in this case), the second is the value for the red component, the third for the green component and the fourth for the blue component, like in [AARRGGBB]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Font Formatting ===&lt;br /&gt;
Font formatting is a bit more involved as you need to have the actual fonts and the ‘font’ XML files defined for each style.&lt;br /&gt;
&lt;br /&gt;
Let’s assume you want to use the Arial font with the styles ‘normal’, ‘''italic''’, ‘'''bold'''’ and ‘'''''bold Italic'''''’. This actually requires you to have four different Arial fonts. For Arial, the fonts are called as follows:&lt;br /&gt;
&lt;br /&gt;
* Arial normal (arial.ttf)&lt;br /&gt;
* Arial bold (arialbd.ttf)&lt;br /&gt;
* Arial italic (ariali.ttf)&lt;br /&gt;
* Arial bold italic (arialbi.ttf)&lt;br /&gt;
&lt;br /&gt;
If you want to tinker around with them you can find these and some more in the font manager app of your OS (Arial ships with Windows, so you can get them from the OS). Note that Arial is copyrighted, so you might want to use a free font for your app (check out [http://www.dafont.com/ DaFont] for example).&lt;br /&gt;
&lt;br /&gt;
For each font, you will now have to create the according “.font” file that tells CEGUI how to use the font:&lt;br /&gt;
&lt;br /&gt;
* Arial-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-10&amp;quot; Filename=&amp;quot;arial.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot; &lt;br /&gt;
 AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Bold-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Bold-10&amp;quot; Filename=&amp;quot;arialbd.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Italic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Italic-10&amp;quot; Filename=&amp;quot;ariali.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-BoldItalic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-BoldItalic-10&amp;quot; Filename=&amp;quot;arialbi.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don’t forget to add the font definitions into your scheme, like so:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;GUIScheme Name=&amp;quot;VanillaSkin&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;Imageset Filename=&amp;quot;Vanilla.imageset&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Bold-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Italic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-BoldItalic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-14.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;LookNFeel Filename=&amp;quot;Vanilla.looknfeel&amp;quot; /&amp;gt;&lt;br /&gt;
  …snip…&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;You can also do [font='Arial-Bold-10']bold text, [font='Arial-Italic-10']italic &lt;br /&gt;
 text, [font='Arial-BoldItalic-10']bold AND italic text.[font='Arial-10']!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_fonts.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Embedding Images ===&lt;br /&gt;
Embedding an image into text is quite easy. The required tag follows the general syntax. Consider the following tag:&lt;br /&gt;
&lt;br /&gt;
 [image='set:&amp;lt;imageset&amp;gt; image:&amp;lt;image&amp;gt;']&lt;br /&gt;
&lt;br /&gt;
What you need to do here is specify the imageset where the image is specified and identify the image to be used. Let’s assume you want to embed the MouseCursor of the TaharezLook imageset into the following text: “Nice, I can even embed images like this &amp;lt;mousepic here&amp;gt; into my text.”&lt;br /&gt;
&lt;br /&gt;
First you need to know the name of the imageset and the name of the image. Let’s have a look at “TaharezLook.imageset” for that purpose:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Imageset Name=&amp;quot;TaharezLook&amp;quot; Imagefile=&amp;quot;TaharezLook.tga&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot;  &lt;br /&gt;
 AutoScaled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;Image Name=&amp;quot;MouseArrow&amp;quot; XPos=&amp;quot;138&amp;quot; YPos=&amp;quot;127&amp;quot; Width=&amp;quot;31&amp;quot; Height=&amp;quot;25&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/Imageset&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the imageset is named “TaharezLook” and the wanted image is called “MouseArrow”. In code this would now look like follows:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image='set:TaharezLook image:MouseArrow'] &lt;br /&gt;
 into my text. &amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And this is how it looks in my App:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_image embed.png]]&lt;br /&gt;
&lt;br /&gt;
Please note: The following tags have an effect on the way the image is drawn: ‘padding’, ‘alignment’ and ‘colour’.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Image Size ===&lt;br /&gt;
The ‘image-size’ tag allows you to change the size of embedded image components. The sizes in the tag are given in pixels and the format is as follows:&lt;br /&gt;
&lt;br /&gt;
 w:&amp;lt;width value&amp;gt; h:&amp;lt;height value&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which specifies the width and height of a following image. So to set the size of a subsequent image to 32 pixels height and 64 pixels width, you would use:&lt;br /&gt;
&lt;br /&gt;
 [image-size=’w:32 h:64’]&lt;br /&gt;
&lt;br /&gt;
Here is how it might look in code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image-size='w:32 h:64']&lt;br /&gt;
 [image='set:TaharezLook image:MouseArrow'] into my text.&amp;quot;); &lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_image size.png]]&lt;br /&gt;
&lt;br /&gt;
Please note: To set the image-size back to the real size of the image, just set the values to zero, like so:  [image-size=’w:0 h:0’]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Vertical Alignment ===&lt;br /&gt;
The vertical alignment tag allows you align elements within a text that have different heights. The overall available space on a line is always taken as the height of the tallest element plus any vertical padding, elements are then positioned within this vertical space according to the specified option. Currently, you can align an element to ‘top’, ‘bottom’, ‘centre’ and ‘stretch’. The option ‘stretch’ will stretch the tagged elements vertically to fill the available space. Please note that the stretching is vertical only, aspect ratios of images and text are not maintained! This will be accounted for in the future, though.&lt;br /&gt;
&lt;br /&gt;
The following examples are valid tags for “vert-alignment”:&lt;br /&gt;
&lt;br /&gt;
 [vert-alignment='top']&lt;br /&gt;
 [vert-alignment='bottom']&lt;br /&gt;
 [vert-alignment='centre']&lt;br /&gt;
 [vert-alignment=’stretch’]&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Text can also be vertically aligned. It can be aligned to [vert-alignment='top']top, &lt;br /&gt;
 [vert-alignment='bottom']bottom, [vert-alignment='centre']centre and [vert-alignment='stretch']'stretch'&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here how it looks in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_vertalign.png]]&lt;br /&gt;
&lt;br /&gt;
Please note: Embedded window elements cannot be stretched currently. This may also change in the future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Padding ===&lt;br /&gt;
Padding is related to the vertical alignment tag in that it also allows you to specify the setting of elements in a text. You can set individual text elements or the whole text all together. The value you give the padding tag are a number of pixels to pad the surrounding elements with. The padding tag uses a “rect” property to specify padding values, like so: ‘l:&amp;lt;value&amp;gt; t:&amp;lt;value&amp;gt; r:&amp;lt;value&amp;gt; b:&amp;lt;value&amp;gt;) where “l” stands for “left padding, “t” stands for “top padding”, “r” stands for “right padding” and “b” stands for “bottom padding”.&lt;br /&gt;
&lt;br /&gt;
Consider the following sample text: ''“Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. THIS IS PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.”''&lt;br /&gt;
&lt;br /&gt;
Our aim is to pad the text element “THIS IS PADDED” with 5 pixels of left and right padding and 10 pixels of top and bottom padding. The tag would look like this: &lt;br /&gt;
&lt;br /&gt;
 [padding=’l:5 t:10 r:5 b:10’]&lt;br /&gt;
&lt;br /&gt;
Use padding, for example to provide extra spacing when embedding a picture or window in text.&lt;br /&gt;
Here is the code sample:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco &lt;br /&gt;
 laboris nisi ut aliquip ex ea commodo consequat. [padding=’l:5 t:10 r:5 b:10’]THIS IS PADDED.[padding=’l:0 t:0 &lt;br /&gt;
 r:0 b:0’] Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla &lt;br /&gt;
 pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id &lt;br /&gt;
 est laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks like in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_padding.png]]&lt;br /&gt;
&lt;br /&gt;
Please note: Don’t try to translate the latin here – its complete nonsense. The “Lorem Ipsum” text has been around since the 1500s, when an unknown printer defined it as a dummy text to make a type specimen book, and it’s still in use today. Strange but true.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Window ===&lt;br /&gt;
The ‘window’ tag manipulates an existing child window of the window that you set the text on, such that the window is drawn in-line with the text, which means it moves with the text automatically. The ‘window’ tag takes the full name of the window just as you would use it with CEGUI::WindowManager. While the named window can be any window, it only makes sense to reference windows that are attached to the window where the text will be rendered.&lt;br /&gt;
&lt;br /&gt;
So let us embed a button into our text! &lt;br /&gt;
&lt;br /&gt;
First, we define the window in our layout:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;GUILayout &amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/FrameWindow&amp;quot; Name=&amp;quot;generat0r/AboutDialog&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;About generat0r&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;Arial-14&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarEnabled&amp;quot; Value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;CloseButtonEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;SizingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;			&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.015,0},{0.015,0},{0.45,0},{0.40,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedPosition&amp;quot; Value=&amp;quot;{ {0.25, 0}, {0.25, 0} }&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/StaticText&amp;quot; Name=&amp;quot;generat0r/AboutDialog/StaticText&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Demonstrates static (non editable) text. Use the controls on your right for &lt;br /&gt;
 formatting options.&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzExtent&amp;quot; Value=&amp;quot;361&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertExtent&amp;quot; Value=&amp;quot;59.5854&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzFormatting&amp;quot; Value=&amp;quot;WordWrapLeftAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertFormatting&amp;quot; Value=&amp;quot;TopAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.03,0},{0.03,0},{0.97,0},{0.85,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot; &lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Embedded&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/CloseButton&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Close&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/GUILayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pay special attention to the cut out segment in the above layout! Please also note that the window I want to embed is a child of the text window.&lt;br /&gt;
&lt;br /&gt;
Our tag will look like this:&lt;br /&gt;
&lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']&lt;br /&gt;
&lt;br /&gt;
Now, you just need to embed the defined window (&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot;) into the string, like so:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit,sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco  &lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']laboris nisi ut aliquip ex ea commodo consequat. THIS IS &lt;br /&gt;
 PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. &lt;br /&gt;
 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est &lt;br /&gt;
 laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_window.png]]&lt;br /&gt;
&lt;br /&gt;
The window tag works fine with formatting options for text. Please consider, though, that the embedded window is treated as a single entity. So if you embed a window that just draws text, the text of that window will not be split for wrapping purposes, but might have its own formatting! Padding and vertical alignments work here as well, with the exception of the ‘stretch’ option (which will default to ‘centre’ and raise a note in the CEGUI.log)&lt;br /&gt;
&lt;br /&gt;
Note: If you have not created the window you call here, you will get an ‘unknown object’ exception!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
Dont forget to check out the demo video: [[http://www.youtube.com/watch?v=eRC5R9aA_Zs&amp;amp;feature=player_embedded Tag Formatting Demo]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Feedback ==&lt;br /&gt;
Feedback is very welcome: please just PM me in the forum (my handle is ‘mboeni’) or leave a comment here in the wiki. :) &lt;br /&gt;
&lt;br /&gt;
[[User:Mboeni|Mboeni]] 13:33, 24 September 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Mboeni</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3459</id>
		<title>Formatting Tags in CEGUI</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3459"/>
				<updated>2010-09-25T12:58:24Z</updated>
		
		<summary type="html">&lt;p&gt;Mboeni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Some Basics ==&lt;br /&gt;
CEGUI has a nice feature that allows for formatted text in a widget, called “formatting tags”. Basically, you insert tags like:&lt;br /&gt;
&lt;br /&gt;
 [tag-name='value']&lt;br /&gt;
&lt;br /&gt;
into your strings and CEGUI does the necessary parsing (see [http://www.cegui.org.uk/docs/current/classCEGUI_1_1BasicRenderedStringParser.html CEGUI::BasicRenderedStringParser] class reference for details).&lt;br /&gt;
&lt;br /&gt;
It is important to note that these tags are like a ‘state change’, that means if you set a specific formatting option, it stays active until changed by another tag. You will see some examples later on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Available Tags ==&lt;br /&gt;
=== Font Colours ===&lt;br /&gt;
Changing the text colour in a string is quite easy, so let’s start with that. In the following example, we will have some text shown in red, green and blue. Here’s how the tags work:&lt;br /&gt;
&lt;br /&gt;
 &amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI can format strings.[colour='FF00FF00']&lt;br /&gt;
 and this is just colour [colour='FF0000FF'] formatting!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In code, it looks like this:&lt;br /&gt;
&lt;br /&gt;
 CEGUI::Window* textComponent =  &lt;br /&gt;
 (CEGUI::Window*)CEGUI::WindowManager::getSingleton().getWindow(&amp;quot;generat0r/AboutDialog/StaticText&amp;quot;);&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI &lt;br /&gt;
 can format strings.[colour='FF00FF00'] and this is just colour [colour='FF0000FF'] formatting!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And that's how it looks in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_colours.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A note:&lt;br /&gt;
* In case you have wondered why 4 sets of values are needed for each colour:  Red, for example, is described by [colour=’FFFF0000’] where the first ‘FF’ is the Alpha value (fully opaque in this case), the second is the value for the red component, the third for the green component and the fourth for the blue component, like in [AARRGGBB]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Font Formatting ===&lt;br /&gt;
Font formatting is a bit more involved as you need to have the actual fonts and the ‘font’ XML files defined for each style.&lt;br /&gt;
&lt;br /&gt;
Let’s assume you want to use the Arial font with the styles ‘normal’, ‘''italic''’, ‘'''bold'''’ and ‘'''''bold Italic'''''’. This actually requires you to have four different Arial fonts. For Arial, the fonts are called as follows:&lt;br /&gt;
&lt;br /&gt;
* Arial normal (arial.ttf)&lt;br /&gt;
* Arial bold (arialbd.ttf)&lt;br /&gt;
* Arial italic (ariali.ttf)&lt;br /&gt;
* Arial bold italic (arialbi.ttf)&lt;br /&gt;
&lt;br /&gt;
If you want to tinker around with them you can find these and some more in the font manager app of your OS (Arial ships with Windows, so you can get them from the OS). Note that Arial is copyrighted, so you might want to use a free font for your app (check out [http://www.dafont.com/ DaFont] for example).&lt;br /&gt;
&lt;br /&gt;
For each font, you will now have to create the according “.font” file that tells CEGUI how to use the font:&lt;br /&gt;
&lt;br /&gt;
* Arial-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-10&amp;quot; Filename=&amp;quot;arial.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot; &lt;br /&gt;
 AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Bold-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Bold-10&amp;quot; Filename=&amp;quot;arialbd.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Italic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Italic-10&amp;quot; Filename=&amp;quot;ariali.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-BoldItalic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-BoldItalic-10&amp;quot; Filename=&amp;quot;arialbi.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don’t forget to add the font definitions into your scheme, like so:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;GUIScheme Name=&amp;quot;VanillaSkin&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;Imageset Filename=&amp;quot;Vanilla.imageset&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Bold-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Italic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-BoldItalic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-14.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;LookNFeel Filename=&amp;quot;Vanilla.looknfeel&amp;quot; /&amp;gt;&lt;br /&gt;
  …snip…&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;You can also do [font='Arial-Bold-10']bold text, [font='Arial-Italic-10']italic &lt;br /&gt;
 text, [font='Arial-BoldItalic-10']bold AND italic text.[font='Arial-10']!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_fonts.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Embedding Images ===&lt;br /&gt;
Embedding an image into text is quite easy. The required tag follows the general syntax. Consider the following tag:&lt;br /&gt;
&lt;br /&gt;
 [image='set:&amp;lt;imageset&amp;gt; image:&amp;lt;image&amp;gt;']&lt;br /&gt;
&lt;br /&gt;
What you need to do here is specify the imageset where the image is specified and identify the image to be used. Let’s assume you want to embed the MouseCursor of the TaharezLook imageset into the following text: “Nice, I can even embed images like this &amp;lt;mousepic here&amp;gt; into my text.”&lt;br /&gt;
&lt;br /&gt;
First you need to know the name of the imageset and the name of the image. Let’s have a look at “TaharezLook.imageset” for that purpose:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Imageset Name=&amp;quot;TaharezLook&amp;quot; Imagefile=&amp;quot;TaharezLook.tga&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot;  &lt;br /&gt;
 AutoScaled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;Image Name=&amp;quot;MouseArrow&amp;quot; XPos=&amp;quot;138&amp;quot; YPos=&amp;quot;127&amp;quot; Width=&amp;quot;31&amp;quot; Height=&amp;quot;25&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/Imageset&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the imageset is named “TaharezLook” and the wanted image is called “MouseArrow”. In code this would now look like follows:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image='set:TaharezLook image:MouseArrow'] &lt;br /&gt;
 into my text. &amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And this is how it looks in my App:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_image embed.png]]&lt;br /&gt;
&lt;br /&gt;
Please note: The following tags have an effect on the way the image is drawn: ‘padding’, ‘alignment’ and ‘colour’.&lt;br /&gt;
&lt;br /&gt;
=== Image Size ===&lt;br /&gt;
The ‘image-size’ tag allows you to change the size of embedded image components. The sizes in the tag are given in pixels and the format is as follows:&lt;br /&gt;
&lt;br /&gt;
 w:&amp;lt;width value&amp;gt; h:&amp;lt;height value&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which specifies the width and height of a following image. So to set the size of a subsequent image to 32 pixels height and 64 pixels width, you would use:&lt;br /&gt;
&lt;br /&gt;
 [image-size=’w:32 h:64’]&lt;br /&gt;
&lt;br /&gt;
Here is how it might look in code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image-size='w:32 h:64']&lt;br /&gt;
 [image='set:TaharezLook image:MouseArrow'] into my text.&amp;quot;); &lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_image size.png]]&lt;br /&gt;
&lt;br /&gt;
Please note: To set the image-size back to the real size of the image, just set the values to zero, like so:  [image-size=’w:0 h:0’]&lt;br /&gt;
&lt;br /&gt;
=== Vertical Alignment ===&lt;br /&gt;
The vertical alignment tag allows you align elements within a text that have different heights. The overall available space on a line is always taken as the height of the tallest element plus any vertical padding, elements are then positioned within this vertical space according to the specified option. Currently, you can align an element to ‘top’, ‘bottom’, ‘centre’ and ‘stretch’. The option ‘stretch’ will stretch the tagged elements vertically to fill the available space. Please note that the stretching is vertical only, aspect ratios of images and text are not maintained! This will be accounted for in the future, though.&lt;br /&gt;
&lt;br /&gt;
The following examples are valid tags for “vert-alignment”:&lt;br /&gt;
&lt;br /&gt;
 [vert-alignment='top']&lt;br /&gt;
 [vert-alignment='bottom']&lt;br /&gt;
 [vert-alignment='centre']&lt;br /&gt;
 [vert-alignment=’stretch’]&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Text can also be vertically aligned. It can be aligned to [vert-alignment='top']top, &lt;br /&gt;
 [vert-alignment='bottom']bottom, [vert-alignment='centre']centre and [vert-alignment='stretch']'stretch'&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here how it looks in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_vertalign.png]]&lt;br /&gt;
&lt;br /&gt;
Please note: Embedded window elements cannot be stretched currently. This may also change in the future.&lt;br /&gt;
&lt;br /&gt;
=== Padding ===&lt;br /&gt;
Padding is related to the vertical alignment tag in that it also allows you to specify the setting of elements in a text. You can set individual text elements or the whole text all together. The value you give the padding tag are a number of pixels to pad the surrounding elements with. The padding tag uses a “rect” property to specify padding values, like so: ‘l:&amp;lt;value&amp;gt; t:&amp;lt;value&amp;gt; r:&amp;lt;value&amp;gt; b:&amp;lt;value&amp;gt;) where “l” stands for “left padding, “t” stands for “top padding”, “r” stands for “right padding” and “b” stands for “bottom padding”.&lt;br /&gt;
&lt;br /&gt;
Consider the following sample text: ''“Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. THIS IS PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.”''&lt;br /&gt;
&lt;br /&gt;
Our aim is to pad the text element “THIS IS PADDED” with 5 pixels of left and right padding and 10 pixels of top and bottom padding. The tag would look like this: &lt;br /&gt;
&lt;br /&gt;
 [padding=’l:5 t:10 r:5 b:10’]&lt;br /&gt;
&lt;br /&gt;
Use padding, for example to provide extra spacing when embedding a picture or window in text.&lt;br /&gt;
Here is the code sample:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco &lt;br /&gt;
 laboris nisi ut aliquip ex ea commodo consequat. [padding=’l:5 t:10 r:5 b:10’]THIS IS PADDED.[padding=’l:0 t:0 &lt;br /&gt;
 r:0 b:0’] Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla &lt;br /&gt;
 pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id &lt;br /&gt;
 est laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks like in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_padding.png]]&lt;br /&gt;
&lt;br /&gt;
Please note: Don’t try to translate the latin here – its complete nonsense. The “Lorem Ipsum” text has been around since the 1500s, when an unknown printer defined it as a dummy text to make a type specimen book, and it’s still in use today. Strange but true.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Window ===&lt;br /&gt;
The ‘window’ tag manipulates an existing child window of the window that you set the text on, such that the window is drawn in-line with the text, which means it moves with the text automatically. The ‘window’ tag takes the full name of the window just as you would use it with CEGUI::WindowManager. While the named window can be any window, it only makes sense to reference windows that are attached to the window where the text will be rendered.&lt;br /&gt;
&lt;br /&gt;
So let us embed a button into our text! &lt;br /&gt;
&lt;br /&gt;
First, we define the window in our layout:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;GUILayout &amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/FrameWindow&amp;quot; Name=&amp;quot;generat0r/AboutDialog&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;About generat0r&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;Arial-14&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarEnabled&amp;quot; Value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;CloseButtonEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;SizingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;			&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.015,0},{0.015,0},{0.45,0},{0.40,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedPosition&amp;quot; Value=&amp;quot;{ {0.25, 0}, {0.25, 0} }&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/StaticText&amp;quot; Name=&amp;quot;generat0r/AboutDialog/StaticText&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Demonstrates static (non editable) text. Use the controls on your right for &lt;br /&gt;
 formatting options.&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzExtent&amp;quot; Value=&amp;quot;361&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertExtent&amp;quot; Value=&amp;quot;59.5854&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzFormatting&amp;quot; Value=&amp;quot;WordWrapLeftAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertFormatting&amp;quot; Value=&amp;quot;TopAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.03,0},{0.03,0},{0.97,0},{0.85,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot; &lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Embedded&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/CloseButton&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Close&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/GUILayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pay special attention to the cut out segment in the above layout! Please also note that the window I want to embed is a child of the text window.&lt;br /&gt;
&lt;br /&gt;
Our tag will look like this:&lt;br /&gt;
&lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']&lt;br /&gt;
&lt;br /&gt;
Now, you just need to embed the defined window (&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot;) into the string, like so:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit,sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco  &lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']laboris nisi ut aliquip ex ea commodo consequat. THIS IS &lt;br /&gt;
 PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. &lt;br /&gt;
 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est &lt;br /&gt;
 laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_window.png]]&lt;br /&gt;
&lt;br /&gt;
The window tag works fine with formatting options for text. Please consider, though, that the embedded window is treated as a single entity. So if you embed a window that just draws text, the text of that window will not be split for wrapping purposes, but might have its own formatting! Padding and vertical alignments work here as well, with the exception of the ‘stretch’ option (which will default to ‘centre’ and raise a note in the CEGUI.log)&lt;br /&gt;
&lt;br /&gt;
Note: If you have not created the window you call here, you will get an ‘unknown object’ exception!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
Dont forget to check out the demo video: [[http://www.youtube.com/watch?v=eRC5R9aA_Zs&amp;amp;feature=player_embedded Tag Formatting Demo]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Feedback ==&lt;br /&gt;
Feedback is very welcome: please just PM me in the forum (my handle is ‘mboeni’) or leave a comment here in the wiki. :) &lt;br /&gt;
&lt;br /&gt;
[[User:Mboeni|Mboeni]] 13:33, 24 September 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Mboeni</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3451</id>
		<title>Formatting Tags in CEGUI</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3451"/>
				<updated>2010-09-24T17:27:42Z</updated>
		
		<summary type="html">&lt;p&gt;Mboeni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Some Basics ==&lt;br /&gt;
CEGUI has a nice feature that allows for formatted text in a widget, called “formatting tags”. Basically, you insert tags like:&lt;br /&gt;
&lt;br /&gt;
 [tag-name='value']&lt;br /&gt;
&lt;br /&gt;
into your strings and CEGUI does the necessary parsing (see [http://www.cegui.org.uk/docs/current/classCEGUI_1_1BasicRenderedStringParser.html CEGUI::BasicRenderedStringParser] class reference for details).&lt;br /&gt;
&lt;br /&gt;
It is important to note that these tags are like a ‘state change’, that means if you set a specific formatting option, it stays active until changed by another tag. You will see some examples later on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Available Tags ==&lt;br /&gt;
=== Font Colours ===&lt;br /&gt;
Changing the text colour in a string is quite easy, so let’s start with that. In the following example, we will have some text shown in red, green and blue. Here’s how the tags work:&lt;br /&gt;
&lt;br /&gt;
 &amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI can format strings.[colour='FF00FF00']&lt;br /&gt;
 and this is just colour [colour='FF0000FF'] formatting!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In code, it looks like this:&lt;br /&gt;
&lt;br /&gt;
 CEGUI::Window* textComponent =  &lt;br /&gt;
 (CEGUI::Window*)CEGUI::WindowManager::getSingleton().getWindow(&amp;quot;generat0r/AboutDialog/StaticText&amp;quot;);&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI &lt;br /&gt;
 can format strings.[colour='FF00FF00'] and this is just colour [colour='FF0000FF'] formatting!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And that's how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A note:&lt;br /&gt;
* In case you have wondered why 4 sets of values are needed for each colour:  Red, for example, is described by [colour=’FFFF0000’] where the first ‘FF’ is the Alpha value (fully opaque in this case), the second is the value for the red component, the third for the green component and the fourth for the blue component, like in [AARRGGBB]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Font Formatting ===&lt;br /&gt;
Font formatting is a bit more involved as you need to have the actual fonts and the ‘font’ XML files defined for each style.&lt;br /&gt;
&lt;br /&gt;
Let’s assume you want to use the Arial font with the styles ‘normal’, ‘''italic''’, ‘'''bold'''’ and ‘'''''bold Italic'''''’. This actually requires you to have four different Arial fonts. For Arial, the fonts are called as follows:&lt;br /&gt;
&lt;br /&gt;
* Arial normal (arial.ttf)&lt;br /&gt;
* Arial bold (arialbd.ttf)&lt;br /&gt;
* Arial italic (ariali.ttf)&lt;br /&gt;
* Arial bold italic (arialbi.ttf)&lt;br /&gt;
&lt;br /&gt;
If you want to tinker around with them you can find these and some more in the font manager app of your OS (Arial ships with Windows, so you can get them from the OS). Note that Arial is copyrighted, so you might want to use a free font for your app (check out [http://www.dafont.com/ DaFont] for example).&lt;br /&gt;
&lt;br /&gt;
For each font, you will now have to create the according “.font” file that tells CEGUI how to use the font:&lt;br /&gt;
&lt;br /&gt;
* Arial-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-10&amp;quot; Filename=&amp;quot;arial.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot; &lt;br /&gt;
 AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Bold-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Bold-10&amp;quot; Filename=&amp;quot;arialbd.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Italic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Italic-10&amp;quot; Filename=&amp;quot;ariali.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-BoldItalic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-BoldItalic-10&amp;quot; Filename=&amp;quot;arialbi.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don’t forget to add the font definitions into your scheme, like so:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;GUIScheme Name=&amp;quot;VanillaSkin&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;Imageset Filename=&amp;quot;Vanilla.imageset&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Bold-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Italic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-BoldItalic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-14.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;LookNFeel Filename=&amp;quot;Vanilla.looknfeel&amp;quot; /&amp;gt;&lt;br /&gt;
  …snip…&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;You can also do [font='Arial-Bold-10']bold text, [font='Arial-Italic-10']italic &lt;br /&gt;
 text, [font='Arial-BoldItalic-10']bold AND italic text.[font='Arial-10']!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Embedding Images ===&lt;br /&gt;
Embedding an image into text is quite easy. The required tag follows the general syntax. Consider the following tag:&lt;br /&gt;
&lt;br /&gt;
 [image='set:&amp;lt;imageset&amp;gt; image:&amp;lt;image&amp;gt;']&lt;br /&gt;
&lt;br /&gt;
What you need to do here is specify the imageset where the image is specified and identify the image to be used. Let’s assume you want to embed the MouseCursor of the TaharezLook imageset into the following text: “Nice, I can even embed images like this &amp;lt;mousepic here&amp;gt; into my text.”&lt;br /&gt;
&lt;br /&gt;
First you need to know the name of the imageset and the name of the image. Let’s have a look at “TaharezLook.imageset” for that purpose:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Imageset Name=&amp;quot;TaharezLook&amp;quot; Imagefile=&amp;quot;TaharezLook.tga&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot;  &lt;br /&gt;
 AutoScaled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;Image Name=&amp;quot;MouseArrow&amp;quot; XPos=&amp;quot;138&amp;quot; YPos=&amp;quot;127&amp;quot; Width=&amp;quot;31&amp;quot; Height=&amp;quot;25&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/Imageset&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the imageset is named “TaharezLook” and the wanted image is called “MouseArrow”. In code this would now look like follows:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image='set:TaharezLook image:MouseArrow'] &lt;br /&gt;
 into my text. &amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And this is how it looks in my App:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: The following tags have an effect on the way the image is drawn: ‘padding’, ‘alignment’ and ‘colour’.&lt;br /&gt;
&lt;br /&gt;
=== Image Size ===&lt;br /&gt;
The ‘image-size’ tag allows you to change the size of embedded image components. The sizes in the tag are given in pixels and the format is as follows:&lt;br /&gt;
&lt;br /&gt;
 w:&amp;lt;width value&amp;gt; h:&amp;lt;height value&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which specifies the width and height of a following image. So to set the size of a subsequent image to 32 pixels height and 64 pixels width, you would use:&lt;br /&gt;
&lt;br /&gt;
 [image-size=’w:32 h:64’]&lt;br /&gt;
&lt;br /&gt;
Here is how it might look in code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image-size='w:32 h:64']&lt;br /&gt;
 [image='set:TaharezLook image:MouseArrow'] into my text.&amp;quot;); &lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: To set the image-size back to the real size of the image, just set the values to zero, like so:  [image-size=’w:0 h:0’]&lt;br /&gt;
&lt;br /&gt;
=== Vertical Alignment ===&lt;br /&gt;
The vertical alignment tag allows you align elements within a text that have different heights. The overall available space on a line is always taken as the height of the tallest element plus any vertical padding, elements are then positioned within this vertical space according to the specified option. Currently, you can align an element to ‘top’, ‘bottom’, ‘centre’ and ‘stretch’. The option ‘stretch’ will stretch the tagged elements vertically to fill the available space. Please note that the stretching is vertical only, aspect ratios of images and text are not maintained! This will be accounted for in the future, though.&lt;br /&gt;
&lt;br /&gt;
The following examples are valid tags for “vert-alignment”:&lt;br /&gt;
&lt;br /&gt;
 [vert-alignment='top']&lt;br /&gt;
 [vert-alignment='bottom']&lt;br /&gt;
 [vert-alignment='centre']&lt;br /&gt;
 [vert-alignment=’stretch’]&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Text can also be vertically aligned. It can be aligned to [vert-alignment='top']top, &lt;br /&gt;
 [vert-alignment='bottom']bottom, [vert-alignment='centre']centre and [vert-alignment='stretch']'stretch'&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Embedded window elements cannot be stretched currently. This may also change in the future.&lt;br /&gt;
&lt;br /&gt;
=== Padding ===&lt;br /&gt;
Padding is related to the vertical alignment tag in that it also allows you to specify the setting of elements in a text. You can set individual text elements or the whole text all together. The value you give the padding tag are a number of pixels to pad the surrounding elements with. The padding tag uses a “rect” property to specify padding values, like so: ‘l:&amp;lt;value&amp;gt; t:&amp;lt;value&amp;gt; r:&amp;lt;value&amp;gt; b:&amp;lt;value&amp;gt;) where “l” stands for “left padding, “t” stands for “top padding”, “r” stands for “right padding” and “b” stands for “bottom padding”.&lt;br /&gt;
&lt;br /&gt;
Consider the following sample text: ''“Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. THIS IS PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.”''&lt;br /&gt;
&lt;br /&gt;
Our aim is to pad the text element “THIS IS PADDED” with 5 pixels of left and right padding and 10 pixels of top and bottom padding. The tag would look like this: &lt;br /&gt;
&lt;br /&gt;
 [padding=’l:5 t:10 r:5 b:10’]&lt;br /&gt;
&lt;br /&gt;
Use padding, for example to provide extra spacing when embedding a picture or window in text.&lt;br /&gt;
Here is the code sample:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco &lt;br /&gt;
 laboris nisi ut aliquip ex ea commodo consequat. [padding=’l:5 t:10 r:5 b:10’]THIS IS PADDED.[padding=’l:0 t:0 &lt;br /&gt;
 r:0 b:0’] Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla &lt;br /&gt;
 pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id &lt;br /&gt;
 est laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks like in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Don’t try to translate the latin here – its complete nonsense. The “Lorem Ipsum” text has been around since the 1500s, when an unknown printer defined it as a dummy text to make a type specimen book, and it’s still in use today. Strange but true.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Window ===&lt;br /&gt;
The ‘window’ tag manipulates an existing child window of the window that you set the text on, such that the window is drawn in-line with the text, which means it moves with the text automatically. The ‘window’ tag takes the full name of the window just as you would use it with CEGUI::WindowManager. While the named window can be any window, it only makes sense to reference windows that are attached to the window where the text will be rendered.&lt;br /&gt;
&lt;br /&gt;
So let us embed a button into our text! &lt;br /&gt;
&lt;br /&gt;
First, we define the window in our layout:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;GUILayout &amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/FrameWindow&amp;quot; Name=&amp;quot;generat0r/AboutDialog&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;About generat0r&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;Arial-14&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarEnabled&amp;quot; Value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;CloseButtonEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;SizingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;			&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.015,0},{0.015,0},{0.45,0},{0.40,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedPosition&amp;quot; Value=&amp;quot;{ {0.25, 0}, {0.25, 0} }&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/StaticText&amp;quot; Name=&amp;quot;generat0r/AboutDialog/StaticText&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Demonstrates static (non editable) text. Use the controls on your right for &lt;br /&gt;
 formatting options.&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzExtent&amp;quot; Value=&amp;quot;361&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertExtent&amp;quot; Value=&amp;quot;59.5854&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzFormatting&amp;quot; Value=&amp;quot;WordWrapLeftAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertFormatting&amp;quot; Value=&amp;quot;TopAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.03,0},{0.03,0},{0.97,0},{0.85,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot; &lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Embedded&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/CloseButton&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Close&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/GUILayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pay special attention to the cut out segment in the above layout! Please also note that the window I want to embed is a child of the text window.&lt;br /&gt;
&lt;br /&gt;
Our tag will look like this:&lt;br /&gt;
&lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']&lt;br /&gt;
&lt;br /&gt;
Now, you just need to embed the defined window (&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot;) into the string, like so:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit,sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco  &lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']laboris nisi ut aliquip ex ea commodo consequat. THIS IS &lt;br /&gt;
 PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. &lt;br /&gt;
 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est &lt;br /&gt;
 laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The window tag works fine with formatting options for text. Please consider, though, that the embedded window is treated as a single entity. So if you embed a window that just draws text, the text of that window will not be split for wrapping purposes, but might have its own formatting! Padding and vertical alignments work here as well, with the exception of the ‘stretch’ option (which will default to ‘centre’ and raise a note in the CEGUI.log)&lt;br /&gt;
&lt;br /&gt;
Note: If you have not created the window you call here, you will get an ‘unknown object’ exception!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
Dont forget to check out the demo video: [[http://www.youtube.com/watch?v=eRC5R9aA_Zs&amp;amp;feature=player_embedded Tag Formatting Demo]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Feedback ==&lt;br /&gt;
Feedback is very welcome: please just PM me in the forum (my handle is ‘mboeni’) or leave a comment here in the wiki. :) &lt;br /&gt;
&lt;br /&gt;
[[User:Mboeni|Mboeni]] 13:33, 24 September 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Mboeni</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3450</id>
		<title>Formatting Tags in CEGUI</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3450"/>
				<updated>2010-09-24T17:21:25Z</updated>
		
		<summary type="html">&lt;p&gt;Mboeni: /* Window */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Some Basics ==&lt;br /&gt;
CEGUI has a nice feature that allows for formatted text in a widget, called “formatting tags”. Basically, you insert tags like:&lt;br /&gt;
&lt;br /&gt;
 [tag-name='value']&lt;br /&gt;
&lt;br /&gt;
into your strings and CEGUI does the necessary parsing (see [http://www.cegui.org.uk/docs/current/classCEGUI_1_1BasicRenderedStringParser.html CEGUI::BasicRenderedStringParser] class reference for details).&lt;br /&gt;
&lt;br /&gt;
It is important to note that these tags are like a ‘state change’, that means if you set a specific formatting option, it stays active until changed by another tag. You will see some examples later on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Available Tags ==&lt;br /&gt;
=== Font Colours ===&lt;br /&gt;
Changing the text colour in a string is quite easy, so let’s start with that. In the following example, we will have some text shown in red, green and blue. Here’s how the tags work:&lt;br /&gt;
&lt;br /&gt;
 &amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI can format strings.[colour='FF00FF00']&lt;br /&gt;
 and this is just colour [colour='FF0000FF'] formatting!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In code, it looks like this:&lt;br /&gt;
&lt;br /&gt;
 CEGUI::Window* textComponent =  &lt;br /&gt;
 (CEGUI::Window*)CEGUI::WindowManager::getSingleton().getWindow(&amp;quot;generat0r/AboutDialog/StaticText&amp;quot;);&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI &lt;br /&gt;
 can format strings.[colour='FF00FF00'] and this is just colour [colour='FF0000FF'] formatting!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And that's how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A note:&lt;br /&gt;
* In case you have wondered why 4 sets of values are needed for each colour:  Red, for example, is described by [colour=’FFFF0000’] where the first ‘FF’ is the Alpha value (fully opaque in this case), the second is the value for the red component, the third for the green component and the fourth for the blue component, like in [AARRGGBB]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Font Formatting ===&lt;br /&gt;
Font formatting is a bit more involved as you need to have the actual fonts and the ‘font’ XML files defined for each style.&lt;br /&gt;
&lt;br /&gt;
Let’s assume you want to use the Arial font with the styles ‘normal’, ‘''italic''’, ‘'''bold'''’ and ‘'''''bold Italic'''''’. This actually requires you to have four different Arial fonts. For Arial, the fonts are called as follows:&lt;br /&gt;
&lt;br /&gt;
* Arial normal (arial.ttf)&lt;br /&gt;
* Arial bold (arialbd.ttf)&lt;br /&gt;
* Arial italic (ariali.ttf)&lt;br /&gt;
* Arial bold italic (arialbi.ttf)&lt;br /&gt;
&lt;br /&gt;
If you want to tinker around with them you can find these and some more in the font manager app of your OS (Arial ships with Windows, so you can get them from the OS). Note that Arial is copyrighted, so you might want to use a free font for your app (check out [http://www.dafont.com/ DaFont] for example).&lt;br /&gt;
&lt;br /&gt;
For each font, you will now have to create the according “.font” file that tells CEGUI how to use the font:&lt;br /&gt;
&lt;br /&gt;
* Arial-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-10&amp;quot; Filename=&amp;quot;arial.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot; &lt;br /&gt;
 AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Bold-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Bold-10&amp;quot; Filename=&amp;quot;arialbd.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Italic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Italic-10&amp;quot; Filename=&amp;quot;ariali.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-BoldItalic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-BoldItalic-10&amp;quot; Filename=&amp;quot;arialbi.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don’t forget to add the font definitions into your scheme, like so:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;GUIScheme Name=&amp;quot;VanillaSkin&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;Imageset Filename=&amp;quot;Vanilla.imageset&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Bold-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Italic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-BoldItalic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-14.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;LookNFeel Filename=&amp;quot;Vanilla.looknfeel&amp;quot; /&amp;gt;&lt;br /&gt;
  …snip…&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;You can also do [font='Arial-Bold-10']bold text, [font='Arial-Italic-10']italic &lt;br /&gt;
 text, [font='Arial-BoldItalic-10']bold AND italic text.[font='Arial-10']!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Embedding Images ===&lt;br /&gt;
Embedding an image into text is quite easy. The required tag follows the general syntax. Consider the following tag:&lt;br /&gt;
&lt;br /&gt;
 [image='set:&amp;lt;imageset&amp;gt; image:&amp;lt;image&amp;gt;']&lt;br /&gt;
&lt;br /&gt;
What you need to do here is specify the imageset where the image is specified and identify the image to be used. Let’s assume you want to embed the MouseCursor of the TaharezLook imageset into the following text: “Nice, I can even embed images like this &amp;lt;mousepic here&amp;gt; into my text.”&lt;br /&gt;
&lt;br /&gt;
First you need to know the name of the imageset and the name of the image. Let’s have a look at “TaharezLook.imageset” for that purpose:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Imageset Name=&amp;quot;TaharezLook&amp;quot; Imagefile=&amp;quot;TaharezLook.tga&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot;  &lt;br /&gt;
 AutoScaled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;Image Name=&amp;quot;MouseArrow&amp;quot; XPos=&amp;quot;138&amp;quot; YPos=&amp;quot;127&amp;quot; Width=&amp;quot;31&amp;quot; Height=&amp;quot;25&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/Imageset&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the imageset is named “TaharezLook” and the wanted image is called “MouseArrow”. In code this would now look like follows:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image='set:TaharezLook image:MouseArrow'] &lt;br /&gt;
 into my text. &amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And this is how it looks in my App:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: The following tags have an effect on the way the image is drawn: ‘padding’, ‘alignment’ and ‘colour’.&lt;br /&gt;
&lt;br /&gt;
=== Image Size ===&lt;br /&gt;
The ‘image-size’ tag allows you to change the size of embedded image components. The sizes in the tag are given in pixels and the format is as follows:&lt;br /&gt;
&lt;br /&gt;
 w:&amp;lt;width value&amp;gt; h:&amp;lt;height value&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which specifies the width and height of a following image. So to set the size of a subsequent image to 32 pixels height and 64 pixels width, you would use:&lt;br /&gt;
&lt;br /&gt;
 [image-size=’w:32 h:64’]&lt;br /&gt;
&lt;br /&gt;
Here is how it might look in code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image-size='w:32 h:64']&lt;br /&gt;
 [image='set:TaharezLook image:MouseArrow'] into my text.&amp;quot;); &lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: To set the image-size back to the real size of the image, just set the values to zero, like so:  [image-size=’w:0 h:0’]&lt;br /&gt;
&lt;br /&gt;
=== Vertical Alignment ===&lt;br /&gt;
The vertical alignment tag allows you align elements within a text that have different heights. The overall available space on a line is always taken as the height of the tallest element plus any vertical padding, elements are then positioned within this vertical space according to the specified option. Currently, you can align an element to ‘top’, ‘bottom’, ‘centre’ and ‘stretch’. The option ‘stretch’ will stretch the tagged elements vertically to fill the available space. Please note that the stretching is vertical only, aspect ratios of images and text are not maintained! This will be accounted for in the future, though.&lt;br /&gt;
&lt;br /&gt;
The following examples are valid tags for “vert-alignment”:&lt;br /&gt;
&lt;br /&gt;
 [vert-alignment='top']&lt;br /&gt;
 [vert-alignment='bottom']&lt;br /&gt;
 [vert-alignment='centre']&lt;br /&gt;
 [vert-alignment=’stretch’]&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Text can also be vertically aligned. It can be aligned to [vert-alignment='top']top, &lt;br /&gt;
 [vert-alignment='bottom']bottom, [vert-alignment='centre']centre and [vert-alignment='stretch']'stretch'&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Embedded window elements cannot be stretched currently. This may also change in the future.&lt;br /&gt;
&lt;br /&gt;
=== Padding ===&lt;br /&gt;
Padding is related to the vertical alignment tag in that it also allows you to specify the setting of elements in a text. You can set individual text elements or the whole text all together. The value you give the padding tag are a number of pixels to pad the surrounding elements with. The padding tag uses a “rect” property to specify padding values, like so: ‘l:&amp;lt;value&amp;gt; t:&amp;lt;value&amp;gt; r:&amp;lt;value&amp;gt; b:&amp;lt;value&amp;gt;) where “l” stands for “left padding, “t” stands for “top padding”, “r” stands for “right padding” and “b” stands for “bottom padding”.&lt;br /&gt;
&lt;br /&gt;
Consider the following sample text: ''“Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. THIS IS PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.”''&lt;br /&gt;
&lt;br /&gt;
Our aim is to pad the text element “THIS IS PADDED” with 5 pixels of left and right padding and 10 pixels of top and bottom padding. The tag would look like this: &lt;br /&gt;
&lt;br /&gt;
 [padding=’l:5 t:10 r:5 b:10’]&lt;br /&gt;
&lt;br /&gt;
Use padding, for example to provide extra spacing when embedding a picture or window in text.&lt;br /&gt;
Here is the code sample:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco &lt;br /&gt;
 laboris nisi ut aliquip ex ea commodo consequat. [padding=’l:5 t:10 r:5 b:10’]THIS IS PADDED.[padding=’l:0 t:0 &lt;br /&gt;
 r:0 b:0’] Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla &lt;br /&gt;
 pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id &lt;br /&gt;
 est laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks like in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Don’t try to translate the latin here – its complete nonsense. The “Lorem Ipsum” text has been around since the 1500s, when an unknown printer defined it as a dummy text to make a type specimen book, and it’s still in use today. Strange but true.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Window ===&lt;br /&gt;
The ‘window’ tag manipulates an existing child window of the window that you set the text on, such that the window is drawn in-line with the text, which means it moves with the text automatically. The ‘window’ tag takes the full name of the window just as you would use it with CEGUI::WindowManager. While the named window can be any window, it only makes sense to reference windows that are attached to the window where the text will be rendered.&lt;br /&gt;
&lt;br /&gt;
So let us embed a button into our text! &lt;br /&gt;
&lt;br /&gt;
First, we define the window in our layout:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;GUILayout &amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/FrameWindow&amp;quot; Name=&amp;quot;generat0r/AboutDialog&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;About generat0r&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;Arial-14&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarEnabled&amp;quot; Value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;CloseButtonEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;SizingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;			&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.015,0},{0.015,0},{0.45,0},{0.40,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedPosition&amp;quot; Value=&amp;quot;{ {0.25, 0}, {0.25, 0} }&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/StaticText&amp;quot; Name=&amp;quot;generat0r/AboutDialog/StaticText&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Demonstrates static (non editable) text. Use the controls on your right for &lt;br /&gt;
 formatting options.&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzExtent&amp;quot; Value=&amp;quot;361&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertExtent&amp;quot; Value=&amp;quot;59.5854&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzFormatting&amp;quot; Value=&amp;quot;WordWrapLeftAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertFormatting&amp;quot; Value=&amp;quot;TopAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.03,0},{0.03,0},{0.97,0},{0.85,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot; &lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Embedded&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/CloseButton&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Close&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/GUILayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pay special attention to the cut out segment in the above layout! Please also note that the window I want to embed is a child of the text window.&lt;br /&gt;
&lt;br /&gt;
Our tag will look like this:&lt;br /&gt;
&lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']&lt;br /&gt;
&lt;br /&gt;
Now, you just need to embed the defined window (&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot;) into the string, like so:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit,sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco  &lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']laboris nisi ut aliquip ex ea commodo consequat. THIS IS &lt;br /&gt;
 PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. &lt;br /&gt;
 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est &lt;br /&gt;
 laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The window tag works fine with formatting options for text. Please consider, though, that the embedded window is treated as a single entity. So if you embed a window that just draws text, the text of that window will not be split for wrapping purposes, but might have its own formatting! Padding and vertical alignments work here as well, with the exception of the ‘stretch’ option (which will default to ‘centre’ and raise a note in the CEGUI.log)&lt;br /&gt;
&lt;br /&gt;
Note: If you have not created the window you call here, you will get an ‘unknown object’ exception!&lt;br /&gt;
&lt;br /&gt;
== Feedback ==&lt;br /&gt;
Feedback is very welcome: please just PM me in the forum (my handle is ‘mboeni’) or leave a comment here in the wiki. :) &lt;br /&gt;
&lt;br /&gt;
[[User:Mboeni|Mboeni]] 13:33, 24 September 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Mboeni</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3449</id>
		<title>Formatting Tags in CEGUI</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3449"/>
				<updated>2010-09-24T17:19:30Z</updated>
		
		<summary type="html">&lt;p&gt;Mboeni: /* Vertical Alignment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Some Basics ==&lt;br /&gt;
CEGUI has a nice feature that allows for formatted text in a widget, called “formatting tags”. Basically, you insert tags like:&lt;br /&gt;
&lt;br /&gt;
 [tag-name='value']&lt;br /&gt;
&lt;br /&gt;
into your strings and CEGUI does the necessary parsing (see [http://www.cegui.org.uk/docs/current/classCEGUI_1_1BasicRenderedStringParser.html CEGUI::BasicRenderedStringParser] class reference for details).&lt;br /&gt;
&lt;br /&gt;
It is important to note that these tags are like a ‘state change’, that means if you set a specific formatting option, it stays active until changed by another tag. You will see some examples later on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Available Tags ==&lt;br /&gt;
=== Font Colours ===&lt;br /&gt;
Changing the text colour in a string is quite easy, so let’s start with that. In the following example, we will have some text shown in red, green and blue. Here’s how the tags work:&lt;br /&gt;
&lt;br /&gt;
 &amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI can format strings.[colour='FF00FF00']&lt;br /&gt;
 and this is just colour [colour='FF0000FF'] formatting!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In code, it looks like this:&lt;br /&gt;
&lt;br /&gt;
 CEGUI::Window* textComponent =  &lt;br /&gt;
 (CEGUI::Window*)CEGUI::WindowManager::getSingleton().getWindow(&amp;quot;generat0r/AboutDialog/StaticText&amp;quot;);&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI &lt;br /&gt;
 can format strings.[colour='FF00FF00'] and this is just colour [colour='FF0000FF'] formatting!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And that's how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A note:&lt;br /&gt;
* In case you have wondered why 4 sets of values are needed for each colour:  Red, for example, is described by [colour=’FFFF0000’] where the first ‘FF’ is the Alpha value (fully opaque in this case), the second is the value for the red component, the third for the green component and the fourth for the blue component, like in [AARRGGBB]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Font Formatting ===&lt;br /&gt;
Font formatting is a bit more involved as you need to have the actual fonts and the ‘font’ XML files defined for each style.&lt;br /&gt;
&lt;br /&gt;
Let’s assume you want to use the Arial font with the styles ‘normal’, ‘''italic''’, ‘'''bold'''’ and ‘'''''bold Italic'''''’. This actually requires you to have four different Arial fonts. For Arial, the fonts are called as follows:&lt;br /&gt;
&lt;br /&gt;
* Arial normal (arial.ttf)&lt;br /&gt;
* Arial bold (arialbd.ttf)&lt;br /&gt;
* Arial italic (ariali.ttf)&lt;br /&gt;
* Arial bold italic (arialbi.ttf)&lt;br /&gt;
&lt;br /&gt;
If you want to tinker around with them you can find these and some more in the font manager app of your OS (Arial ships with Windows, so you can get them from the OS). Note that Arial is copyrighted, so you might want to use a free font for your app (check out [http://www.dafont.com/ DaFont] for example).&lt;br /&gt;
&lt;br /&gt;
For each font, you will now have to create the according “.font” file that tells CEGUI how to use the font:&lt;br /&gt;
&lt;br /&gt;
* Arial-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-10&amp;quot; Filename=&amp;quot;arial.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot; &lt;br /&gt;
 AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Bold-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Bold-10&amp;quot; Filename=&amp;quot;arialbd.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Italic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Italic-10&amp;quot; Filename=&amp;quot;ariali.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-BoldItalic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-BoldItalic-10&amp;quot; Filename=&amp;quot;arialbi.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don’t forget to add the font definitions into your scheme, like so:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;GUIScheme Name=&amp;quot;VanillaSkin&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;Imageset Filename=&amp;quot;Vanilla.imageset&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Bold-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Italic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-BoldItalic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-14.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;LookNFeel Filename=&amp;quot;Vanilla.looknfeel&amp;quot; /&amp;gt;&lt;br /&gt;
  …snip…&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;You can also do [font='Arial-Bold-10']bold text, [font='Arial-Italic-10']italic &lt;br /&gt;
 text, [font='Arial-BoldItalic-10']bold AND italic text.[font='Arial-10']!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Embedding Images ===&lt;br /&gt;
Embedding an image into text is quite easy. The required tag follows the general syntax. Consider the following tag:&lt;br /&gt;
&lt;br /&gt;
 [image='set:&amp;lt;imageset&amp;gt; image:&amp;lt;image&amp;gt;']&lt;br /&gt;
&lt;br /&gt;
What you need to do here is specify the imageset where the image is specified and identify the image to be used. Let’s assume you want to embed the MouseCursor of the TaharezLook imageset into the following text: “Nice, I can even embed images like this &amp;lt;mousepic here&amp;gt; into my text.”&lt;br /&gt;
&lt;br /&gt;
First you need to know the name of the imageset and the name of the image. Let’s have a look at “TaharezLook.imageset” for that purpose:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Imageset Name=&amp;quot;TaharezLook&amp;quot; Imagefile=&amp;quot;TaharezLook.tga&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot;  &lt;br /&gt;
 AutoScaled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;Image Name=&amp;quot;MouseArrow&amp;quot; XPos=&amp;quot;138&amp;quot; YPos=&amp;quot;127&amp;quot; Width=&amp;quot;31&amp;quot; Height=&amp;quot;25&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/Imageset&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the imageset is named “TaharezLook” and the wanted image is called “MouseArrow”. In code this would now look like follows:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image='set:TaharezLook image:MouseArrow'] &lt;br /&gt;
 into my text. &amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And this is how it looks in my App:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: The following tags have an effect on the way the image is drawn: ‘padding’, ‘alignment’ and ‘colour’.&lt;br /&gt;
&lt;br /&gt;
=== Image Size ===&lt;br /&gt;
The ‘image-size’ tag allows you to change the size of embedded image components. The sizes in the tag are given in pixels and the format is as follows:&lt;br /&gt;
&lt;br /&gt;
 w:&amp;lt;width value&amp;gt; h:&amp;lt;height value&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which specifies the width and height of a following image. So to set the size of a subsequent image to 32 pixels height and 64 pixels width, you would use:&lt;br /&gt;
&lt;br /&gt;
 [image-size=’w:32 h:64’]&lt;br /&gt;
&lt;br /&gt;
Here is how it might look in code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image-size='w:32 h:64']&lt;br /&gt;
 [image='set:TaharezLook image:MouseArrow'] into my text.&amp;quot;); &lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: To set the image-size back to the real size of the image, just set the values to zero, like so:  [image-size=’w:0 h:0’]&lt;br /&gt;
&lt;br /&gt;
=== Vertical Alignment ===&lt;br /&gt;
The vertical alignment tag allows you align elements within a text that have different heights. The overall available space on a line is always taken as the height of the tallest element plus any vertical padding, elements are then positioned within this vertical space according to the specified option. Currently, you can align an element to ‘top’, ‘bottom’, ‘centre’ and ‘stretch’. The option ‘stretch’ will stretch the tagged elements vertically to fill the available space. Please note that the stretching is vertical only, aspect ratios of images and text are not maintained! This will be accounted for in the future, though.&lt;br /&gt;
&lt;br /&gt;
The following examples are valid tags for “vert-alignment”:&lt;br /&gt;
&lt;br /&gt;
 [vert-alignment='top']&lt;br /&gt;
 [vert-alignment='bottom']&lt;br /&gt;
 [vert-alignment='centre']&lt;br /&gt;
 [vert-alignment=’stretch’]&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Text can also be vertically aligned. It can be aligned to [vert-alignment='top']top, &lt;br /&gt;
 [vert-alignment='bottom']bottom, [vert-alignment='centre']centre and [vert-alignment='stretch']'stretch'&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Embedded window elements cannot be stretched currently. This may also change in the future.&lt;br /&gt;
&lt;br /&gt;
=== Padding ===&lt;br /&gt;
Padding is related to the vertical alignment tag in that it also allows you to specify the setting of elements in a text. You can set individual text elements or the whole text all together. The value you give the padding tag are a number of pixels to pad the surrounding elements with. The padding tag uses a “rect” property to specify padding values, like so: ‘l:&amp;lt;value&amp;gt; t:&amp;lt;value&amp;gt; r:&amp;lt;value&amp;gt; b:&amp;lt;value&amp;gt;) where “l” stands for “left padding, “t” stands for “top padding”, “r” stands for “right padding” and “b” stands for “bottom padding”.&lt;br /&gt;
&lt;br /&gt;
Consider the following sample text: ''“Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. THIS IS PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.”''&lt;br /&gt;
&lt;br /&gt;
Our aim is to pad the text element “THIS IS PADDED” with 5 pixels of left and right padding and 10 pixels of top and bottom padding. The tag would look like this: &lt;br /&gt;
&lt;br /&gt;
 [padding=’l:5 t:10 r:5 b:10’]&lt;br /&gt;
&lt;br /&gt;
Use padding, for example to provide extra spacing when embedding a picture or window in text.&lt;br /&gt;
Here is the code sample:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco &lt;br /&gt;
 laboris nisi ut aliquip ex ea commodo consequat. [padding=’l:5 t:10 r:5 b:10’]THIS IS PADDED.[padding=’l:0 t:0 &lt;br /&gt;
 r:0 b:0’] Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla &lt;br /&gt;
 pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id &lt;br /&gt;
 est laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks like in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Don’t try to translate the latin here – its complete nonsense. The “Lorem Ipsum” text has been around since the 1500s, when an unknown printer defined it as a dummy text to make a type specimen book, and it’s still in use today. Strange but true.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Window ===&lt;br /&gt;
The ‘window’ tag manipulates an existing child window of the window that you set the text on, such that the window is drawn in-line with the text, which means it moves with the text automatically. The ‘window’ tag takes the full name of the window just as you would use it with CEGUI::WindowManager. While the named window can be any window, it only makes sense to reference windows that are attached to the window where the text will be rendered.&lt;br /&gt;
&lt;br /&gt;
So let us embed a button into our text! &lt;br /&gt;
&lt;br /&gt;
First, we define the window in our layout:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;GUILayout &amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/FrameWindow&amp;quot; Name=&amp;quot;generat0r/AboutDialog&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;About generat0r&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;Arial-14&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarEnabled&amp;quot; Value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;CloseButtonEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;SizingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;			&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.015,0},{0.015,0},{0.45,0},{0.40,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedPosition&amp;quot; Value=&amp;quot;{ {0.25, 0}, {0.25, 0} }&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/StaticText&amp;quot; Name=&amp;quot;generat0r/AboutDialog/StaticText&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Demonstrates static (non editable) text. Use the controls on your right for &lt;br /&gt;
 formatting options.&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzExtent&amp;quot; Value=&amp;quot;361&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertExtent&amp;quot; Value=&amp;quot;59.5854&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzFormatting&amp;quot; Value=&amp;quot;WordWrapLeftAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertFormatting&amp;quot; Value=&amp;quot;TopAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.03,0},{0.03,0},{0.97,0},{0.85,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot; &lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Embedded&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/CloseButton&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Close&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/GUILayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pay special attention to the cut out segment in the above layout! Please also note that the window I want to embed is a child of the text window.&lt;br /&gt;
&lt;br /&gt;
Our tag will look like this:&lt;br /&gt;
&lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']&lt;br /&gt;
&lt;br /&gt;
Now, you just need to embed the defined window (&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot;) into you string, like so:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit,sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco  &lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']laboris nisi ut aliquip ex ea commodo consequat. THIS IS &lt;br /&gt;
 PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. &lt;br /&gt;
 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est &lt;br /&gt;
 laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The window tag works fine with formatting options for text. Please consider, though, that the embedded window is treated as a single entity. So if you embed a window that just draws text, the text of that window will not be split for wrapping purposes, but might have its own formatting! Padding and vertical alignments work here as well, with the exception of the ‘stretch’ option (which will default to ‘centre’ and raise a note in the CEGUI.log)&lt;br /&gt;
&lt;br /&gt;
Note: If you have not created the window you call here, you will get an ‘unknown object’ exception!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Feedback ==&lt;br /&gt;
Feedback is very welcome: please just PM me in the forum (my handle is ‘mboeni’) or leave a comment here in the wiki. :) &lt;br /&gt;
&lt;br /&gt;
[[User:Mboeni|Mboeni]] 13:33, 24 September 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Mboeni</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3448</id>
		<title>Formatting Tags in CEGUI</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3448"/>
				<updated>2010-09-24T17:19:05Z</updated>
		
		<summary type="html">&lt;p&gt;Mboeni: /* Image Size */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Some Basics ==&lt;br /&gt;
CEGUI has a nice feature that allows for formatted text in a widget, called “formatting tags”. Basically, you insert tags like:&lt;br /&gt;
&lt;br /&gt;
 [tag-name='value']&lt;br /&gt;
&lt;br /&gt;
into your strings and CEGUI does the necessary parsing (see [http://www.cegui.org.uk/docs/current/classCEGUI_1_1BasicRenderedStringParser.html CEGUI::BasicRenderedStringParser] class reference for details).&lt;br /&gt;
&lt;br /&gt;
It is important to note that these tags are like a ‘state change’, that means if you set a specific formatting option, it stays active until changed by another tag. You will see some examples later on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Available Tags ==&lt;br /&gt;
=== Font Colours ===&lt;br /&gt;
Changing the text colour in a string is quite easy, so let’s start with that. In the following example, we will have some text shown in red, green and blue. Here’s how the tags work:&lt;br /&gt;
&lt;br /&gt;
 &amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI can format strings.[colour='FF00FF00']&lt;br /&gt;
 and this is just colour [colour='FF0000FF'] formatting!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In code, it looks like this:&lt;br /&gt;
&lt;br /&gt;
 CEGUI::Window* textComponent =  &lt;br /&gt;
 (CEGUI::Window*)CEGUI::WindowManager::getSingleton().getWindow(&amp;quot;generat0r/AboutDialog/StaticText&amp;quot;);&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI &lt;br /&gt;
 can format strings.[colour='FF00FF00'] and this is just colour [colour='FF0000FF'] formatting!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And that's how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A note:&lt;br /&gt;
* In case you have wondered why 4 sets of values are needed for each colour:  Red, for example, is described by [colour=’FFFF0000’] where the first ‘FF’ is the Alpha value (fully opaque in this case), the second is the value for the red component, the third for the green component and the fourth for the blue component, like in [AARRGGBB]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Font Formatting ===&lt;br /&gt;
Font formatting is a bit more involved as you need to have the actual fonts and the ‘font’ XML files defined for each style.&lt;br /&gt;
&lt;br /&gt;
Let’s assume you want to use the Arial font with the styles ‘normal’, ‘''italic''’, ‘'''bold'''’ and ‘'''''bold Italic'''''’. This actually requires you to have four different Arial fonts. For Arial, the fonts are called as follows:&lt;br /&gt;
&lt;br /&gt;
* Arial normal (arial.ttf)&lt;br /&gt;
* Arial bold (arialbd.ttf)&lt;br /&gt;
* Arial italic (ariali.ttf)&lt;br /&gt;
* Arial bold italic (arialbi.ttf)&lt;br /&gt;
&lt;br /&gt;
If you want to tinker around with them you can find these and some more in the font manager app of your OS (Arial ships with Windows, so you can get them from the OS). Note that Arial is copyrighted, so you might want to use a free font for your app (check out [http://www.dafont.com/ DaFont] for example).&lt;br /&gt;
&lt;br /&gt;
For each font, you will now have to create the according “.font” file that tells CEGUI how to use the font:&lt;br /&gt;
&lt;br /&gt;
* Arial-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-10&amp;quot; Filename=&amp;quot;arial.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot; &lt;br /&gt;
 AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Bold-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Bold-10&amp;quot; Filename=&amp;quot;arialbd.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Italic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Italic-10&amp;quot; Filename=&amp;quot;ariali.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-BoldItalic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-BoldItalic-10&amp;quot; Filename=&amp;quot;arialbi.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don’t forget to add the font definitions into your scheme, like so:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;GUIScheme Name=&amp;quot;VanillaSkin&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;Imageset Filename=&amp;quot;Vanilla.imageset&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Bold-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Italic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-BoldItalic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-14.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;LookNFeel Filename=&amp;quot;Vanilla.looknfeel&amp;quot; /&amp;gt;&lt;br /&gt;
  …snip…&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;You can also do [font='Arial-Bold-10']bold text, [font='Arial-Italic-10']italic &lt;br /&gt;
 text, [font='Arial-BoldItalic-10']bold AND italic text.[font='Arial-10']!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Embedding Images ===&lt;br /&gt;
Embedding an image into text is quite easy. The required tag follows the general syntax. Consider the following tag:&lt;br /&gt;
&lt;br /&gt;
 [image='set:&amp;lt;imageset&amp;gt; image:&amp;lt;image&amp;gt;']&lt;br /&gt;
&lt;br /&gt;
What you need to do here is specify the imageset where the image is specified and identify the image to be used. Let’s assume you want to embed the MouseCursor of the TaharezLook imageset into the following text: “Nice, I can even embed images like this &amp;lt;mousepic here&amp;gt; into my text.”&lt;br /&gt;
&lt;br /&gt;
First you need to know the name of the imageset and the name of the image. Let’s have a look at “TaharezLook.imageset” for that purpose:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Imageset Name=&amp;quot;TaharezLook&amp;quot; Imagefile=&amp;quot;TaharezLook.tga&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot;  &lt;br /&gt;
 AutoScaled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;Image Name=&amp;quot;MouseArrow&amp;quot; XPos=&amp;quot;138&amp;quot; YPos=&amp;quot;127&amp;quot; Width=&amp;quot;31&amp;quot; Height=&amp;quot;25&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/Imageset&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the imageset is named “TaharezLook” and the wanted image is called “MouseArrow”. In code this would now look like follows:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image='set:TaharezLook image:MouseArrow'] &lt;br /&gt;
 into my text. &amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And this is how it looks in my App:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: The following tags have an effect on the way the image is drawn: ‘padding’, ‘alignment’ and ‘colour’.&lt;br /&gt;
&lt;br /&gt;
=== Image Size ===&lt;br /&gt;
The ‘image-size’ tag allows you to change the size of embedded image components. The sizes in the tag are given in pixels and the format is as follows:&lt;br /&gt;
&lt;br /&gt;
 w:&amp;lt;width value&amp;gt; h:&amp;lt;height value&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which specifies the width and height of a following image. So to set the size of a subsequent image to 32 pixels height and 64 pixels width, you would use:&lt;br /&gt;
&lt;br /&gt;
 [image-size=’w:32 h:64’]&lt;br /&gt;
&lt;br /&gt;
Here is how it might look in code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image-size='w:32 h:64']&lt;br /&gt;
 [image='set:TaharezLook image:MouseArrow'] into my text.&amp;quot;); &lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: To set the image-size back to the real size of the image, just set the values to zero, like so:  [image-size=’w:0 h:0’]&lt;br /&gt;
&lt;br /&gt;
=== Vertical Alignment ===&lt;br /&gt;
The vertical alignment Tag allows you align elements within a text that have different heights. The overall available space on a line is always taken as the height of the tallest element plus any vertical padding, elements are then positioned within this vertical space according to the specified option. Currently, you can align an element to ‘top’, ‘bottom’, ‘centre’ and ‘stretch’. The option ‘stretch’ will stretch the tagged elements vertically to fill the available space. Please note that the stretching is vertical only, aspect ratios of images and text are not maintained! This will be accounted for in the future, though.&lt;br /&gt;
&lt;br /&gt;
The following examples are valid tags for “vert-alignment”:&lt;br /&gt;
&lt;br /&gt;
 [vert-alignment='top']&lt;br /&gt;
 [vert-alignment='bottom']&lt;br /&gt;
 [vert-alignment='centre']&lt;br /&gt;
 [vert-alignment=’stretch’]&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Text can also be vertically aligned. It can be aligned to [vert-alignment='top']top, &lt;br /&gt;
 [vert-alignment='bottom']bottom, [vert-alignment='centre']centre and [vert-alignment='stretch']'stretch'&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Embedded window elements cannot be stretched currently. This may also change in the future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Padding ===&lt;br /&gt;
Padding is related to the vertical alignment tag in that it also allows you to specify the setting of elements in a text. You can set individual text elements or the whole text all together. The value you give the padding tag are a number of pixels to pad the surrounding elements with. The padding tag uses a “rect” property to specify padding values, like so: ‘l:&amp;lt;value&amp;gt; t:&amp;lt;value&amp;gt; r:&amp;lt;value&amp;gt; b:&amp;lt;value&amp;gt;) where “l” stands for “left padding, “t” stands for “top padding”, “r” stands for “right padding” and “b” stands for “bottom padding”.&lt;br /&gt;
&lt;br /&gt;
Consider the following sample text: ''“Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. THIS IS PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.”''&lt;br /&gt;
&lt;br /&gt;
Our aim is to pad the text element “THIS IS PADDED” with 5 pixels of left and right padding and 10 pixels of top and bottom padding. The tag would look like this: &lt;br /&gt;
&lt;br /&gt;
 [padding=’l:5 t:10 r:5 b:10’]&lt;br /&gt;
&lt;br /&gt;
Use padding, for example to provide extra spacing when embedding a picture or window in text.&lt;br /&gt;
Here is the code sample:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco &lt;br /&gt;
 laboris nisi ut aliquip ex ea commodo consequat. [padding=’l:5 t:10 r:5 b:10’]THIS IS PADDED.[padding=’l:0 t:0 &lt;br /&gt;
 r:0 b:0’] Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla &lt;br /&gt;
 pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id &lt;br /&gt;
 est laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks like in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Don’t try to translate the latin here – its complete nonsense. The “Lorem Ipsum” text has been around since the 1500s, when an unknown printer defined it as a dummy text to make a type specimen book, and it’s still in use today. Strange but true.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Window ===&lt;br /&gt;
The ‘window’ tag manipulates an existing child window of the window that you set the text on, such that the window is drawn in-line with the text, which means it moves with the text automatically. The ‘window’ tag takes the full name of the window just as you would use it with CEGUI::WindowManager. While the named window can be any window, it only makes sense to reference windows that are attached to the window where the text will be rendered.&lt;br /&gt;
&lt;br /&gt;
So let us embed a button into our text! &lt;br /&gt;
&lt;br /&gt;
First, we define the window in our layout:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;GUILayout &amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/FrameWindow&amp;quot; Name=&amp;quot;generat0r/AboutDialog&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;About generat0r&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;Arial-14&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarEnabled&amp;quot; Value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;CloseButtonEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;SizingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;			&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.015,0},{0.015,0},{0.45,0},{0.40,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedPosition&amp;quot; Value=&amp;quot;{ {0.25, 0}, {0.25, 0} }&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/StaticText&amp;quot; Name=&amp;quot;generat0r/AboutDialog/StaticText&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Demonstrates static (non editable) text. Use the controls on your right for &lt;br /&gt;
 formatting options.&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzExtent&amp;quot; Value=&amp;quot;361&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertExtent&amp;quot; Value=&amp;quot;59.5854&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzFormatting&amp;quot; Value=&amp;quot;WordWrapLeftAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertFormatting&amp;quot; Value=&amp;quot;TopAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.03,0},{0.03,0},{0.97,0},{0.85,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot; &lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Embedded&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/CloseButton&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Close&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/GUILayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pay special attention to the cut out segment in the above layout! Please also note that the window I want to embed is a child of the text window.&lt;br /&gt;
&lt;br /&gt;
Our tag will look like this:&lt;br /&gt;
&lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']&lt;br /&gt;
&lt;br /&gt;
Now, you just need to embed the defined window (&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot;) into you string, like so:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit,sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco  &lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']laboris nisi ut aliquip ex ea commodo consequat. THIS IS &lt;br /&gt;
 PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. &lt;br /&gt;
 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est &lt;br /&gt;
 laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The window tag works fine with formatting options for text. Please consider, though, that the embedded window is treated as a single entity. So if you embed a window that just draws text, the text of that window will not be split for wrapping purposes, but might have its own formatting! Padding and vertical alignments work here as well, with the exception of the ‘stretch’ option (which will default to ‘centre’ and raise a note in the CEGUI.log)&lt;br /&gt;
&lt;br /&gt;
Note: If you have not created the window you call here, you will get an ‘unknown object’ exception!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Feedback ==&lt;br /&gt;
Feedback is very welcome: please just PM me in the forum (my handle is ‘mboeni’) or leave a comment here in the wiki. :) &lt;br /&gt;
&lt;br /&gt;
[[User:Mboeni|Mboeni]] 13:33, 24 September 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Mboeni</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3447</id>
		<title>Formatting Tags in CEGUI</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3447"/>
				<updated>2010-09-24T17:18:21Z</updated>
		
		<summary type="html">&lt;p&gt;Mboeni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Some Basics ==&lt;br /&gt;
CEGUI has a nice feature that allows for formatted text in a widget, called “formatting tags”. Basically, you insert tags like:&lt;br /&gt;
&lt;br /&gt;
 [tag-name='value']&lt;br /&gt;
&lt;br /&gt;
into your strings and CEGUI does the necessary parsing (see [http://www.cegui.org.uk/docs/current/classCEGUI_1_1BasicRenderedStringParser.html CEGUI::BasicRenderedStringParser] class reference for details).&lt;br /&gt;
&lt;br /&gt;
It is important to note that these tags are like a ‘state change’, that means if you set a specific formatting option, it stays active until changed by another tag. You will see some examples later on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Available Tags ==&lt;br /&gt;
=== Font Colours ===&lt;br /&gt;
Changing the text colour in a string is quite easy, so let’s start with that. In the following example, we will have some text shown in red, green and blue. Here’s how the tags work:&lt;br /&gt;
&lt;br /&gt;
 &amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI can format strings.[colour='FF00FF00']&lt;br /&gt;
 and this is just colour [colour='FF0000FF'] formatting!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In code, it looks like this:&lt;br /&gt;
&lt;br /&gt;
 CEGUI::Window* textComponent =  &lt;br /&gt;
 (CEGUI::Window*)CEGUI::WindowManager::getSingleton().getWindow(&amp;quot;generat0r/AboutDialog/StaticText&amp;quot;);&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI &lt;br /&gt;
 can format strings.[colour='FF00FF00'] and this is just colour [colour='FF0000FF'] formatting!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And that's how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A note:&lt;br /&gt;
* In case you have wondered why 4 sets of values are needed for each colour:  Red, for example, is described by [colour=’FFFF0000’] where the first ‘FF’ is the Alpha value (fully opaque in this case), the second is the value for the red component, the third for the green component and the fourth for the blue component, like in [AARRGGBB]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Font Formatting ===&lt;br /&gt;
Font formatting is a bit more involved as you need to have the actual fonts and the ‘font’ XML files defined for each style.&lt;br /&gt;
&lt;br /&gt;
Let’s assume you want to use the Arial font with the styles ‘normal’, ‘''italic''’, ‘'''bold'''’ and ‘'''''bold Italic'''''’. This actually requires you to have four different Arial fonts. For Arial, the fonts are called as follows:&lt;br /&gt;
&lt;br /&gt;
* Arial normal (arial.ttf)&lt;br /&gt;
* Arial bold (arialbd.ttf)&lt;br /&gt;
* Arial italic (ariali.ttf)&lt;br /&gt;
* Arial bold italic (arialbi.ttf)&lt;br /&gt;
&lt;br /&gt;
If you want to tinker around with them you can find these and some more in the font manager app of your OS (Arial ships with Windows, so you can get them from the OS). Note that Arial is copyrighted, so you might want to use a free font for your app (check out [http://www.dafont.com/ DaFont] for example).&lt;br /&gt;
&lt;br /&gt;
For each font, you will now have to create the according “.font” file that tells CEGUI how to use the font:&lt;br /&gt;
&lt;br /&gt;
* Arial-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-10&amp;quot; Filename=&amp;quot;arial.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot; &lt;br /&gt;
 AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Bold-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Bold-10&amp;quot; Filename=&amp;quot;arialbd.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Italic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Italic-10&amp;quot; Filename=&amp;quot;ariali.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-BoldItalic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-BoldItalic-10&amp;quot; Filename=&amp;quot;arialbi.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don’t forget to add the font definitions into your scheme, like so:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;GUIScheme Name=&amp;quot;VanillaSkin&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;Imageset Filename=&amp;quot;Vanilla.imageset&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Bold-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Italic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-BoldItalic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-14.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;LookNFeel Filename=&amp;quot;Vanilla.looknfeel&amp;quot; /&amp;gt;&lt;br /&gt;
  …snip…&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;You can also do [font='Arial-Bold-10']bold text, [font='Arial-Italic-10']italic &lt;br /&gt;
 text, [font='Arial-BoldItalic-10']bold AND italic text.[font='Arial-10']!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Embedding Images ===&lt;br /&gt;
Embedding an image into text is quite easy. The required tag follows the general syntax. Consider the following tag:&lt;br /&gt;
&lt;br /&gt;
 [image='set:&amp;lt;imageset&amp;gt; image:&amp;lt;image&amp;gt;']&lt;br /&gt;
&lt;br /&gt;
What you need to do here is specify the imageset where the image is specified and identify the image to be used. Let’s assume you want to embed the MouseCursor of the TaharezLook imageset into the following text: “Nice, I can even embed images like this &amp;lt;mousepic here&amp;gt; into my text.”&lt;br /&gt;
&lt;br /&gt;
First you need to know the name of the imageset and the name of the image. Let’s have a look at “TaharezLook.imageset” for that purpose:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Imageset Name=&amp;quot;TaharezLook&amp;quot; Imagefile=&amp;quot;TaharezLook.tga&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot;  &lt;br /&gt;
 AutoScaled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;Image Name=&amp;quot;MouseArrow&amp;quot; XPos=&amp;quot;138&amp;quot; YPos=&amp;quot;127&amp;quot; Width=&amp;quot;31&amp;quot; Height=&amp;quot;25&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/Imageset&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the imageset is named “TaharezLook” and the wanted image is called “MouseArrow”. In code this would now look like follows:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image='set:TaharezLook image:MouseArrow'] &lt;br /&gt;
 into my text. &amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And this is how it looks in my App:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: The following tags have an effect on the way the image is drawn: ‘padding’, ‘alignment’ and ‘colour’.&lt;br /&gt;
&lt;br /&gt;
=== Image Size ===&lt;br /&gt;
The ‘image-size’ tag allows you to change the size of embedded image components. The sized in the tag are given in pixels and the format is as follows:&lt;br /&gt;
&lt;br /&gt;
 w:&amp;lt;width value&amp;gt; h:&amp;lt;height value&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which specifies the width and height of a following image. So to set the size of a subsequent image to 32 pixels height and 64 pixels width, you would use:&lt;br /&gt;
&lt;br /&gt;
 [image-size=’w:32 h:64’]&lt;br /&gt;
&lt;br /&gt;
Here is how it might look in code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image-size='w:32 h:64']&lt;br /&gt;
 [image='set:TaharezLook image:MouseArrow'] into my text.&amp;quot;); &lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: To set the image-size back to the real size of the image, just set the values to zero, like so:  [image-size=’w:0 h:0’]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Vertical Alignment ===&lt;br /&gt;
The vertical alignment Tag allows you align elements within a text that have different heights. The overall available space on a line is always taken as the height of the tallest element plus any vertical padding, elements are then positioned within this vertical space according to the specified option. Currently, you can align an element to ‘top’, ‘bottom’, ‘centre’ and ‘stretch’. The option ‘stretch’ will stretch the tagged elements vertically to fill the available space. Please note that the stretching is vertical only, aspect ratios of images and text are not maintained! This will be accounted for in the future, though.&lt;br /&gt;
&lt;br /&gt;
The following examples are valid tags for “vert-alignment”:&lt;br /&gt;
&lt;br /&gt;
 [vert-alignment='top']&lt;br /&gt;
 [vert-alignment='bottom']&lt;br /&gt;
 [vert-alignment='centre']&lt;br /&gt;
 [vert-alignment=’stretch’]&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Text can also be vertically aligned. It can be aligned to [vert-alignment='top']top, &lt;br /&gt;
 [vert-alignment='bottom']bottom, [vert-alignment='centre']centre and [vert-alignment='stretch']'stretch'&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Embedded window elements cannot be stretched currently. This may also change in the future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Padding ===&lt;br /&gt;
Padding is related to the vertical alignment tag in that it also allows you to specify the setting of elements in a text. You can set individual text elements or the whole text all together. The value you give the padding tag are a number of pixels to pad the surrounding elements with. The padding tag uses a “rect” property to specify padding values, like so: ‘l:&amp;lt;value&amp;gt; t:&amp;lt;value&amp;gt; r:&amp;lt;value&amp;gt; b:&amp;lt;value&amp;gt;) where “l” stands for “left padding, “t” stands for “top padding”, “r” stands for “right padding” and “b” stands for “bottom padding”.&lt;br /&gt;
&lt;br /&gt;
Consider the following sample text: ''“Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. THIS IS PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.”''&lt;br /&gt;
&lt;br /&gt;
Our aim is to pad the text element “THIS IS PADDED” with 5 pixels of left and right padding and 10 pixels of top and bottom padding. The tag would look like this: &lt;br /&gt;
&lt;br /&gt;
 [padding=’l:5 t:10 r:5 b:10’]&lt;br /&gt;
&lt;br /&gt;
Use padding, for example to provide extra spacing when embedding a picture or window in text.&lt;br /&gt;
Here is the code sample:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco &lt;br /&gt;
 laboris nisi ut aliquip ex ea commodo consequat. [padding=’l:5 t:10 r:5 b:10’]THIS IS PADDED.[padding=’l:0 t:0 &lt;br /&gt;
 r:0 b:0’] Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla &lt;br /&gt;
 pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id &lt;br /&gt;
 est laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks like in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Don’t try to translate the latin here – its complete nonsense. The “Lorem Ipsum” text has been around since the 1500s, when an unknown printer defined it as a dummy text to make a type specimen book, and it’s still in use today. Strange but true.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Window ===&lt;br /&gt;
The ‘window’ tag manipulates an existing child window of the window that you set the text on, such that the window is drawn in-line with the text, which means it moves with the text automatically. The ‘window’ tag takes the full name of the window just as you would use it with CEGUI::WindowManager. While the named window can be any window, it only makes sense to reference windows that are attached to the window where the text will be rendered.&lt;br /&gt;
&lt;br /&gt;
So let us embed a button into our text! &lt;br /&gt;
&lt;br /&gt;
First, we define the window in our layout:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;GUILayout &amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/FrameWindow&amp;quot; Name=&amp;quot;generat0r/AboutDialog&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;About generat0r&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;Arial-14&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarEnabled&amp;quot; Value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;CloseButtonEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;SizingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;			&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.015,0},{0.015,0},{0.45,0},{0.40,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedPosition&amp;quot; Value=&amp;quot;{ {0.25, 0}, {0.25, 0} }&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/StaticText&amp;quot; Name=&amp;quot;generat0r/AboutDialog/StaticText&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Demonstrates static (non editable) text. Use the controls on your right for &lt;br /&gt;
 formatting options.&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzExtent&amp;quot; Value=&amp;quot;361&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertExtent&amp;quot; Value=&amp;quot;59.5854&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzFormatting&amp;quot; Value=&amp;quot;WordWrapLeftAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertFormatting&amp;quot; Value=&amp;quot;TopAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.03,0},{0.03,0},{0.97,0},{0.85,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot; &lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Embedded&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/CloseButton&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Close&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/GUILayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pay special attention to the cut out segment in the above layout! Please also note that the window I want to embed is a child of the text window.&lt;br /&gt;
&lt;br /&gt;
Our tag will look like this:&lt;br /&gt;
&lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']&lt;br /&gt;
&lt;br /&gt;
Now, you just need to embed the defined window (&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot;) into you string, like so:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit,sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco  &lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']laboris nisi ut aliquip ex ea commodo consequat. THIS IS &lt;br /&gt;
 PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. &lt;br /&gt;
 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est &lt;br /&gt;
 laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The window tag works fine with formatting options for text. Please consider, though, that the embedded window is treated as a single entity. So if you embed a window that just draws text, the text of that window will not be split for wrapping purposes, but might have its own formatting! Padding and vertical alignments work here as well, with the exception of the ‘stretch’ option (which will default to ‘centre’ and raise a note in the CEGUI.log)&lt;br /&gt;
&lt;br /&gt;
Note: If you have not created the window you call here, you will get an ‘unknown object’ exception!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Feedback ==&lt;br /&gt;
Feedback is very welcome: please just PM me in the forum (my handle is ‘mboeni’) or leave a comment here in the wiki. :) &lt;br /&gt;
&lt;br /&gt;
[[User:Mboeni|Mboeni]] 13:33, 24 September 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Mboeni</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3446</id>
		<title>Formatting Tags in CEGUI</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3446"/>
				<updated>2010-09-24T17:17:15Z</updated>
		
		<summary type="html">&lt;p&gt;Mboeni: /* Embedding Images */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Some Basics ==&lt;br /&gt;
CEGUI has a nice feature that allows for formatted text in a widget, called “formatting tags”. Basically, you insert tags like:&lt;br /&gt;
&lt;br /&gt;
 [tag-name='value']&lt;br /&gt;
&lt;br /&gt;
into your strings and CEGUI does the necessary parsing (see [http://www.cegui.org.uk/docs/current/classCEGUI_1_1BasicRenderedStringParser.html CEGUI::BasicRenderedStringParser] class reference for details).&lt;br /&gt;
&lt;br /&gt;
It is important to note that these tags are like a ‘state change’, that means if you set a specific formatting option, it stays active until changed by another tag. You will see some examples later on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Available Tags ==&lt;br /&gt;
=== Font Colours ===&lt;br /&gt;
Changing the text color in a string is quite easy, so let’s start with that. In the following example, we will have some text shown in red, green and blue. Here’s how the tags work:&lt;br /&gt;
&lt;br /&gt;
 &amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI can format strings.[colour='FF00FF00']&lt;br /&gt;
 and this is just colour [colour='FF0000FF'] formatting!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In code, it looks like this:&lt;br /&gt;
&lt;br /&gt;
 CEGUI::Window* textComponent =  &lt;br /&gt;
 (CEGUI::Window*)CEGUI::WindowManager::getSingleton().getWindow(&amp;quot;generat0r/AboutDialog/StaticText&amp;quot;);&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI &lt;br /&gt;
 can format strings.[colour='FF00FF00'] and this is just colour [colour='FF0000FF'] formatting!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And that's how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A note:&lt;br /&gt;
* In case you have wondered why 4 sets of values are needed for each colour:  Red, for example, is described by [colour=’FFFF0000’] where the first ‘FF’ is the Alpha value (fully opaque in this case), the second is the value for the red component, the third for the green component and the fourth for the blue component, like in [AARRGGBB]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Font Formatting ===&lt;br /&gt;
Font formatting is a bit more involved as you need to have the actual fonts and the ‘font’ XML files defined for each style.&lt;br /&gt;
&lt;br /&gt;
Let’s assume you want to use the Arial font with the styles ‘normal’, ‘''italic''’, ‘'''bold'''’ and ‘'''''bold Italic'''''’. This actually requires you to have four different Arial fonts. For Arial, the fonts are called as follows:&lt;br /&gt;
&lt;br /&gt;
* Arial normal (arial.ttf)&lt;br /&gt;
* Arial bold (arialbd.ttf)&lt;br /&gt;
* Arial italic (ariali.ttf)&lt;br /&gt;
* Arial bold italic (arialbi.ttf)&lt;br /&gt;
&lt;br /&gt;
If you want to tinker around with them you can find these and some more in the font manager app of your OS (Arial ships with Windows, so you can get them from the OS). Note that Arial is copyrighted, so you might want to use a free font for your app (check out [http://www.dafont.com/ DaFont] for example).&lt;br /&gt;
&lt;br /&gt;
For each font, you will now have to create the according “.font” file that tells CEGUI how to use the font:&lt;br /&gt;
&lt;br /&gt;
* Arial-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-10&amp;quot; Filename=&amp;quot;arial.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot; &lt;br /&gt;
 AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Bold-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Bold-10&amp;quot; Filename=&amp;quot;arialbd.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Italic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Italic-10&amp;quot; Filename=&amp;quot;ariali.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-BoldItalic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-BoldItalic-10&amp;quot; Filename=&amp;quot;arialbi.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don’t forget to add the font definitions into your scheme, like so:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;GUIScheme Name=&amp;quot;VanillaSkin&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;Imageset Filename=&amp;quot;Vanilla.imageset&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Bold-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Italic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-BoldItalic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-14.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;LookNFeel Filename=&amp;quot;Vanilla.looknfeel&amp;quot; /&amp;gt;&lt;br /&gt;
  …snip…&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;You can also do [font='Arial-Bold-10']bold text, [font='Arial-Italic-10']italic &lt;br /&gt;
 text, [font='Arial-BoldItalic-10']bold AND italic text.[font='Arial-10']!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Embedding Images ===&lt;br /&gt;
Embedding an image into text is quite easy. The required tag follows the general syntax. Consider the following tag:&lt;br /&gt;
&lt;br /&gt;
 [image='set:&amp;lt;imageset&amp;gt; image:&amp;lt;image&amp;gt;']&lt;br /&gt;
&lt;br /&gt;
What you need to do here is specify the imageset where the image is specified and identify the image to be used. Let’s assume you want to embed the MouseCursor of the TaharezLook imageset into the following text: “Nice, I can even embed images like this &amp;lt;mousepic here&amp;gt; into my text.”&lt;br /&gt;
&lt;br /&gt;
First you need to know the name of the imageset and the name of the image. Let’s have a look at “TaharezLook.imageset” for that purpose:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Imageset Name=&amp;quot;TaharezLook&amp;quot; Imagefile=&amp;quot;TaharezLook.tga&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot;  &lt;br /&gt;
 AutoScaled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;Image Name=&amp;quot;MouseArrow&amp;quot; XPos=&amp;quot;138&amp;quot; YPos=&amp;quot;127&amp;quot; Width=&amp;quot;31&amp;quot; Height=&amp;quot;25&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/Imageset&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the imageset is named “TaharezLook” and the wanted image is called “MouseArrow”. In code this would now look like follows:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image='set:TaharezLook image:MouseArrow'] &lt;br /&gt;
 into my text. &amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And this is how it looks in my App:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: The following tags have an effect on the way the image is drawn: ‘padding’, ‘alignment’ and ‘colour’.&lt;br /&gt;
&lt;br /&gt;
=== Image Size ===&lt;br /&gt;
The ‘image-size’ tag allows you to change the size of embedded image components. The sized in the tag are given in pixels and the format is as follows:&lt;br /&gt;
&lt;br /&gt;
 w:&amp;lt;width value&amp;gt; h:&amp;lt;height value&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which specifies the width and height of a following image. So to set the size of a subsequent image to 32 pixels height and 64 pixels width, you would use:&lt;br /&gt;
&lt;br /&gt;
 [image-size=’w:32 h:64’]&lt;br /&gt;
&lt;br /&gt;
Here is how it might look in code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image-size='w:32 h:64']&lt;br /&gt;
 [image='set:TaharezLook image:MouseArrow'] into my text.&amp;quot;); &lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: To set the image-size back to the real size of the image, just set the values to zero, like so:  [image-size=’w:0 h:0’]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Vertical Alignment ===&lt;br /&gt;
The vertical alignment Tag allows you align elements within a text that have different heights. The overall available space on a line is always taken as the height of the tallest element plus any vertical padding, elements are then positioned within this vertical space according to the specified option. Currently, you can align an element to ‘top’, ‘bottom’, ‘centre’ and ‘stretch’. The option ‘stretch’ will stretch the tagged elements vertically to fill the available space. Please note that the stretching is vertical only, aspect ratios of images and text are not maintained! This will be accounted for in the future, though.&lt;br /&gt;
&lt;br /&gt;
The following examples are valid tags for “vert-alignment”:&lt;br /&gt;
&lt;br /&gt;
 [vert-alignment='top']&lt;br /&gt;
 [vert-alignment='bottom']&lt;br /&gt;
 [vert-alignment='centre']&lt;br /&gt;
 [vert-alignment=’stretch’]&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Text can also be vertically aligned. It can be aligned to [vert-alignment='top']top, &lt;br /&gt;
 [vert-alignment='bottom']bottom, [vert-alignment='centre']centre and [vert-alignment='stretch']'stretch'&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Embedded window elements cannot be stretched currently. This may also change in the future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Padding ===&lt;br /&gt;
Padding is related to the vertical alignment tag in that it also allows you to specify the setting of elements in a text. You can set individual text elements or the whole text all together. The value you give the padding tag are a number of pixels to pad the surrounding elements with. The padding tag uses a “rect” property to specify padding values, like so: ‘l:&amp;lt;value&amp;gt; t:&amp;lt;value&amp;gt; r:&amp;lt;value&amp;gt; b:&amp;lt;value&amp;gt;) where “l” stands for “left padding, “t” stands for “top padding”, “r” stands for “right padding” and “b” stands for “bottom padding”.&lt;br /&gt;
&lt;br /&gt;
Consider the following sample text: ''“Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. THIS IS PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.”''&lt;br /&gt;
&lt;br /&gt;
Our aim is to pad the text element “THIS IS PADDED” with 5 pixels of left and right padding and 10 pixels of top and bottom padding. The tag would look like this: &lt;br /&gt;
&lt;br /&gt;
 [padding=’l:5 t:10 r:5 b:10’]&lt;br /&gt;
&lt;br /&gt;
Use padding, for example to provide extra spacing when embedding a picture or window in text.&lt;br /&gt;
Here is the code sample:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco &lt;br /&gt;
 laboris nisi ut aliquip ex ea commodo consequat. [padding=’l:5 t:10 r:5 b:10’]THIS IS PADDED.[padding=’l:0 t:0 &lt;br /&gt;
 r:0 b:0’] Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla &lt;br /&gt;
 pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id &lt;br /&gt;
 est laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks like in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Don’t try to translate the latin here – its complete nonsense. The “Lorem Ipsum” text has been around since the 1500s, when an unknown printer defined it as a dummy text to make a type specimen book, and it’s still in use today. Strange but true.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Window ===&lt;br /&gt;
The ‘window’ tag manipulates an existing child window of the window that you set the text on, such that the window is drawn in-line with the text, which means it moves with the text automatically. The ‘window’ tag takes the full name of the window just as you would use it with CEGUI::WindowManager. While the named window can be any window, it only makes sense to reference windows that are attached to the window where the text will be rendered.&lt;br /&gt;
&lt;br /&gt;
So let us embed a button into our text! &lt;br /&gt;
&lt;br /&gt;
First, we define the window in our layout:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;GUILayout &amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/FrameWindow&amp;quot; Name=&amp;quot;generat0r/AboutDialog&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;About generat0r&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;Arial-14&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarEnabled&amp;quot; Value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;CloseButtonEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;SizingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;			&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.015,0},{0.015,0},{0.45,0},{0.40,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedPosition&amp;quot; Value=&amp;quot;{ {0.25, 0}, {0.25, 0} }&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/StaticText&amp;quot; Name=&amp;quot;generat0r/AboutDialog/StaticText&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Demonstrates static (non editable) text. Use the controls on your right for &lt;br /&gt;
 formatting options.&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzExtent&amp;quot; Value=&amp;quot;361&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertExtent&amp;quot; Value=&amp;quot;59.5854&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzFormatting&amp;quot; Value=&amp;quot;WordWrapLeftAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertFormatting&amp;quot; Value=&amp;quot;TopAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.03,0},{0.03,0},{0.97,0},{0.85,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot; &lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Embedded&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/CloseButton&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Close&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/GUILayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pay special attention to the cut out segment in the above layout! Please also note that the window I want to embed is a child of the text window.&lt;br /&gt;
&lt;br /&gt;
Our tag will look like this:&lt;br /&gt;
&lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']&lt;br /&gt;
&lt;br /&gt;
Now, you just need to embed the defined window (&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot;) into you string, like so:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit,sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco  &lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']laboris nisi ut aliquip ex ea commodo consequat. THIS IS &lt;br /&gt;
 PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. &lt;br /&gt;
 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est &lt;br /&gt;
 laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The window tag works fine with formatting options for text. Please consider, though, that the embedded window is treated as a single entity. So if you embed a window that just draws text, the text of that window will not be split for wrapping purposes, but might have its own formatting! Padding and vertical alignments work here as well, with the exception of the ‘stretch’ option (which will default to ‘centre’ and raise a note in the CEGUI.log)&lt;br /&gt;
&lt;br /&gt;
Note: If you have not created the window you call here, you will get an ‘unknown object’ exception!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Feedback ==&lt;br /&gt;
Feedback is very welcome: please just PM me in the forum (my handle is ‘mboeni’) or leave a comment here in the wiki. :) &lt;br /&gt;
&lt;br /&gt;
[[User:Mboeni|Mboeni]] 13:33, 24 September 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Mboeni</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3445</id>
		<title>Formatting Tags in CEGUI</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3445"/>
				<updated>2010-09-24T13:54:43Z</updated>
		
		<summary type="html">&lt;p&gt;Mboeni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Some Basics ==&lt;br /&gt;
CEGUI has a nice feature that allows for formatted text in a widget, called “formatting tags”. Basically, you insert tags like:&lt;br /&gt;
&lt;br /&gt;
 [tag-name='value']&lt;br /&gt;
&lt;br /&gt;
into your strings and CEGUI does the necessary parsing (see [http://www.cegui.org.uk/docs/current/classCEGUI_1_1BasicRenderedStringParser.html CEGUI::BasicRenderedStringParser] class reference for details).&lt;br /&gt;
&lt;br /&gt;
It is important to note that these tags are like a ‘state change’, that means if you set a specific formatting option, it stays active until changed by another tag. You will see some examples later on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Available Tags ==&lt;br /&gt;
=== Font Colours ===&lt;br /&gt;
Changing the text color in a string is quite easy, so let’s start with that. In the following example, we will have some text shown in red, green and blue. Here’s how the tags work:&lt;br /&gt;
&lt;br /&gt;
 &amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI can format strings.[colour='FF00FF00']&lt;br /&gt;
 and this is just colour [colour='FF0000FF'] formatting!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In code, it looks like this:&lt;br /&gt;
&lt;br /&gt;
 CEGUI::Window* textComponent =  &lt;br /&gt;
 (CEGUI::Window*)CEGUI::WindowManager::getSingleton().getWindow(&amp;quot;generat0r/AboutDialog/StaticText&amp;quot;);&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI &lt;br /&gt;
 can format strings.[colour='FF00FF00'] and this is just colour [colour='FF0000FF'] formatting!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And that's how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A note:&lt;br /&gt;
* In case you have wondered why 4 sets of values are needed for each colour:  Red, for example, is described by [colour=’FFFF0000’] where the first ‘FF’ is the Alpha value (fully opaque in this case), the second is the value for the red component, the third for the green component and the fourth for the blue component, like in [AARRGGBB]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Font Formatting ===&lt;br /&gt;
Font formatting is a bit more involved as you need to have the actual fonts and the ‘font’ XML files defined for each style.&lt;br /&gt;
&lt;br /&gt;
Let’s assume you want to use the Arial font with the styles ‘normal’, ‘''italic''’, ‘'''bold'''’ and ‘'''''bold Italic'''''’. This actually requires you to have four different Arial fonts. For Arial, the fonts are called as follows:&lt;br /&gt;
&lt;br /&gt;
* Arial normal (arial.ttf)&lt;br /&gt;
* Arial bold (arialbd.ttf)&lt;br /&gt;
* Arial italic (ariali.ttf)&lt;br /&gt;
* Arial bold italic (arialbi.ttf)&lt;br /&gt;
&lt;br /&gt;
If you want to tinker around with them you can find these and some more in the font manager app of your OS (Arial ships with Windows, so you can get them from the OS). Note that Arial is copyrighted, so you might want to use a free font for your app (check out [http://www.dafont.com/ DaFont] for example).&lt;br /&gt;
&lt;br /&gt;
For each font, you will now have to create the according “.font” file that tells CEGUI how to use the font:&lt;br /&gt;
&lt;br /&gt;
* Arial-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-10&amp;quot; Filename=&amp;quot;arial.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot; &lt;br /&gt;
 AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Bold-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Bold-10&amp;quot; Filename=&amp;quot;arialbd.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Italic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Italic-10&amp;quot; Filename=&amp;quot;ariali.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-BoldItalic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-BoldItalic-10&amp;quot; Filename=&amp;quot;arialbi.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don’t forget to add the font definitions into your scheme, like so:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;GUIScheme Name=&amp;quot;VanillaSkin&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;Imageset Filename=&amp;quot;Vanilla.imageset&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Bold-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Italic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-BoldItalic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-14.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;LookNFeel Filename=&amp;quot;Vanilla.looknfeel&amp;quot; /&amp;gt;&lt;br /&gt;
  …snip…&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;You can also do [font='Arial-Bold-10']bold text, [font='Arial-Italic-10']italic &lt;br /&gt;
 text, [font='Arial-BoldItalic-10']bold AND italic text.[font='Arial-10']!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Embedding Images ===&lt;br /&gt;
Embedding an image into text is quite easy. The required tag follows the general syntax. Consider the following tag:&lt;br /&gt;
&lt;br /&gt;
 [image=set:&amp;lt;imageset&amp;gt; image:&amp;lt;image&amp;gt;']&lt;br /&gt;
&lt;br /&gt;
What you need to do here is specify the imageset where the image is specified and identify the image to be used. Let’s assume you want to embed the MouseCursor of the TaharezLook imageset into the following text: “Nice, I can even embed images like this &amp;lt;mousepic here&amp;gt; into my text.”&lt;br /&gt;
&lt;br /&gt;
First you need to know the name of the imageset and the name of the image. Let’s have a look at “TaharezLook.imageset” for that purpose:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Imageset Name=&amp;quot;TaharezLook&amp;quot; Imagefile=&amp;quot;TaharezLook.tga&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot;  &lt;br /&gt;
 AutoScaled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;Image Name=&amp;quot;MouseArrow&amp;quot; XPos=&amp;quot;138&amp;quot; YPos=&amp;quot;127&amp;quot; Width=&amp;quot;31&amp;quot; Height=&amp;quot;25&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/Imageset&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the imageset is named “TaharezLook” and the wanted image is called “MouseArrow”. In code this would now look like follows:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image='set:TaharezLook image:MouseArrow'] &lt;br /&gt;
 into my text. &amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And this is how it looks in my App:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: The following tags have an effect on the way the image is drawn: ‘padding’, ‘alignment’ and ‘colour’.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Image Size ===&lt;br /&gt;
The ‘image-size’ tag allows you to change the size of embedded image components. The sized in the tag are given in pixels and the format is as follows:&lt;br /&gt;
&lt;br /&gt;
 w:&amp;lt;width value&amp;gt; h:&amp;lt;height value&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which specifies the width and height of a following image. So to set the size of a subsequent image to 32 pixels height and 64 pixels width, you would use:&lt;br /&gt;
&lt;br /&gt;
 [image-size=’w:32 h:64’]&lt;br /&gt;
&lt;br /&gt;
Here is how it might look in code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image-size='w:32 h:64']&lt;br /&gt;
 [image='set:TaharezLook image:MouseArrow'] into my text.&amp;quot;); &lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: To set the image-size back to the real size of the image, just set the values to zero, like so:  [image-size=’w:0 h:0’]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Vertical Alignment ===&lt;br /&gt;
The vertical alignment Tag allows you align elements within a text that have different heights. The overall available space on a line is always taken as the height of the tallest element plus any vertical padding, elements are then positioned within this vertical space according to the specified option. Currently, you can align an element to ‘top’, ‘bottom’, ‘centre’ and ‘stretch’. The option ‘stretch’ will stretch the tagged elements vertically to fill the available space. Please note that the stretching is vertical only, aspect ratios of images and text are not maintained! This will be accounted for in the future, though.&lt;br /&gt;
&lt;br /&gt;
The following examples are valid tags for “vert-alignment”:&lt;br /&gt;
&lt;br /&gt;
 [vert-alignment='top']&lt;br /&gt;
 [vert-alignment='bottom']&lt;br /&gt;
 [vert-alignment='centre']&lt;br /&gt;
 [vert-alignment=’stretch’]&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Text can also be vertically aligned. It can be aligned to [vert-alignment='top']top, &lt;br /&gt;
 [vert-alignment='bottom']bottom, [vert-alignment='centre']centre and [vert-alignment='stretch']'stretch'&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Embedded window elements cannot be stretched currently. This may also change in the future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Padding ===&lt;br /&gt;
Padding is related to the vertical alignment tag in that it also allows you to specify the setting of elements in a text. You can set individual text elements or the whole text all together. The value you give the padding tag are a number of pixels to pad the surrounding elements with. The padding tag uses a “rect” property to specify padding values, like so: ‘l:&amp;lt;value&amp;gt; t:&amp;lt;value&amp;gt; r:&amp;lt;value&amp;gt; b:&amp;lt;value&amp;gt;) where “l” stands for “left padding, “t” stands for “top padding”, “r” stands for “right padding” and “b” stands for “bottom padding”.&lt;br /&gt;
&lt;br /&gt;
Consider the following sample text: ''“Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. THIS IS PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.”''&lt;br /&gt;
&lt;br /&gt;
Our aim is to pad the text element “THIS IS PADDED” with 5 pixels of left and right padding and 10 pixels of top and bottom padding. The tag would look like this: &lt;br /&gt;
&lt;br /&gt;
 [padding=’l:5 t:10 r:5 b:10’]&lt;br /&gt;
&lt;br /&gt;
Use padding, for example to provide extra spacing when embedding a picture or window in text.&lt;br /&gt;
Here is the code sample:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco &lt;br /&gt;
 laboris nisi ut aliquip ex ea commodo consequat. [padding=’l:5 t:10 r:5 b:10’]THIS IS PADDED.[padding=’l:0 t:0 &lt;br /&gt;
 r:0 b:0’] Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla &lt;br /&gt;
 pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id &lt;br /&gt;
 est laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks like in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Don’t try to translate the latin here – its complete nonsense. The “Lorem Ipsum” text has been around since the 1500s, when an unknown printer defined it as a dummy text to make a type specimen book, and it’s still in use today. Strange but true.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Window ===&lt;br /&gt;
The ‘window’ tag manipulates an existing child window of the window that you set the text on, such that the window is drawn in-line with the text, which means it moves with the text automatically. The ‘window’ tag takes the full name of the window just as you would use it with CEGUI::WindowManager. While the named window can be any window, it only makes sense to reference windows that are attached to the window where the text will be rendered.&lt;br /&gt;
&lt;br /&gt;
So let us embed a button into our text! &lt;br /&gt;
&lt;br /&gt;
First, we define the window in our layout:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;GUILayout &amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/FrameWindow&amp;quot; Name=&amp;quot;generat0r/AboutDialog&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;About generat0r&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;Arial-14&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarEnabled&amp;quot; Value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;CloseButtonEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;SizingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;			&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.015,0},{0.015,0},{0.45,0},{0.40,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedPosition&amp;quot; Value=&amp;quot;{ {0.25, 0}, {0.25, 0} }&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/StaticText&amp;quot; Name=&amp;quot;generat0r/AboutDialog/StaticText&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Demonstrates static (non editable) text. Use the controls on your right for &lt;br /&gt;
 formatting options.&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzExtent&amp;quot; Value=&amp;quot;361&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertExtent&amp;quot; Value=&amp;quot;59.5854&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzFormatting&amp;quot; Value=&amp;quot;WordWrapLeftAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertFormatting&amp;quot; Value=&amp;quot;TopAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.03,0},{0.03,0},{0.97,0},{0.85,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot; &lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Embedded&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/CloseButton&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Close&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/GUILayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pay special attention to the cut out segment in the above layout! Please also note that the window I want to embed is a child of the text window.&lt;br /&gt;
&lt;br /&gt;
Our tag will look like this:&lt;br /&gt;
&lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']&lt;br /&gt;
&lt;br /&gt;
Now, you just need to embed the defined window (&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot;) into you string, like so:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit,sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco  &lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']laboris nisi ut aliquip ex ea commodo consequat. THIS IS &lt;br /&gt;
 PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. &lt;br /&gt;
 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est &lt;br /&gt;
 laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The window tag works fine with formatting options for text. Please consider, though, that the embedded window is treated as a single entity. So if you embed a window that just draws text, the text of that window will not be split for wrapping purposes, but might have its own formatting! Padding and vertical alignments work here as well, with the exception of the ‘stretch’ option (which will default to ‘centre’ and raise a note in the CEGUI.log)&lt;br /&gt;
&lt;br /&gt;
Note: If you have not created the window you call here, you will get an ‘unknown object’ exception!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Feedback ==&lt;br /&gt;
Feedback is very welcome: please just PM me in the forum (my handle is ‘mboeni’) or leave a comment here in the wiki. :) &lt;br /&gt;
&lt;br /&gt;
[[User:Mboeni|Mboeni]] 13:33, 24 September 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Mboeni</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3444</id>
		<title>Formatting Tags in CEGUI</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3444"/>
				<updated>2010-09-24T13:52:41Z</updated>
		
		<summary type="html">&lt;p&gt;Mboeni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Some Basics ==&lt;br /&gt;
CEGUI has a nice feature that allows for formatted text in a widget, called “formatting tags”. Basically, you insert tags like:&lt;br /&gt;
&lt;br /&gt;
 [tag-name='value']&lt;br /&gt;
&lt;br /&gt;
into your strings and CEGUI does the necessary parsing (see [http://www.cegui.org.uk/docs/current/classCEGUI_1_1BasicRenderedStringParser.html CEGUI::BasicRenderedStringParser] class reference for details).&lt;br /&gt;
&lt;br /&gt;
It is important to note that these tags are like a ‘state change’, that means if you set a specific formatting option, it stays active until changed by another tag. You will see some examples later on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Available Tags ==&lt;br /&gt;
=== Font Colours ===&lt;br /&gt;
Changing the text color in a string is quite easy, so let’s start with that. In the following example, we will have some text shown in red, green and blue. Here’s how the tags work:&lt;br /&gt;
&lt;br /&gt;
 &amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI can format strings.[colour='FF00FF00']&lt;br /&gt;
 and this is just colour [colour='FF0000FF'] formatting!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In code, it looks like this:&lt;br /&gt;
&lt;br /&gt;
 CEGUI::Window* textComponent =  &lt;br /&gt;
 (CEGUI::Window*)CEGUI::WindowManager::getSingleton().getWindow(&amp;quot;generat0r/AboutDialog/StaticText&amp;quot;);&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI &lt;br /&gt;
 can format strings.[colour='FF00FF00'] and this is just colour [colour='FF0000FF'] formatting!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And that's how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A note:&lt;br /&gt;
* In case you have wondered why 4 sets of values are needed for each colour:  Red, for example, is described by [colour=’FFFF0000’] where the first ‘FF’ is the Alpha value (fully opaque in this case), the second is the value for the red component, the third for the green component and the fourth for the blue component, like in [AARRGGBB]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Font Formatting ===&lt;br /&gt;
Font formatting is a bit more involved as you need to have the actual fonts and the ‘font’ XML files defined for each style.&lt;br /&gt;
&lt;br /&gt;
Let’s assume you want to use the Arial font with the styles ‘normal’, ‘''italic''’, ‘'''bold'''’ and ‘'''''bold Italic'''''’. This actually requires you to have four different Arial fonts. For Arial, the fonts are called as follows:&lt;br /&gt;
&lt;br /&gt;
* Arial normal (arial.ttf)&lt;br /&gt;
* Arial bold (arialbd.ttf)&lt;br /&gt;
* Arial italic (ariali.ttf)&lt;br /&gt;
* Arial bold italic (arialbi.ttf)&lt;br /&gt;
&lt;br /&gt;
If you want to tinker around with them you can find these and some more in the font manager app of your OS (Arial ships with Windows, so you can get them from the OS). Note that Arial is copyrighted, so you might want to use a free font for your app (check out [http://www.dafont.com/ DaFont] for example).&lt;br /&gt;
&lt;br /&gt;
For each font, you will now have to create the according “.font” file that tells CEGUI how to use the font:&lt;br /&gt;
&lt;br /&gt;
* Arial-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-10&amp;quot; Filename=&amp;quot;arial.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot; &lt;br /&gt;
 AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Bold-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Bold-10&amp;quot; Filename=&amp;quot;arialbd.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Italic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Italic-10&amp;quot; Filename=&amp;quot;ariali.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-BoldItalic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-BoldItalic-10&amp;quot; Filename=&amp;quot;arialbi.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don’t forget to add the font definitions into your scheme, like so:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;GUIScheme Name=&amp;quot;VanillaSkin&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;Imageset Filename=&amp;quot;Vanilla.imageset&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Bold-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Italic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-BoldItalic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-14.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;LookNFeel Filename=&amp;quot;Vanilla.looknfeel&amp;quot; /&amp;gt;&lt;br /&gt;
  …snip…&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;You can also do [font='Arial-Bold-10']bold text, [font='Arial-Italic-10']italic &lt;br /&gt;
 text, [font='Arial-BoldItalic-10']bold AND italic text.[font='Arial-10']!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Embedding Images ===&lt;br /&gt;
Embedding an image into text is quite easy. The required tag follows the general syntax. Consider the following tag:&lt;br /&gt;
&lt;br /&gt;
 [image=set:&amp;lt;imageset&amp;gt; image:&amp;lt;image&amp;gt;']&lt;br /&gt;
&lt;br /&gt;
What you need to do here is specify the imageset where the image is specified and identify the image to be used. Let’s assume you want to embed the MouseCursor of the TaharezLook imageset into the following text: “Nice, I can even embed images like this &amp;lt;mousepic here&amp;gt; into my text.”&lt;br /&gt;
&lt;br /&gt;
First you need to know the name of the imageset and the name of the image. Let’s have a look at “TaharezLook.imageset” for that purpose:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Imageset Name=&amp;quot;TaharezLook&amp;quot; Imagefile=&amp;quot;TaharezLook.tga&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot;  &lt;br /&gt;
 AutoScaled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;Image Name=&amp;quot;MouseArrow&amp;quot; XPos=&amp;quot;138&amp;quot; YPos=&amp;quot;127&amp;quot; Width=&amp;quot;31&amp;quot; Height=&amp;quot;25&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/Imageset&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the imageset is named “TaharezLook” and the wanted image is called “MouseArrow”. In code this would now look like follows:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image='set:TaharezLook image:MouseArrow'] &lt;br /&gt;
 into my text. &amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And this is how it looks in my App:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: The following tags have an effect on the way the image is drawn: ‘padding’, ‘alignment’ and ‘colour’.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Image Size ===&lt;br /&gt;
The ‘image-size’ tag allows you to change the size of embedded image components. The sized in the tag are given in pixels and the format is as follows:&lt;br /&gt;
&lt;br /&gt;
 w:&amp;lt;width value&amp;gt; h:&amp;lt;height value&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which specifies the width and height of a following image. So to set the size of a subsequent image to 32 pixels height and 64 pixels width, you would use:&lt;br /&gt;
&lt;br /&gt;
 [image-size=’w:32 h:64’]&lt;br /&gt;
&lt;br /&gt;
Here is how it might look in code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image-size='w:32 h:64']&lt;br /&gt;
 [image='set:TaharezLook image:MouseArrow'] into my text.&amp;quot;); &lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: To set the image-size back to the real size of the image, just set the values to zero, like so:  [image-size=’w:0 h:0’]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Vertical Alignment ===&lt;br /&gt;
The vertical alignment Tag allows you align elements within a text that have different heights. The overall available space on a line is always taken as the height of the tallest element plus any vertical padding, elements are then positioned within this vertical space according to the specified option. Currently, you can align an element to ‘top’, ‘bottom’, ‘centre’ and ‘stretch’. The option ‘stretch’ will stretch the tagged elements vertically to fill the available space. Please note that the stretching is vertical only, aspect ratios of images and text are not maintained! This will be accounted for in the future, though.&lt;br /&gt;
&lt;br /&gt;
The following examples are valid tags for “vert-alignment”:&lt;br /&gt;
&lt;br /&gt;
 [vert-alignment='top']&lt;br /&gt;
 [vert-alignment='bottom']&lt;br /&gt;
 [vert-alignment='centre']&lt;br /&gt;
 [vert-alignment=’stretch’]&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Text can also be vertically aligned. It can be aligned to [vert-alignment='top']top, &lt;br /&gt;
 [vert-alignment='bottom']bottom, [vert-alignment='centre']centre and [vert-alignment='stretch']'stretch'&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Embedded window elements cannot be stretched currently. This may also change in the future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Padding ===&lt;br /&gt;
Padding is related to the vertical alignment tag in that it also allows you to specify the setting of elements in a text. You can set individual text elements or the whole text all together. The value you give the padding tag are a number of pixels to pad the surrounding elements with. The padding tag uses a “rect” property to specify padding values, like so: ‘l:&amp;lt;value&amp;gt; t:&amp;lt;value&amp;gt; r:&amp;lt;value&amp;gt; b:&amp;lt;value&amp;gt;) where “l” stands for “left padding, “t” stands for “top padding”, “r” stands for “right padding” and “b” stands for “bottom padding”.&lt;br /&gt;
&lt;br /&gt;
Consider the following sample text: ''“Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. THIS IS PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.”''&lt;br /&gt;
&lt;br /&gt;
Our aim is to pad the text element “THIS IS PADDED” with 5 pixels of left and right padding and 10 pixels of top and bottom padding. The tag would look like this: &lt;br /&gt;
&lt;br /&gt;
 [padding=’l:5 t:10 r:5 b:10’]&lt;br /&gt;
&lt;br /&gt;
Use padding, for example to provide extra spacing when embedding a picture or window in text.&lt;br /&gt;
Here is the code sample:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco &lt;br /&gt;
 laboris nisi ut aliquip ex ea commodo consequat. [padding=’l:5 t:10 r:5 b:10’]THIS IS PADDED.[padding=’l:0 t:0 &lt;br /&gt;
 r:0 b:0’] Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla &lt;br /&gt;
 pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id &lt;br /&gt;
 est laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks like in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Don’t try to translate the latin here – its complete nonsense. The “Lorem Ipsum” text has been around since the 1500s, when an unknown printer defined it as a dummy text to make a type specimen book, and it’s still in use today. Strange but true.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Window ===&lt;br /&gt;
The ‘window’ tag manipulates an existing child window of the window that you set the text on, such that the window is drawn in-line with the text, which means it moves with the text automatically. The ‘window’ tag takes the full name of the window just as you would use it with CEGUI::WindowManager. While the named window can be any window, it only makes sense to reference windows that are attached to the window where the text will be rendered.&lt;br /&gt;
&lt;br /&gt;
So let us embed a button into our text! &lt;br /&gt;
&lt;br /&gt;
First, we define the window in our layout:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;GUILayout &amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/FrameWindow&amp;quot; Name=&amp;quot;generat0r/AboutDialog&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;About generat0r&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;Arial-14&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarEnabled&amp;quot; Value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;CloseButtonEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;SizingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;			&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.015,0},{0.015,0},{0.45,0},{0.40,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedPosition&amp;quot; Value=&amp;quot;{ {0.25, 0}, {0.25, 0} }&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/StaticText&amp;quot; Name=&amp;quot;generat0r/AboutDialog/StaticText&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Demonstrates static (non editable) text. Use the controls on your right for &lt;br /&gt;
 formatting options.&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzExtent&amp;quot; Value=&amp;quot;361&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertExtent&amp;quot; Value=&amp;quot;59.5854&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzFormatting&amp;quot; Value=&amp;quot;WordWrapLeftAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertFormatting&amp;quot; Value=&amp;quot;TopAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.03,0},{0.03,0},{0.97,0},{0.85,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot; &lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Embedded&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/CloseButton&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Close&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/GUILayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pay special attention to the cut out segment in the above layout! Please also note that the window I want to embed is a child of the text window.&lt;br /&gt;
&lt;br /&gt;
Our tag will look like this:&lt;br /&gt;
&lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']&lt;br /&gt;
&lt;br /&gt;
Now, you just need to embed the defined window (&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot;) into you string, like so:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit,sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco  &lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']laboris nisi ut aliquip ex ea commodo consequat. THIS IS &lt;br /&gt;
 PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. &lt;br /&gt;
 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est &lt;br /&gt;
 laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The window tag works fine with formatting options for text. Please consider, though, that the embedded window is treated as a single entity. So if you embed a window that just draws text, the text of that window will not be split for wrapping purposes, but might have its own formatting! Padding and vertical alignments work here as well, with the exception of the ‘stretch’ option (which will default to ‘centre’ and raise a note in the CEGUI.log)&lt;br /&gt;
&lt;br /&gt;
Note: If you have not created the window you call here, you will get an ‘unknown object’ exception!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Feedback ==&lt;br /&gt;
Feedback is very welcome: please just PM me in the forum (my handle is ‘mboeni’) or leave a comment here in the wiki. :) &lt;br /&gt;
&lt;br /&gt;
--[[User:Mboeni|Mboeni]] 13:33, 24 September 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Mboeni</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3443</id>
		<title>Formatting Tags in CEGUI</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3443"/>
				<updated>2010-09-24T13:46:01Z</updated>
		
		<summary type="html">&lt;p&gt;Mboeni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Some Basics ==&lt;br /&gt;
CEGUI has a nice feature that allows for formatted text in a widget, called “formatting tags”. Basically, you insert tags like:&lt;br /&gt;
&lt;br /&gt;
 [tag-name='value']&lt;br /&gt;
&lt;br /&gt;
into your strings and CEGUI does the necessary parsing (see [http://www.cegui.org.uk/docs/current/classCEGUI_1_1BasicRenderedStringParser.html CEGUI::BasicRenderedStringParser] class reference for details).&lt;br /&gt;
&lt;br /&gt;
It is important to note that these tags are like a ‘state change’, that means if you set a specific formatting option, it stays active until changed by another tag. You will see some examples later on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Available Tags ==&lt;br /&gt;
=== Font Colours ===&lt;br /&gt;
Changing the text color in a string is quite easy, so let’s start with that. In the following example, we will have some text shown in red, green and blue. Here’s how the tags work:&lt;br /&gt;
&lt;br /&gt;
 &amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI can format strings.[colour='FF00FF00']&lt;br /&gt;
 and this is just colour [colour='FF0000FF'] formatting!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In code, it looks like this:&lt;br /&gt;
&lt;br /&gt;
 CEGUI::Window* textComponent =  &lt;br /&gt;
 (CEGUI::Window*)CEGUI::WindowManager::getSingleton().getWindow(&amp;quot;generat0r/AboutDialog/StaticText&amp;quot;);&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI &lt;br /&gt;
 can format strings.[colour='FF00FF00'] and this is just colour [colour='FF0000FF'] formatting!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And that's how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A note:&lt;br /&gt;
* In case you have wondered why 4 sets of values are needed for each colour:  Red, for example, is described by [colour=’FFFF0000’] where the first ‘FF’ is the Alpha value (fully opaque in this case), the second is the value for the red component, the third for the green component and the fourth for the blue component, like in [AARRGGBB]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Font Formatting ===&lt;br /&gt;
Font formatting is a bit more involved as you need to have the actual fonts and the ‘font’ XML files defined for each style.&lt;br /&gt;
&lt;br /&gt;
Let’s assume you want to use the Arial font with the styles ‘normal’, ‘''italic''’, ‘'''bold'''’ and ‘'''''bold Italic'''''’. This actually requires you to have four different Arial fonts. For Arial, the fonts are called as follows:&lt;br /&gt;
&lt;br /&gt;
* Arial normal (arial.ttf)&lt;br /&gt;
* Arial bold (arialbd.ttf)&lt;br /&gt;
* Arial italic (ariali.ttf)&lt;br /&gt;
* Arial bold italic (arialbi.ttf)&lt;br /&gt;
&lt;br /&gt;
If you want to tinker around with them you can find these and some more in the font manager app of your OS (Arial ships with Windows, so you can get them from the OS). Note that Arial is copyrighted, so you might want to use a free font for your app (check out [http://www.dafont.com/ DaFont] for example).&lt;br /&gt;
&lt;br /&gt;
For each font, you will now have to create the according “.font” file that tells CEGUI how to use the font:&lt;br /&gt;
&lt;br /&gt;
* Arial-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-10&amp;quot; Filename=&amp;quot;arial.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot; &lt;br /&gt;
 AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Bold-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Bold-10&amp;quot; Filename=&amp;quot;arialbd.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Italic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Italic-10&amp;quot; Filename=&amp;quot;ariali.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-BoldItalic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-BoldItalic-10&amp;quot; Filename=&amp;quot;arialbi.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don’t forget to add the font definitions into your scheme, like so:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;GUIScheme Name=&amp;quot;VanillaSkin&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;Imageset Filename=&amp;quot;Vanilla.imageset&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Bold-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Italic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-BoldItalic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-14.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;LookNFeel Filename=&amp;quot;Vanilla.looknfeel&amp;quot; /&amp;gt;&lt;br /&gt;
  …snip…&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;You can also do [font='Arial-Bold-10']bold text, [font='Arial-Italic-10']italic &lt;br /&gt;
 text, [font='Arial-BoldItalic-10']bold AND italic text.[font='Arial-10']!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Embedding Images ===&lt;br /&gt;
Embedding an image into text is quite easy. The required tag follows the general syntax. Consider the following tag:&lt;br /&gt;
&lt;br /&gt;
 [image=set:&amp;lt;imageset&amp;gt; image:&amp;lt;image&amp;gt;']&lt;br /&gt;
&lt;br /&gt;
What you need to do here is specify the imageset where the image is specified and identify the image to be used. Let’s assume you want to embed the MouseCursor of the TaharezLook imageset into the following text: “Nice, I can even embed images like this &amp;lt;mousepic here&amp;gt; into my text.”&lt;br /&gt;
&lt;br /&gt;
First you need to know the name of the imageset and the name of the image. Let’s have a look at “TaharezLook.imageset” for that purpose:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Imageset Name=&amp;quot;TaharezLook&amp;quot; Imagefile=&amp;quot;TaharezLook.tga&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot;  &lt;br /&gt;
 AutoScaled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;Image Name=&amp;quot;MouseArrow&amp;quot; XPos=&amp;quot;138&amp;quot; YPos=&amp;quot;127&amp;quot; Width=&amp;quot;31&amp;quot; Height=&amp;quot;25&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/Imageset&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the imageset is named “TaharezLook” and the wanted image is called “MouseArrow”. In code this would now look like follows:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image='set:TaharezLook image:MouseArrow'] &lt;br /&gt;
 into my text. &amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And this is how it looks in my App:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: The following tags have an effect on the way the image is drawn: ‘padding’, ‘alignment’ and ‘colour’.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Image Size ===&lt;br /&gt;
The ‘image-size’ tag allows you to change the size of embedded image components. The sized in the tag are given in pixels and the format is as follows:&lt;br /&gt;
&lt;br /&gt;
 w:&amp;lt;width value&amp;gt; h:&amp;lt;height value&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which specifies the width and height of a following image. So to set the size of a subsequent image to 32 pixels height and 64 pixels width, you would use:&lt;br /&gt;
&lt;br /&gt;
 [image-size=’w:32 h:64’]&lt;br /&gt;
&lt;br /&gt;
Here is how it might look in code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image-size='w:32 h:64']&lt;br /&gt;
 [image='set:TaharezLook image:MouseArrow'] into my text.&amp;quot;); &lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: To set the image-size back to the real size of the image, just set the values to zero, like so:  [image-size=’w:0 h:0’]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Vertical Alignment ===&lt;br /&gt;
The vertical alignment Tag allows you align elements within a text that have different heights. The overall available space on a line is always taken as the height of the tallest element plus any vertical padding, elements are then positioned within this vertical space according to the specified option. Currently, you can align an element to ‘top’, ‘bottom’, ‘centre’ and ‘stretch’. The option ‘stretch’ will stretch the tagged elements vertically to fill the available space. Please note that the stretching is vertical only, aspect ratios of images and text are not maintained! This will be accounted for in the future, though.&lt;br /&gt;
&lt;br /&gt;
The following examples are valid tags for “vert-alignment”:&lt;br /&gt;
&lt;br /&gt;
 [vert-alignment='top']&lt;br /&gt;
 [vert-alignment='bottom']&lt;br /&gt;
 [vert-alignment='centre']&lt;br /&gt;
 [vert-alignment=’stretch’]&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Text can also be vertically aligned. It can be aligned to [vert-alignment='top']top, &lt;br /&gt;
 [vert-alignment='bottom']bottom, [vert-alignment='centre']centre and [vert-alignment='stretch']'stretch'&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Embedded window elements cannot be stretched currently. This may also change in the future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Padding ===&lt;br /&gt;
Padding is related to the vertical alignment tag in that it also allows you to specify the setting of elements in a text. You can set individual text elements or the whole text all together. The value you give the padding tag are a number of pixels to pad the surrounding elements with. The padding tag uses a “rect” property to specify padding values, like so: ‘l:&amp;lt;value&amp;gt; t:&amp;lt;value&amp;gt; r:&amp;lt;value&amp;gt; b:&amp;lt;value&amp;gt;) where “l” stands for “left padding, “t” stands for “top padding”, “r” stands for “right padding” and “b” stands for “bottom padding”.&lt;br /&gt;
&lt;br /&gt;
Consider the following sample text: ''“Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. THIS IS PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.”''&lt;br /&gt;
&lt;br /&gt;
Our aim is to pad the text element “THIS IS PADDED” with 5 pixels of left and right padding and 10 pixels of top and bottom padding. The tag would look like this: &lt;br /&gt;
&lt;br /&gt;
 [padding=’l:5 t:10 r:5 b:10’]&lt;br /&gt;
&lt;br /&gt;
Use padding, for example to provide extra spacing when embedding a picture or window in text.&lt;br /&gt;
Here is the code sample:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco &lt;br /&gt;
 laboris nisi ut aliquip ex ea commodo consequat. [padding=’l:5 t:10 r:5 b:10’]THIS IS PADDED.[padding=’l:0 t:0 &lt;br /&gt;
 r:0 b:0’] Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla &lt;br /&gt;
 pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id &lt;br /&gt;
 est laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks like in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Don’t try to translate the latin here – its complete nonsense. The “Lorem Ipsum” text has been around since the 1500s, when an unknown printer defined it as a dummy text to make a type specimen book, and it’s still in use today. Strange but true.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Window ===&lt;br /&gt;
The ‘window’ tag manipulates an existing child window of the window that you set the text on, such that the window is drawn in-line with the text, which means it moves with the text automatically. The ‘window’ tag takes the full name of the window just as you would use it with CEGUI::WindowManager. While the named window can be any window, it only makes sense to reference windows that are attached to the window where the text will be rendered.&lt;br /&gt;
&lt;br /&gt;
So let us embed a button into our text! &lt;br /&gt;
&lt;br /&gt;
First, we define the window in our layout:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;GUILayout &amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/FrameWindow&amp;quot; Name=&amp;quot;generat0r/AboutDialog&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;About generat0r&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;Arial-14&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarEnabled&amp;quot; Value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;CloseButtonEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;SizingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;			&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.015,0},{0.015,0},{0.45,0},{0.40,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedPosition&amp;quot; Value=&amp;quot;{ {0.25, 0}, {0.25, 0} }&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/StaticText&amp;quot; Name=&amp;quot;generat0r/AboutDialog/StaticText&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Demonstrates static (non editable) text. Use the controls on your right for &lt;br /&gt;
 formatting options.&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzExtent&amp;quot; Value=&amp;quot;361&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertExtent&amp;quot; Value=&amp;quot;59.5854&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzFormatting&amp;quot; Value=&amp;quot;WordWrapLeftAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertFormatting&amp;quot; Value=&amp;quot;TopAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.03,0},{0.03,0},{0.97,0},{0.85,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot; &lt;br /&gt;
&amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Embedded&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/Window&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/CloseButton&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Close&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/GUILayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pay special attention to the cut out segment in the above layout! Please also note that the window I want to embed is a child of the text window.&lt;br /&gt;
&lt;br /&gt;
Our tag will look like this:&lt;br /&gt;
&lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']&lt;br /&gt;
&lt;br /&gt;
Now, you just need to embed the defined window (&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot;) into you string, like so:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit,sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco  &lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']laboris nisi ut aliquip ex ea commodo consequat. THIS IS &lt;br /&gt;
 PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. &lt;br /&gt;
 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est &lt;br /&gt;
 laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The window tag works fine with formatting options for text. Please consider, though, that the embedded window is treated as a single entity. So if you embed a window that just draws text, the text of that window will not be split for wrapping purposes, but might have its own formatting! Padding and vertical alignments work here as well, with the exception of the ‘stretch’ option (which will default to ‘centre’ and raise a note in the CEGUI.log)&lt;br /&gt;
&lt;br /&gt;
Note: If you have not created the window you call here, you will get an ‘unknown object’ exception!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Feedback ==&lt;br /&gt;
Feedback is very welcome: please just PM me in the forum (my handle is ‘mboeni’) or leave a comment here in the wiki. :) &lt;br /&gt;
&lt;br /&gt;
--[[User:Mboeni|Mboeni]] 13:33, 24 September 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Mboeni</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3442</id>
		<title>Formatting Tags in CEGUI</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3442"/>
				<updated>2010-09-24T13:45:33Z</updated>
		
		<summary type="html">&lt;p&gt;Mboeni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Some Basics ==&lt;br /&gt;
CEGUI has a nice feature that allows for formatted text in a widget, called “formatting tags”. Basically, you insert tags like:&lt;br /&gt;
&lt;br /&gt;
 [tag-name='value']&lt;br /&gt;
&lt;br /&gt;
into your strings and CEGUI does the necessary parsing (see [http://www.cegui.org.uk/docs/current/classCEGUI_1_1BasicRenderedStringParser.html CEGUI::BasicRenderedStringParser] class reference for details).&lt;br /&gt;
&lt;br /&gt;
It is important to note that these tags are like a ‘state change’, that means if you set a specific formatting option, it stays active until changed by another tag. You will see some examples later on.&lt;br /&gt;
&lt;br /&gt;
== Available Tags ==&lt;br /&gt;
=== Font Colours ===&lt;br /&gt;
Changing the text color in a string is quite easy, so let’s start with that. In the following example, we will have some text shown in red, green and blue. Here’s how the tags work:&lt;br /&gt;
&lt;br /&gt;
 &amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI can format strings.[colour='FF00FF00']&lt;br /&gt;
 and this is just colour [colour='FF0000FF'] formatting!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In code, it looks like this:&lt;br /&gt;
&lt;br /&gt;
 CEGUI::Window* textComponent =  &lt;br /&gt;
 (CEGUI::Window*)CEGUI::WindowManager::getSingleton().getWindow(&amp;quot;generat0r/AboutDialog/StaticText&amp;quot;);&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI &lt;br /&gt;
 can format strings.[colour='FF00FF00'] and this is just colour [colour='FF0000FF'] formatting!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And that's how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A note:&lt;br /&gt;
* In case you have wondered why 4 sets of values are needed for each colour:  Red, for example, is described by [colour=’FFFF0000’] where the first ‘FF’ is the Alpha value (fully opaque in this case), the second is the value for the red component, the third for the green component and the fourth for the blue component, like in [AARRGGBB]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Font Formatting ===&lt;br /&gt;
Font formatting is a bit more involved as you need to have the actual fonts and the ‘font’ XML files defined for each style.&lt;br /&gt;
&lt;br /&gt;
Let’s assume you want to use the Arial font with the styles ‘normal’, ‘''italic''’, ‘'''bold'''’ and ‘'''''bold Italic'''''’. This actually requires you to have four different Arial fonts. For Arial, the fonts are called as follows:&lt;br /&gt;
&lt;br /&gt;
* Arial normal (arial.ttf)&lt;br /&gt;
* Arial bold (arialbd.ttf)&lt;br /&gt;
* Arial italic (ariali.ttf)&lt;br /&gt;
* Arial bold italic (arialbi.ttf)&lt;br /&gt;
&lt;br /&gt;
If you want to tinker around with them you can find these and some more in the font manager app of your OS (Arial ships with Windows, so you can get them from the OS). Note that Arial is copyrighted, so you might want to use a free font for your app (check out [http://www.dafont.com/ DaFont] for example).&lt;br /&gt;
&lt;br /&gt;
For each font, you will now have to create the according “.font” file that tells CEGUI how to use the font:&lt;br /&gt;
&lt;br /&gt;
* Arial-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-10&amp;quot; Filename=&amp;quot;arial.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot; &lt;br /&gt;
 AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Bold-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Bold-10&amp;quot; Filename=&amp;quot;arialbd.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Italic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Italic-10&amp;quot; Filename=&amp;quot;ariali.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-BoldItalic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-BoldItalic-10&amp;quot; Filename=&amp;quot;arialbi.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don’t forget to add the font definitions into your scheme, like so:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;GUIScheme Name=&amp;quot;VanillaSkin&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;Imageset Filename=&amp;quot;Vanilla.imageset&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Bold-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Italic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-BoldItalic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-14.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;LookNFeel Filename=&amp;quot;Vanilla.looknfeel&amp;quot; /&amp;gt;&lt;br /&gt;
  …snip…&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;You can also do [font='Arial-Bold-10']bold text, [font='Arial-Italic-10']italic &lt;br /&gt;
 text, [font='Arial-BoldItalic-10']bold AND italic text.[font='Arial-10']!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Embedding Images ===&lt;br /&gt;
Embedding an image into text is quite easy. The required tag follows the general syntax. Consider the following tag:&lt;br /&gt;
&lt;br /&gt;
 [image=set:&amp;lt;imageset&amp;gt; image:&amp;lt;image&amp;gt;']&lt;br /&gt;
&lt;br /&gt;
What you need to do here is specify the imageset where the image is specified and identify the image to be used. Let’s assume you want to embed the MouseCursor of the TaharezLook imageset into the following text: “Nice, I can even embed images like this &amp;lt;mousepic here&amp;gt; into my text.”&lt;br /&gt;
&lt;br /&gt;
First you need to know the name of the imageset and the name of the image. Let’s have a look at “TaharezLook.imageset” for that purpose:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Imageset Name=&amp;quot;TaharezLook&amp;quot; Imagefile=&amp;quot;TaharezLook.tga&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot;  &lt;br /&gt;
 AutoScaled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;Image Name=&amp;quot;MouseArrow&amp;quot; XPos=&amp;quot;138&amp;quot; YPos=&amp;quot;127&amp;quot; Width=&amp;quot;31&amp;quot; Height=&amp;quot;25&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/Imageset&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the imageset is named “TaharezLook” and the wanted image is called “MouseArrow”. In code this would now look like follows:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image='set:TaharezLook image:MouseArrow'] &lt;br /&gt;
 into my text. &amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And this is how it looks in my App:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: The following tags have an effect on the way the image is drawn: ‘padding’, ‘alignment’ and ‘colour’.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Image Size ===&lt;br /&gt;
The ‘image-size’ tag allows you to change the size of embedded image components. The sized in the tag are given in pixels and the format is as follows:&lt;br /&gt;
&lt;br /&gt;
 w:&amp;lt;width value&amp;gt; h:&amp;lt;height value&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which specifies the width and height of a following image. So to set the size of a subsequent image to 32 pixels height and 64 pixels width, you would use:&lt;br /&gt;
&lt;br /&gt;
 [image-size=’w:32 h:64’]&lt;br /&gt;
&lt;br /&gt;
Here is how it might look in code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image-size='w:32 h:64']&lt;br /&gt;
 [image='set:TaharezLook image:MouseArrow'] into my text.&amp;quot;); &lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: To set the image-size back to the real size of the image, just set the values to zero, like so:  [image-size=’w:0 h:0’]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Vertical Alignment ===&lt;br /&gt;
The vertical alignment Tag allows you align elements within a text that have different heights. The overall available space on a line is always taken as the height of the tallest element plus any vertical padding, elements are then positioned within this vertical space according to the specified option. Currently, you can align an element to ‘top’, ‘bottom’, ‘centre’ and ‘stretch’. The option ‘stretch’ will stretch the tagged elements vertically to fill the available space. Please note that the stretching is vertical only, aspect ratios of images and text are not maintained! This will be accounted for in the future, though.&lt;br /&gt;
&lt;br /&gt;
The following examples are valid tags for “vert-alignment”:&lt;br /&gt;
&lt;br /&gt;
 [vert-alignment='top']&lt;br /&gt;
 [vert-alignment='bottom']&lt;br /&gt;
 [vert-alignment='centre']&lt;br /&gt;
 [vert-alignment=’stretch’]&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Text can also be vertically aligned. It can be aligned to [vert-alignment='top']top, &lt;br /&gt;
 [vert-alignment='bottom']bottom, [vert-alignment='centre']centre and [vert-alignment='stretch']'stretch'&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Embedded window elements cannot be stretched currently. This may also change in the future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Padding ===&lt;br /&gt;
Padding is related to the vertical alignment tag in that it also allows you to specify the setting of elements in a text. You can set individual text elements or the whole text all together. The value you give the padding tag are a number of pixels to pad the surrounding elements with. The padding tag uses a “rect” property to specify padding values, like so: ‘l:&amp;lt;value&amp;gt; t:&amp;lt;value&amp;gt; r:&amp;lt;value&amp;gt; b:&amp;lt;value&amp;gt;) where “l” stands for “left padding, “t” stands for “top padding”, “r” stands for “right padding” and “b” stands for “bottom padding”.&lt;br /&gt;
&lt;br /&gt;
Consider the following sample text: ''“Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. THIS IS PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.”''&lt;br /&gt;
&lt;br /&gt;
Our aim is to pad the text element “THIS IS PADDED” with 5 pixels of left and right padding and 10 pixels of top and bottom padding. The tag would look like this: &lt;br /&gt;
&lt;br /&gt;
 [padding=’l:5 t:10 r:5 b:10’]&lt;br /&gt;
&lt;br /&gt;
Use padding, for example to provide extra spacing when embedding a picture or window in text.&lt;br /&gt;
Here is the code sample:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco &lt;br /&gt;
 laboris nisi ut aliquip ex ea commodo consequat. [padding=’l:5 t:10 r:5 b:10’]THIS IS PADDED.[padding=’l:0 t:0 &lt;br /&gt;
 r:0 b:0’] Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla &lt;br /&gt;
 pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id &lt;br /&gt;
 est laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks like in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Don’t try to translate the latin here – its complete nonsense. The “Lorem Ipsum” text has been around since the 1500s, when an unknown printer defined it as a dummy text to make a type specimen book, and it’s still in use today. Strange but true.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Window ===&lt;br /&gt;
The ‘window’ tag manipulates an existing child window of the window that you set the text on, such that the window is drawn in-line with the text, which means it moves with the text automatically. The ‘window’ tag takes the full name of the window just as you would use it with CEGUI::WindowManager. While the named window can be any window, it only makes sense to reference windows that are attached to the window where the text will be rendered.&lt;br /&gt;
&lt;br /&gt;
So let us embed a button into our text! &lt;br /&gt;
&lt;br /&gt;
First, we define the window in our layout:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;GUILayout &amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/FrameWindow&amp;quot; Name=&amp;quot;generat0r/AboutDialog&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;About generat0r&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;Arial-14&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarEnabled&amp;quot; Value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;CloseButtonEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;SizingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;			&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.015,0},{0.015,0},{0.45,0},{0.40,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedPosition&amp;quot; Value=&amp;quot;{ {0.25, 0}, {0.25, 0} }&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/StaticText&amp;quot; Name=&amp;quot;generat0r/AboutDialog/StaticText&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Demonstrates static (non editable) text. Use the controls on your right for &lt;br /&gt;
 formatting options.&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzExtent&amp;quot; Value=&amp;quot;361&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertExtent&amp;quot; Value=&amp;quot;59.5854&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzFormatting&amp;quot; Value=&amp;quot;WordWrapLeftAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertFormatting&amp;quot; Value=&amp;quot;TopAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.03,0},{0.03,0},{0.97,0},{0.85,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot; &lt;br /&gt;
&amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Embedded&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/Window&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/CloseButton&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Close&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/GUILayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pay special attention to the cut out segment in the above layout! Please also note that the window I want to embed is a child of the text window.&lt;br /&gt;
&lt;br /&gt;
Our tag will look like this:&lt;br /&gt;
&lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']&lt;br /&gt;
&lt;br /&gt;
Now, you just need to embed the defined window (&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot;) into you string, like so:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit,sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco  &lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']laboris nisi ut aliquip ex ea commodo consequat. THIS IS &lt;br /&gt;
 PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. &lt;br /&gt;
 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est &lt;br /&gt;
 laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The window tag works fine with formatting options for text. Please consider, though, that the embedded window is treated as a single entity. So if you embed a window that just draws text, the text of that window will not be split for wrapping purposes, but might have its own formatting! Padding and vertical alignments work here as well, with the exception of the ‘stretch’ option (which will default to ‘centre’ and raise a note in the CEGUI.log)&lt;br /&gt;
&lt;br /&gt;
Note: If you have not created the window you call here, you will get an ‘unknown object’ exception!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Feedback ==&lt;br /&gt;
Feedback is very welcome: please just PM me in the forum (my handle is ‘mboeni’) or leave a comment here in the wiki. :) &lt;br /&gt;
&lt;br /&gt;
--[[User:Mboeni|Mboeni]] 13:33, 24 September 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Mboeni</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Template:CEGUIWikiWhatsNew&amp;diff=3441</id>
		<title>Template:CEGUIWikiWhatsNew</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Template:CEGUIWikiWhatsNew&amp;diff=3441"/>
				<updated>2010-09-24T13:44:18Z</updated>
		
		<summary type="html">&lt;p&gt;Mboeni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Section|1=The last 5 additions to the wiki ([http://www.cegui.org.uk/wiki/index.php?title=Template:CEGUIWikiWhatsNew&amp;amp;action=edit edit])|2=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- In descending order (newest first, oldest last) --&amp;gt;&lt;br /&gt;
* Tutorials: [[Formatting_Tags_in_CEGUI|Formatting Tags in CEGUI]] : Add formatting to your text in CEGUI.&lt;br /&gt;
* Tutorials: [[Hit testing of non rectangular windows with CEGUI 0.7.x]] : Create window with per-pixel hit testing.&lt;br /&gt;
* Articles: [[EventLookup|Event Lookup table]] : Info about subscribable events in CEGUI. &lt;br /&gt;
* Articles: [[Changes and Porting Tips for 0.7.0]] : Info regarding changes in CEGUI's next version.&lt;br /&gt;
* Code Snippets: [[PseudoListbox]] : Implement a multi-column listbox with any widgets&lt;br /&gt;
* Articles: [[All About RenderTargets]] : Info about CEGUI's RenderTarget development.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
''To all wiki author, please edit this section when you add a new page to the wiki.''&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Mboeni</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Template:CEGUIWikiWhatsNew&amp;diff=3440</id>
		<title>Template:CEGUIWikiWhatsNew</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Template:CEGUIWikiWhatsNew&amp;diff=3440"/>
				<updated>2010-09-24T13:43:28Z</updated>
		
		<summary type="html">&lt;p&gt;Mboeni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Section|1=The last 5 additions to the wiki ([http://www.cegui.org.uk/wiki/index.php?title=Template:CEGUIWikiWhatsNew&amp;amp;action=edit edit])|2=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- In descending order (newest first, oldest last) --&amp;gt;&lt;br /&gt;
* Tutorials: [[Formatting_Tags_in_CEGUI|Formatting Tags in CEGUI]].&lt;br /&gt;
* Tutorials: [[Hit testing of non rectangular windows with CEGUI 0.7.x]] : Create window with per-pixel hit testing.&lt;br /&gt;
* Articles: [[EventLookup|Event Lookup table]] : Info about subscribable events in CEGUI. &lt;br /&gt;
* Articles: [[Changes and Porting Tips for 0.7.0]] : Info regarding changes in CEGUI's next version.&lt;br /&gt;
* Code Snippets: [[PseudoListbox]] : Implement a multi-column listbox with any widgets&lt;br /&gt;
* Articles: [[All About RenderTargets]] : Info about CEGUI's RenderTarget development.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
''To all wiki author, please edit this section when you add a new page to the wiki.''&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Mboeni</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3439</id>
		<title>Formatting Tags in CEGUI</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3439"/>
				<updated>2010-09-24T13:38:41Z</updated>
		
		<summary type="html">&lt;p&gt;Mboeni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Some Basics ===&lt;br /&gt;
CEGUI has a nice feature that allows for formatted text in a widget, called “formatting tags”. Basically, you insert tags like:&lt;br /&gt;
&lt;br /&gt;
 [tag-name='value']&lt;br /&gt;
&lt;br /&gt;
into your strings and CEGUI does the necessary parsing (see [http://www.cegui.org.uk/docs/current/classCEGUI_1_1BasicRenderedStringParser.html CEGUI::BasicRenderedStringParser] class reference for details).&lt;br /&gt;
&lt;br /&gt;
It is important to note that these tags are like a ‘state change’, that means if you set a specific formatting option, it stays active until changed by another tag. You will see some examples later on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Font Colours ===&lt;br /&gt;
Changing the text color in a string is quite easy, so let’s start with that. In the following example, we will have some text shown in red, green and blue. Here’s how the tags work:&lt;br /&gt;
&lt;br /&gt;
 &amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI can format strings.[colour='FF00FF00']&lt;br /&gt;
 and this is just colour [colour='FF0000FF'] formatting!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In code, it looks like this:&lt;br /&gt;
&lt;br /&gt;
 CEGUI::Window* textComponent =  &lt;br /&gt;
 (CEGUI::Window*)CEGUI::WindowManager::getSingleton().getWindow(&amp;quot;generat0r/AboutDialog/StaticText&amp;quot;);&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI &lt;br /&gt;
 can format strings.[colour='FF00FF00'] and this is just colour [colour='FF0000FF'] formatting!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And that's how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A note:&lt;br /&gt;
* In case you have wondered why 4 sets of values are needed for each colour:  Red, for example, is described by [colour=’FFFF0000’] where the first ‘FF’ is the Alpha value (fully opaque in this case), the second is the value for the red component, the third for the green component and the fourth for the blue component, like in [AARRGGBB]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Font Formatting ===&lt;br /&gt;
Font formatting is a bit more involved as you need to have the actual fonts and the ‘font’ XML files defined for each style.&lt;br /&gt;
&lt;br /&gt;
Let’s assume you want to use the Arial font with the styles ‘normal’, ‘''italic''’, ‘'''bold'''’ and ‘'''''bold Italic'''''’. This actually requires you to have four different Arial fonts. For Arial, the fonts are called as follows:&lt;br /&gt;
&lt;br /&gt;
* Arial normal (arial.ttf)&lt;br /&gt;
* Arial bold (arialbd.ttf)&lt;br /&gt;
* Arial italic (ariali.ttf)&lt;br /&gt;
* Arial bold italic (arialbi.ttf)&lt;br /&gt;
&lt;br /&gt;
If you want to tinker around with them you can find these and some more in the font manager app of your OS (Arial ships with Windows, so you can get them from the OS). Note that Arial is copyrighted, so you might want to use a free font for your app (check out [http://www.dafont.com/ DaFont] for example).&lt;br /&gt;
&lt;br /&gt;
For each font, you will now have to create the according “.font” file that tells CEGUI how to use the font:&lt;br /&gt;
&lt;br /&gt;
* Arial-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-10&amp;quot; Filename=&amp;quot;arial.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot; &lt;br /&gt;
 AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Bold-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Bold-10&amp;quot; Filename=&amp;quot;arialbd.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Italic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Italic-10&amp;quot; Filename=&amp;quot;ariali.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-BoldItalic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-BoldItalic-10&amp;quot; Filename=&amp;quot;arialbi.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don’t forget to add the font definitions into your scheme, like so:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;GUIScheme Name=&amp;quot;VanillaSkin&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;Imageset Filename=&amp;quot;Vanilla.imageset&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Bold-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Italic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-BoldItalic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-14.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;LookNFeel Filename=&amp;quot;Vanilla.looknfeel&amp;quot; /&amp;gt;&lt;br /&gt;
  …snip…&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;You can also do [font='Arial-Bold-10']bold text, [font='Arial-Italic-10']italic &lt;br /&gt;
 text, [font='Arial-BoldItalic-10']bold AND italic text.[font='Arial-10']!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Embedding Images ===&lt;br /&gt;
Embedding an image into text is quite easy. The required tag follows the general syntax. Consider the following tag:&lt;br /&gt;
&lt;br /&gt;
 [image=set:&amp;lt;imageset&amp;gt; image:&amp;lt;image&amp;gt;']&lt;br /&gt;
&lt;br /&gt;
What you need to do here is specify the imageset where the image is specified and identify the image to be used. Let’s assume you want to embed the MouseCursor of the TaharezLook imageset into the following text: “Nice, I can even embed images like this &amp;lt;mousepic here&amp;gt; into my text.”&lt;br /&gt;
&lt;br /&gt;
First you need to know the name of the imageset and the name of the image. Let’s have a look at “TaharezLook.imageset” for that purpose:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Imageset Name=&amp;quot;TaharezLook&amp;quot; Imagefile=&amp;quot;TaharezLook.tga&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot;  &lt;br /&gt;
 AutoScaled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;Image Name=&amp;quot;MouseArrow&amp;quot; XPos=&amp;quot;138&amp;quot; YPos=&amp;quot;127&amp;quot; Width=&amp;quot;31&amp;quot; Height=&amp;quot;25&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/Imageset&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the imageset is named “TaharezLook” and the wanted image is called “MouseArrow”. In code this would now look like follows:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image='set:TaharezLook image:MouseArrow'] &lt;br /&gt;
 into my text. &amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And this is how it looks in my App:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: The following tags have an effect on the way the image is drawn: ‘padding’, ‘alignment’ and ‘colour’.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Image Size ===&lt;br /&gt;
The ‘image-size’ tag allows you to change the size of embedded image components. The sized in the tag are given in pixels and the format is as follows:&lt;br /&gt;
&lt;br /&gt;
 w:&amp;lt;width value&amp;gt; h:&amp;lt;height value&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which specifies the width and height of a following image. So to set the size of a subsequent image to 32 pixels height and 64 pixels width, you would use:&lt;br /&gt;
&lt;br /&gt;
 [image-size=’w:32 h:64’]&lt;br /&gt;
&lt;br /&gt;
Here is how it might look in code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image-size='w:32 h:64']&lt;br /&gt;
 [image='set:TaharezLook image:MouseArrow'] into my text.&amp;quot;); &lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: To set the image-size back to the real size of the image, just set the values to zero, like so:  [image-size=’w:0 h:0’]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Vertical Alignment ===&lt;br /&gt;
The vertical alignment Tag allows you align elements within a text that have different heights. The overall available space on a line is always taken as the height of the tallest element plus any vertical padding, elements are then positioned within this vertical space according to the specified option. Currently, you can align an element to ‘top’, ‘bottom’, ‘centre’ and ‘stretch’. The option ‘stretch’ will stretch the tagged elements vertically to fill the available space. Please note that the stretching is vertical only, aspect ratios of images and text are not maintained! This will be accounted for in the future, though.&lt;br /&gt;
&lt;br /&gt;
The following examples are valid tags for “vert-alignment”:&lt;br /&gt;
&lt;br /&gt;
 [vert-alignment='top']&lt;br /&gt;
 [vert-alignment='bottom']&lt;br /&gt;
 [vert-alignment='centre']&lt;br /&gt;
 [vert-alignment=’stretch’]&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Text can also be vertically aligned. It can be aligned to [vert-alignment='top']top, &lt;br /&gt;
 [vert-alignment='bottom']bottom, [vert-alignment='centre']centre and [vert-alignment='stretch']'stretch'&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Embedded window elements cannot be stretched currently. This may also change in the future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Padding ===&lt;br /&gt;
Padding is related to the vertical alignment tag in that it also allows you to specify the setting of elements in a text. You can set individual text elements or the whole text all together. The value you give the padding tag are a number of pixels to pad the surrounding elements with. The padding tag uses a “rect” property to specify padding values, like so: ‘l:&amp;lt;value&amp;gt; t:&amp;lt;value&amp;gt; r:&amp;lt;value&amp;gt; b:&amp;lt;value&amp;gt;) where “l” stands for “left padding, “t” stands for “top padding”, “r” stands for “right padding” and “b” stands for “bottom padding”.&lt;br /&gt;
&lt;br /&gt;
Consider the following sample text: ''“Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. THIS IS PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.”''&lt;br /&gt;
&lt;br /&gt;
Our aim is to pad the text element “THIS IS PADDED” with 5 pixels of left and right padding and 10 pixels of top and bottom padding. The tag would look like this: &lt;br /&gt;
&lt;br /&gt;
 [padding=’l:5 t:10 r:5 b:10’]&lt;br /&gt;
&lt;br /&gt;
Use padding, for example to provide extra spacing when embedding a picture or window in text.&lt;br /&gt;
Here is the code sample:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco &lt;br /&gt;
 laboris nisi ut aliquip ex ea commodo consequat. [padding=’l:5 t:10 r:5 b:10’]THIS IS PADDED.[padding=’l:0 t:0 &lt;br /&gt;
 r:0 b:0’] Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla &lt;br /&gt;
 pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id &lt;br /&gt;
 est laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks like in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Don’t try to translate the latin here – its complete nonsense. The “Lorem Ipsum” text has been around since the 1500s, when an unknown printer defined it as a dummy text to make a type specimen book, and it’s still in use today. Strange but true.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Window ===&lt;br /&gt;
The ‘window’ tag manipulates an existing child window of the window that you set the text on, such that the window is drawn in-line with the text, which means it moves with the text automatically. The ‘window’ tag takes the full name of the window just as you would use it with CEGUI::WindowManager. While the named window can be any window, it only makes sense to reference windows that are attached to the window where the text will be rendered.&lt;br /&gt;
&lt;br /&gt;
So let us embed a button into our text! &lt;br /&gt;
&lt;br /&gt;
First, we define the window in our layout:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;GUILayout &amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/FrameWindow&amp;quot; Name=&amp;quot;generat0r/AboutDialog&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;About generat0r&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;Arial-14&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;TitlebarEnabled&amp;quot; Value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;CloseButtonEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;SizingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;			&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.015,0},{0.015,0},{0.45,0},{0.40,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedPosition&amp;quot; Value=&amp;quot;{ {0.25, 0}, {0.25, 0} }&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/StaticText&amp;quot; Name=&amp;quot;generat0r/AboutDialog/StaticText&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Demonstrates static (non editable) text. Use the controls on your right for &lt;br /&gt;
 formatting options.&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzExtent&amp;quot; Value=&amp;quot;361&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertExtent&amp;quot; Value=&amp;quot;59.5854&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;HorzFormatting&amp;quot; Value=&amp;quot;WordWrapLeftAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;VertFormatting&amp;quot; Value=&amp;quot;TopAligned&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.03,0},{0.03,0},{0.97,0},{0.85,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot; &lt;br /&gt;
&amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Embedded&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/Window&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/CloseButton&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Close&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/GUILayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pay special attention to the cut out segment in the above layout! Please also note that the window I want to embed is a child of the text window.&lt;br /&gt;
&lt;br /&gt;
Our tag will look like this:&lt;br /&gt;
&lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']&lt;br /&gt;
&lt;br /&gt;
Now, you just need to embed the defined window (&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot;) into you string, like so:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit,sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco  &lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']laboris nisi ut aliquip ex ea commodo consequat. THIS IS &lt;br /&gt;
 PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. &lt;br /&gt;
 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est &lt;br /&gt;
 laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The window tag works fine with formatting options for text. Please consider, though, that the embedded window is treated as a single entity. So if you embed a window that just draws text, the text of that window will not be split for wrapping purposes, but might have its own formatting! Padding and vertical alignments work here as well, with the exception of the ‘stretch’ option (which will default to ‘centre’ and raise a note in the CEGUI.log)&lt;br /&gt;
&lt;br /&gt;
Note: If you have not created the window you call here, you will get an ‘unknown object’ exception!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Feedback ===&lt;br /&gt;
Feedback is very welcome: please just PM me in the forum (my handle is ‘mboeni’) or leave a comment here in the wiki. :) &lt;br /&gt;
&lt;br /&gt;
--[[User:Mboeni|Mboeni]] 13:33, 24 September 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Mboeni</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3438</id>
		<title>Formatting Tags in CEGUI</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3438"/>
				<updated>2010-09-24T13:33:47Z</updated>
		
		<summary type="html">&lt;p&gt;Mboeni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Some Basics ===&lt;br /&gt;
CEGUI has a nice feature that allows for formatted text in a widget, called “formatting tags”. Basically, you insert tags like:&lt;br /&gt;
&lt;br /&gt;
 [tag-name='value']&lt;br /&gt;
&lt;br /&gt;
into your strings and CEGUI does the necessary parsing (see [http://www.cegui.org.uk/docs/current/classCEGUI_1_1BasicRenderedStringParser.html CEGUI::BasicRenderedStringParser] class reference for details).&lt;br /&gt;
&lt;br /&gt;
It is important to note that these tags are like a ‘state change’, that means if you set a specific formatting option, it stays active until changed by another tag. You will see some examples later on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Font Colours ===&lt;br /&gt;
Changing the text color in a string is quite easy, so let’s start with that. In the following example, we will have some text shown in red, green and blue. Here’s how the tags work:&lt;br /&gt;
&lt;br /&gt;
 &amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI can format strings.[colour='FF00FF00']&lt;br /&gt;
 and this is just colour [colour='FF0000FF'] formatting!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In code, it looks like this:&lt;br /&gt;
&lt;br /&gt;
 CEGUI::Window* textComponent =  &lt;br /&gt;
 (CEGUI::Window*)CEGUI::WindowManager::getSingleton().getWindow(&amp;quot;generat0r/AboutDialog/StaticText&amp;quot;);&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI &lt;br /&gt;
 can format strings.[colour='FF00FF00'] and this is just colour [colour='FF0000FF'] formatting!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And that's how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A note:&lt;br /&gt;
* In case you have wondered why 4 sets of values are needed for each colour:  Red, for example, is described by [colour=’FFFF0000’] where the first ‘FF’ is the Alpha value (fully opaque in this case), the second is the value for the red component, the third for the green component and the fourth for the blue component, like in [AARRGGBB]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Font Formatting ===&lt;br /&gt;
Font formatting is a bit more involved as you need to have the actual fonts and the ‘font’ XML files defined for each style.&lt;br /&gt;
&lt;br /&gt;
Let’s assume you want to use the Arial font with the styles ‘normal’, ‘''italic''’, ‘'''bold'''’ and ‘'''''bold Italic'''''’. This actually requires you to have four different Arial fonts. For Arial, the fonts are called as follows:&lt;br /&gt;
&lt;br /&gt;
* Arial normal (arial.ttf)&lt;br /&gt;
* Arial bold (arialbd.ttf)&lt;br /&gt;
* Arial italic (ariali.ttf)&lt;br /&gt;
* Arial bold italic (arialbi.ttf)&lt;br /&gt;
&lt;br /&gt;
If you want to tinker around with them you can find these and some more in the font manager app of your OS (Arial ships with Windows, so you can get them from the OS). Note that Arial is copyrighted, so you might want to use a free font for your app (check out [http://www.dafont.com/ DaFont] for example).&lt;br /&gt;
&lt;br /&gt;
For each font, you will now have to create the according “.font” file that tells CEGUI how to use the font:&lt;br /&gt;
&lt;br /&gt;
* Arial-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-10&amp;quot; Filename=&amp;quot;arial.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot; &lt;br /&gt;
 AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Bold-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Bold-10&amp;quot; Filename=&amp;quot;arialbd.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Italic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Italic-10&amp;quot; Filename=&amp;quot;ariali.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-BoldItalic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-BoldItalic-10&amp;quot; Filename=&amp;quot;arialbi.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don’t forget to add the font definitions into your scheme, like so:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;GUIScheme Name=&amp;quot;VanillaSkin&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;Imageset Filename=&amp;quot;Vanilla.imageset&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Bold-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Italic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-BoldItalic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-14.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;LookNFeel Filename=&amp;quot;Vanilla.looknfeel&amp;quot; /&amp;gt;&lt;br /&gt;
  …snip…&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;You can also do [font='Arial-Bold-10']bold text, [font='Arial-Italic-10']italic &lt;br /&gt;
 text, [font='Arial-BoldItalic-10']bold AND italic text.[font='Arial-10']!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Embedding Images ===&lt;br /&gt;
Embedding an image into text is quite easy. The required tag follows the general syntax. Consider the following tag:&lt;br /&gt;
&lt;br /&gt;
 [image=set:&amp;lt;imageset&amp;gt; image:&amp;lt;image&amp;gt;']&lt;br /&gt;
&lt;br /&gt;
What you need to do here is specify the imageset where the image is specified and identify the image to be used. Let’s assume you want to embed the MouseCursor of the TaharezLook imageset into the following text: “Nice, I can even embed images like this &amp;lt;mousepic here&amp;gt; into my text.”&lt;br /&gt;
&lt;br /&gt;
First you need to know the name of the imageset and the name of the image. Let’s have a look at “TaharezLook.imageset” for that purpose:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Imageset Name=&amp;quot;TaharezLook&amp;quot; Imagefile=&amp;quot;TaharezLook.tga&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot;  &lt;br /&gt;
 AutoScaled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;Image Name=&amp;quot;MouseArrow&amp;quot; XPos=&amp;quot;138&amp;quot; YPos=&amp;quot;127&amp;quot; Width=&amp;quot;31&amp;quot; Height=&amp;quot;25&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/Imageset&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the imageset is named “TaharezLook” and the wanted image is called “MouseArrow”. In code this would now look like follows:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image='set:TaharezLook image:MouseArrow'] &lt;br /&gt;
 into my text. &amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And this is how it looks in my App:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: The following tags have an effect on the way the image is drawn: ‘padding’, ‘alignment’ and ‘colour’.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Image Size ===&lt;br /&gt;
The ‘image-size’ tag allows you to change the size of embedded image components. The sized in the tag are given in pixels and the format is as follows:&lt;br /&gt;
&lt;br /&gt;
 w:&amp;lt;width value&amp;gt; h:&amp;lt;height value&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which specifies the width and height of a following image. So to set the size of a subsequent image to 32 pixels height and 64 pixels width, you would use:&lt;br /&gt;
&lt;br /&gt;
 [image-size=’w:32 h:64’]&lt;br /&gt;
&lt;br /&gt;
Here is how it might look in code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image-size='w:32 h:64']&lt;br /&gt;
 [image='set:TaharezLook image:MouseArrow'] into my text.&amp;quot;); &lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: To set the image-size back to the real size of the image, just set the values to zero, like so:  [image-size=’w:0 h:0’]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Vertical Alignment ===&lt;br /&gt;
The vertical alignment Tag allows you align elements within a text that have different heights. The overall available space on a line is always taken as the height of the tallest element plus any vertical padding, elements are then positioned within this vertical space according to the specified option. Currently, you can align an element to ‘top’, ‘bottom’, ‘centre’ and ‘stretch’. The option ‘stretch’ will stretch the tagged elements vertically to fill the available space. Please note that the stretching is vertical only, aspect ratios of images and text are not maintained! This will be accounted for in the future, though.&lt;br /&gt;
&lt;br /&gt;
The following examples are valid tags for “vert-alignment”:&lt;br /&gt;
&lt;br /&gt;
 [vert-alignment='top']&lt;br /&gt;
 [vert-alignment='bottom']&lt;br /&gt;
 [vert-alignment='centre']&lt;br /&gt;
 [vert-alignment=’stretch’]&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Text can also be vertically aligned. It can be aligned to [vert-alignment='top']top, &lt;br /&gt;
 [vert-alignment='bottom']bottom, [vert-alignment='centre']centre and [vert-alignment='stretch']'stretch'&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Embedded window elements cannot be stretched currently. This may also change in the future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Padding ===&lt;br /&gt;
Padding is related to the vertical alignment tag in that it also allows you to specify the setting of elements in a text. You can set individual text elements or the whole text all together. The value you give the padding tag are a number of pixels to pad the surrounding elements with. The padding tag uses a “rect” property to specify padding values, like so: ‘l:&amp;lt;value&amp;gt; t:&amp;lt;value&amp;gt; r:&amp;lt;value&amp;gt; b:&amp;lt;value&amp;gt;) where “l” stands for “left padding, “t” stands for “top padding”, “r” stands for “right padding” and “b” stands for “bottom padding”.&lt;br /&gt;
&lt;br /&gt;
Consider the following sample text: ''“Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. THIS IS PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.”''&lt;br /&gt;
&lt;br /&gt;
Our aim is to pad the text element “THIS IS PADDED” with 5 pixels of left and right padding and 10 pixels of top and bottom padding. The tag would look like this: &lt;br /&gt;
&lt;br /&gt;
 [padding=’l:5 t:10 r:5 b:10’]&lt;br /&gt;
&lt;br /&gt;
Use padding, for example to provide extra spacing when embedding a picture or window in text.&lt;br /&gt;
Here is the code sample:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco &lt;br /&gt;
 laboris nisi ut aliquip ex ea commodo consequat. [padding=’l:5 t:10 r:5 b:10’]THIS IS PADDED.[padding=’l:0 t:0 &lt;br /&gt;
 r:0 b:0’] Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla &lt;br /&gt;
 pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id &lt;br /&gt;
 est laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks like in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: Don’t try to translate the latin here – its complete nonsense. The “Lorem Ipsum” text has been around since the 1500s, when an unknown printer defined it as a dummy text to make a type specimen book, and it’s still in use today. Strange but true.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Window ===&lt;br /&gt;
The ‘window’ tag manipulates an existing child window of the window that you set the text on, such that the window is drawn in-line with the text, which means it moves with the text automatically. The ‘window’ tag takes the full name of the window just as you would use it with CEGUI::WindowManager. While the named window can be any window, it only makes sense to reference windows that are attached to the window where the text will be rendered.&lt;br /&gt;
&lt;br /&gt;
So let us embed a button into our text! &lt;br /&gt;
&lt;br /&gt;
First, we define the window in our layout:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;GUILayout &amp;gt;&lt;br /&gt;
  &amp;lt;Window Type=&amp;quot;Vanilla/FrameWindow&amp;quot; Name=&amp;quot;generat0r/AboutDialog&amp;quot; &amp;gt;&lt;br /&gt;
    &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;About generat0r&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;Arial-14&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Property Name=&amp;quot;TitlebarEnabled&amp;quot; Value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Property Name=&amp;quot;CloseButtonEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Property Name=&amp;quot;SizingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;			&lt;br /&gt;
    &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.015,0},{0.015,0},{0.45,0},{0.40,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Property Name=&amp;quot;UnifiedPosition&amp;quot; Value=&amp;quot;{ {0.25, 0}, {0.25, 0} }&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Window Type=&amp;quot;Vanilla/StaticText&amp;quot; Name=&amp;quot;generat0r/AboutDialog/StaticText&amp;quot; &amp;gt;&lt;br /&gt;
    &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Demonstrates static (non editable) text. Use the controls on your right for &lt;br /&gt;
    formatting options.&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Property Name=&amp;quot;HorzExtent&amp;quot; Value=&amp;quot;361&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Property Name=&amp;quot;VertExtent&amp;quot; Value=&amp;quot;59.5854&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Property Name=&amp;quot;HorzFormatting&amp;quot; Value=&amp;quot;WordWrapLeftAligned&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Property Name=&amp;quot;VertFormatting&amp;quot; Value=&amp;quot;TopAligned&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.03,0},{0.03,0},{0.97,0},{0.85,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
				&lt;br /&gt;
  '''  &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot; &amp;gt;&lt;br /&gt;
	&amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Embedded&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/Window&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/Window&amp;gt;&lt;br /&gt;
  &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/CloseButton&amp;quot; &amp;gt;&lt;br /&gt;
    &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Close&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/GUILayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pay special attention to the bold segment in the above layout! Please also note that the window I want to embed is a child of the text window.&lt;br /&gt;
&lt;br /&gt;
Our tag will look like this:&lt;br /&gt;
&lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']&lt;br /&gt;
&lt;br /&gt;
Now, you just need to embed the defined window (&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot;) into you string, like so:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit,sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco  &lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']laboris nisi ut aliquip ex ea commodo consequat. THIS IS &lt;br /&gt;
 PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. &lt;br /&gt;
 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est &lt;br /&gt;
 laborum.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The window tag works fine with formatting options for text. Please consider, though, that the embedded window is treated as a single entity. So if you embed a window that just draws text, the text of that window will not be split for wrapping purposes, but might have its own formatting! Padding and vertical alignments work here as well, with the exception of the ‘stretch’ option (which will default to ‘centre’ and raise a note in the CEGUI.log)&lt;br /&gt;
&lt;br /&gt;
Note: If you have not created the window you call here, you will get an ‘unknown object’ exception!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Feedback ===&lt;br /&gt;
Feedback is very welcome: please just PM me in the forum (my handle is ‘mboeni’) or leave a comment here in the wiki. :) &lt;br /&gt;
&lt;br /&gt;
--[[User:Mboeni|Mboeni]] 13:33, 24 September 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Mboeni</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3437</id>
		<title>Formatting Tags in CEGUI</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=3437"/>
				<updated>2010-09-24T13:24:00Z</updated>
		
		<summary type="html">&lt;p&gt;Mboeni: Created page with '=== Some Basics === CEGUI has a nice feature that allows for formatted text in a widget, called “formatting tags”. Basically, you insert tags like:   [tag-name='value']  into…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Some Basics ===&lt;br /&gt;
CEGUI has a nice feature that allows for formatted text in a widget, called “formatting tags”. Basically, you insert tags like:&lt;br /&gt;
&lt;br /&gt;
 [tag-name='value']&lt;br /&gt;
&lt;br /&gt;
into your strings and CEGUI does the necessary parsing (see [http://www.cegui.org.uk/docs/current/classCEGUI_1_1BasicRenderedStringParser.html CEGUI::BasicRenderedStringParser] class reference for details).&lt;br /&gt;
&lt;br /&gt;
It is important to note that these tags are like a ‘state change’, that means if you set a specific formatting option, it stays active until changed by another tag. You will see some examples later on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Font Colours ===&lt;br /&gt;
Changing the text color in a string is quite easy, so let’s start with that. In the following example, we will have some text shown in red, green and blue. Here’s how the tags work:&lt;br /&gt;
&lt;br /&gt;
 &amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI can format strings.[colour='FF00FF00']&lt;br /&gt;
 and this is just colour [colour='FF0000FF'] formatting!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In code, it looks like this:&lt;br /&gt;
&lt;br /&gt;
 CEGUI::Window* textComponent =  &lt;br /&gt;
 (CEGUI::Window*)CEGUI::WindowManager::getSingleton().getWindow(&amp;quot;generat0r/AboutDialog/StaticText&amp;quot;);&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI &lt;br /&gt;
 can format strings.[colour='FF00FF00'] and this is just colour [colour='FF0000FF'] formatting!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And that's how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A note:&lt;br /&gt;
* In case you have wondered why 4 sets of values are needed for each colour:  Red, for example, is described by [colour=’FFFF0000’] where the first ‘FF’ is the Alpha value (fully opaque in this case), the second is the value for the red component, the third for the green component and the fourth for the blue component, like in [AARRGGBB]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Font Formatting ===&lt;br /&gt;
Font formatting is a bit more involved as you need to have the actual fonts and the ‘font’ XML files defined for each style.&lt;br /&gt;
&lt;br /&gt;
Let’s assume you want to use the Arial font with the styles ‘normal’, ‘''italic''’, ‘'''bold'''’ and ‘'''''bold Italic'''''’. This actually requires you to have four different Arial fonts. For Arial, the fonts are called as follows:&lt;br /&gt;
&lt;br /&gt;
* Arial normal (arial.ttf)&lt;br /&gt;
* Arial bold (arialbd.ttf)&lt;br /&gt;
* Arial italic (ariali.ttf)&lt;br /&gt;
* Arial bold italic (arialbi.ttf)&lt;br /&gt;
&lt;br /&gt;
If you want to tinker around with them you can find these and some more in the font manager app of your OS (Arial ships with Windows, so you can get them from the OS). Note that Arial is copyrighted, so you might want to use a free font for your app (check out [http://www.dafont.com/ DaFont] for example).&lt;br /&gt;
&lt;br /&gt;
For each font, you will now have to create the according “.font” file that tells CEGUI how to use the font:&lt;br /&gt;
&lt;br /&gt;
* Arial-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-10&amp;quot; Filename=&amp;quot;arial.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot; &lt;br /&gt;
 AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Bold-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Bold-10&amp;quot; Filename=&amp;quot;arialbd.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Italic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Italic-10&amp;quot; Filename=&amp;quot;ariali.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-BoldItalic-10.font&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-BoldItalic-10&amp;quot; Filename=&amp;quot;arialbi.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don’t forget to add the font definitions into your scheme, like so:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;GUIScheme Name=&amp;quot;VanillaSkin&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;Imageset Filename=&amp;quot;Vanilla.imageset&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Bold-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Italic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-BoldItalic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-14.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;LookNFeel Filename=&amp;quot;Vanilla.looknfeel&amp;quot; /&amp;gt;&lt;br /&gt;
  …snip…&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;You can also do [font='Arial-Bold-10']bold text, [font='Arial-Italic-10']italic &lt;br /&gt;
 text, [font='Arial-BoldItalic-10']bold AND italic text.[font='Arial-10']!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Embedding Images ===&lt;br /&gt;
Embedding an image into text is quite easy. The required tag follows the general syntax. Consider the following tag:&lt;br /&gt;
&lt;br /&gt;
 [image=set:&amp;lt;imageset&amp;gt; image:&amp;lt;image&amp;gt;']&lt;br /&gt;
&lt;br /&gt;
What you need to do here is specify the imageset where the image is specified and identify the image to be used. Let’s assume you want to embed the MouseCursor of the TaharezLook imageset into the following text: “Nice, I can even embed images like this &amp;lt;mousepic here&amp;gt; into my text.”&lt;br /&gt;
&lt;br /&gt;
First you need to know the name of the imageset and the name of the image. Let’s have a look at “TaharezLook.imageset” for that purpose:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Imageset Name=&amp;quot;TaharezLook&amp;quot; Imagefile=&amp;quot;TaharezLook.tga&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot;  &lt;br /&gt;
 AutoScaled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;Image Name=&amp;quot;MouseArrow&amp;quot; XPos=&amp;quot;138&amp;quot; YPos=&amp;quot;127&amp;quot; Width=&amp;quot;31&amp;quot; Height=&amp;quot;25&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/Imageset&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the imageset is named “TaharezLook” and the wanted image is called “MouseArrow”. In code this would now look like follows:&lt;br /&gt;
&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image='set:TaharezLook image:MouseArrow'] &lt;br /&gt;
 into my text. &amp;quot;);&lt;br /&gt;
&lt;br /&gt;
And this is how it looks in my App:&lt;br /&gt;
&amp;lt;ADD SCREENSHOT&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note: The following tags have an effect on the way the image is drawn: ‘padding’, ‘alignment’ and ‘colour’.&lt;/div&gt;</summary>
		<author><name>Mboeni</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Tutorials&amp;diff=3436</id>
		<title>Tutorials</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Tutorials&amp;diff=3436"/>
				<updated>2010-09-24T13:05:49Z</updated>
		
		<summary type="html">&lt;p&gt;Mboeni: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== CrazyEddie's Beginner Guides ===&lt;br /&gt;
* [[The Beginner Guide to Getting CEGUI Rendering]] - How to initialise CEGUI to render properly.&lt;br /&gt;
* [[The Beginner Guide to Resource Groups]] - How to define resource group locations and specify default resource groups.&lt;br /&gt;
* [[The Beginner Guide to Loading Data Files and Initialisation]] - How to load some data files and perform basic system initialisation.&lt;br /&gt;
* [[The Beginner Guide to Creating a CEGUI Window]] - How to create a simple window and get it on screen.&lt;br /&gt;
* [[The Beginner Guide to Injecting Inputs]] - How to inject inputs into CEGUI and get interactive.&lt;br /&gt;
* [[HOWTO:_Use_the_Unified_Positions_and_Sizes_System|The Beginner Guide to the Unified Position and Size System (CEGUI &amp;gt;= 0.4.0)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Beyond The Basics ===&lt;br /&gt;
* [[Formatting Tags in CEGUI]] - How to format your text using tags.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scripting with CEGUI ===&lt;br /&gt;
* [[Getting Started with Lua and CEGUI]] - How to initialise CEGUI with a Lua script module and configuration file.&lt;br /&gt;
* [[Handling Events from Lua]] - How to load Lua script files and bind CEGUI events to Lua functions.&lt;br /&gt;
* [[Writing CEGUI scripts]] - Code snippets&lt;br /&gt;
* [[Adding LuaScriptModule to Sample_FirstWindow]] - Experience adding scripting to an existing sample.&lt;br /&gt;
* [http://www.gpwiki.org/index.php/Crazy_Eddies_GUI_System:Tutorials:Creating_a_scriptable_interface_using_CEGUI Creating a scriptable interface using CEGUI]&lt;br /&gt;
* [[Custom_ScriptingModule]] - Creating a basic custom scripting module in CEGUI&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Window System Examples ===&lt;br /&gt;
* [[Using CEGUI with SDL and OpenGL]] - Guidelines on how to get SDL, OpenGL and CEGUI running together.&lt;br /&gt;
* [[Using CEGUI with Producer and OpenGL]] - Guidelines on how to render and inject input to CEGUI from the Producer API.&lt;br /&gt;
* [http://artis.imag.fr/Membres/Xavier.Decoret/resources/CEGUI/ Using CEGUI with Qt/QGLViewer]&lt;br /&gt;
* [[Using CEGUI with GLUT]] - Some tips on using OpenGL's GLUT with CEGUI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Extending CEGUI ===&lt;br /&gt;
* [[Hit testing of non rectangular windows with CEGUI 0.7.x]] - Create a new window type that has pixel level hit testing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Skins - Tutorial For Artists ===&lt;br /&gt;
* [[Creating Skins]] - Extra notes for artists on how to create skins.&lt;br /&gt;
* [[The Beginners Guide to Falagard skinning - Part I]] - Learn by doing a Button.&lt;br /&gt;
* [[The Beginners Guide to Falagard skinning - Part II]] - More Falagard fun, this time with the Editbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Overviews ===&lt;br /&gt;
* [[Overview of GUI files]] - A quick introduction to all the XML files used by CEGUI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Miscellaneous HOW-TOs ===&lt;br /&gt;
* [[Create ImageButtons]] - A few different ways to create image buttons.&lt;br /&gt;
* [[Create a CheckListboxItem]] - Create a CheckListBoxItem that you can use with ItemListbox.&lt;br /&gt;
* [[Identifying Multiple Event Sources From A Single Callback]]&lt;br /&gt;
* [[Cool_window_effects]] - A collection of cool &amp;quot;special&amp;quot; effects on (frame)windows.&lt;/div&gt;</summary>
		<author><name>Mboeni</name></author>	</entry>

	</feed>