See also:
Generally
Text formatting / hyperlinks / anchors
All formatting characters are enclosed in braces {...} - otherwise this may not occur in the text! In the clip area no spaces are allowed! The formatting applies only to the relevant paragraph and must be at the beginning of paragraph. Several details must be directly behind one another - in any order. Example:
RtfLabel1.Text = "{pts/1.5}{pi/1/0}{pri/1}Here follows the text. " |
The formatting instructions can be entered in abbreviated form or supplemented by any text after "/" and before added colon: (Example paragraph font size 150% of the standard font size)
{pts/1.5} | |
{pts/RelativeTextSize:1.5} | |
{pts/RelativníVelikostPísma:1.5} ' or whatever |
ParagraphTextSize: {pts/Value:1.5} - relative font size for the paragraph.
Value: | Number 0.1 to 2 |
ParagraphTextColor: {ptc/ColorId:1} - text color for the paragraph. ColorId is the color index.
ColorId: | Number 0 to 9 |
PragraphCenter: {pc} - paragraph text centered issue (not when image and text in a paragraph).
ParagraphDistanceTop: {pdt/Distance:0.5} - distance to the previous paragraph. Value relative to the default row height.
Distance: | Number 0.1 to 2 |
ParagraphRightIndent: {pri/IndentLevel:2} - right text indent.
IndentLevel: | Number 1 to 9 |
ParagraphIndent: {pi/IndentLevel:1/OnlyFirstLine:0} - left text indent.
IndentLevel: | Number 1 to 9 | |
OnlyFirstLine: | Number 0 or 1 |
ParagraphBulletIndent: {pbi/IndentLevel:2/MinWidth:x/OnlyFirstLine:0/BulletChars:1./CharsFormat:0/CharsColorId:0} - left text indent with bullets (any text).
IndentLevel: | Number 1 to 9 | |
MinWidth: | String used to calculate the minimum width of the last level | |
OnlyFirstLine: | Number 0 or 1 | |
BulletChars: | String | |
CharsFormat: | Number 0 to 3 | |
CharsColorId: | Number 0 to 9 (or -1 for default text color) |
ParagraphFrame: {pf/IndentLevel:1/RightIndentLevel:1/FrameColorId:2/BorderWidth:0.3} - colored area under the paragraph text.
IndentLevel: | Number 0 to 9 | |
RightIndentLevel: | Number 0 to 9 | |
FrameColorId: | Number 0 to 9 | |
BorderWidth: | Number 0 to 0.9 - value relative to the default row height |
ParagraphImage: {pimage/Name:ArrowLeft/Width:22/Height:22} - image
Name: | String - no case sensitive | |
Width / Height: | Numbers - values in pixels |
ParagraphEndContinuousText: {pect} - issue in image with flowing text, output this paragraph under the picture.
ParagraphTextSize: {pts/Value}
Relative font size for the paragraph (Value 0.1 to 2)
RtfLabel1.TextSize = 16 'Default font size | |
RtfLabel1.Text = "{pts/1.5}This paragraph text has the 1.5 times font size. " 'Font size: 16 * 1.5 = 24 |
ParagraphTextColor: {ptc/ColorId}
Text color for the paragraph. ColorId is the index of the label text assigned colors (like text formatting with {tc0}...):
RtfLabel1.TextColor = Colors.Black 'Default font color | |
RtfLabel1.SetTextColors(0, Colors.Red) 'Color for ColorId 0 | |
RtfLabel1.SetTextColors(1, Colors.Blue) 'Color for ColorId 1 | |
'... | |
RtfLabel1.Text = "{ptc/1}The paragraph text is displayed in blue color. " | |
![]() |
PragraphCenter: {pc}
Paragraph text centered issue (not when image and text in a paragraph).
RtfLabel1.Text = "{pc}The paragraph text is displayed centered." | |
![]() |
ParagraphDistanceTop: {pdt/Distance}
Distance to the previous paragraph. Distance relative to the default row height: (Value 0.1 to 2)
RtfLabel1.TextSize = 16 'Default font size | |
RtfLabel1.Text = "{pdt/0.5}The distance to the previous paragraph is 1/2 row height. " |
ParagraphRightIndent: {pri/IndentLevel}
Right text indent. The width of the text indent is generally defined:
RtfLabel1.IndentWidth = "XXX" 'Indent width per level - as wide as the string "XXX" in the set default font size | |
IndentLevel indicates by how much levels is indented: (Value 1 to 9) | |
RtfLabel1.Text = "{pri/2}The text right indent is 2 levels. " |
ParagraphIndent: {pi/IndentLevel/OnlyFirstLine}
Left text indent. IndentLevel like ParagraphRightIndent. With OnlyFirstLine indicates whether only the first line or all lines are indented in the paragraph. Examples:
RtfLabel1.Text = "{pi/1/0}This is a text indent with level = 1 and OnlyFirstLine = 0 - all lines are indented. " | |
![]() |
|
RtfLabel1.Text = "{pi/1/1}This is a text indent with level = 1 and OnlyFirstLine = 1 - only the first line is indented. " | |
![]() |
|
RtfLabel1.Text = "{pi/2/1}This is a text indent with level = 2 and OnlyFirstLine = 1 - only the first line is fully indented - the other rows one level further to the left. " | |
![]() |
The text of "BulletChars" is always output a level left of the text collection
ParagraphBulletIndent: {pbi/IndentLevel/MinWidth/OnlyFirstLine/BulletChars/CharsFormat/CharsColorId}
Left text indent with bulleted or any prefixed text.
IndentLevel - like PragraphRightIndent and ParagraphIndent (Value 1 to 9) | |
MinWidth - Text for the calculation of the minimum width of the last indent level. If the result is smaller than the result of RtfLabel1.IndentWidth, then IndentWidth is used (see example below). A sign must be given at least. | |
OnlyFirstLine - like ParagraphIndent | |
BulletChars - "●", "○", "1.)", "a" etc. - (no spaces!). Special cases: Instead of "●" Chr(9679) can be entered "(+)"; instead of "○" Chr(9675) can be entered "(-)". Space must be specified as "_". The text of BulletChars is always output a level left of the text indent - at IndentLevel=1 far left. | |
CharsFormat - 0=none | 1=bold | 2=italic | 3=bold and italic | |
CharsColorId - is the index of the label text assigned colors (like text formatting with {tc0}... and ParagraphTextColor) "-1" if the default font color or the font color used for the paragraph. | |
Examples: | |
RtfLabel.TextSize = 14 'Default font size | |
RtfLabel1.TextColor = Colors.Black 'Default font color | |
RtfLabel1.SetTextColors(0, Colors.Red) 'Color for ColorId 0 | |
RtfLabel1.SetTextColors(1, Colors.Blue) 'Color for ColorId 1 | |
RtfLabel1.SetTextColors(2, Colors.Magenta) 'Color for ColorId 2 | |
RtfLabel1.IndentWidth = "XXX" 'Indent width per level as wide as the string in the set default font size | |
Long writing style: (before ":" any text) | |
RtfLabel1.Text = "{pbi/Level:1/MinWidth:x/OnlyFirstLine:0/Chars:(+)/Format:0/ColorId:-1}Here follows the text with text indent. " | |
Short writing style: | |
RtfLabel1.Text = "{pbi/1/x/0/(+)/0/-1}Here follows the text with text indent. ..." | |
![]() |
|
RtfLabel1.Text = "{pbi/2/x/0/(-)/0/-1}Here follows the text with text indent. ..." | |
![]() |
|
RtfLabel1.Text = "{pbi/1/x/1/(+)/0/-1}Here follows the text with text indent. ..." | |
![]() |
|
RtfLabel1.Text = "{pbi/2/x/1/(-)/0/-1}Here follows the text with text indent. ..." | |
![]() |
|
RtfLabel1.Text = "{pbi/1/x/0/1.)/1/1}Here follows the text with text indent. ... " | |
![]() |
|
If the text of BulletChars in a paragraph is too wide, the minimum width for the last level can be set (without increasing the standard indent width). The widest word in an enumeration is given for calculating - here "Magenta" + distance "XX". | |
Text = "{pbi/2/MagentaXX/0/Magenta/1/2}Here is the text to the color {b}Magenta{b} and its meaning in life. " & CRLF & CRLF | |
Text = Text & "{pbi/2/MagentaXX/0/Blue/1/1}Here is the text to the color {b}Blue{b} and its meaning in life. " & CRLF & CRLF | |
RtfLabel1.Text = Text | |
![]() |
|
ParagraphFrame: {pf/IndentLevel/RightIndentLevel/FrameColorId/BorderWidth}
Colored area under the paragraph text. The height of the frame is determined by the total height of the paragraph text.
IndentLevel - like ParagraphIndent and PragraphRightIndent - regardless of the setting. | |
FrameColorId - is the index of the colors for frames: (Value 0 to 9) | |
RtfLabel1.SetFrameColors(0, Colors.Yellow) 'Color for FrameColorId 0 | |
RtfLabel1.SetFrameColors(1, Colors.LightGray) 'Color for FrameColorId 1 | |
'... | |
BorderWidth - additional border around the frame - Value 0 to 0.9 (relative to the default row height) | |
RtfLabel1.Text = "{pf/1/1/1/0.5}{pi/2/0}{pri/2}This is a text with frame, as a design element. " | |
![]() |
ParagraphImage: {pimage/Name/Width/Height}
Images can only stand at the beginning of a paragraph (also after other paragraph formatting tokens). Images in the text are not possible.
Name - is the name of the image (see at SetImages): | |
RtfLabel1.SetImages("ArrowL", LoadBitmap(File.DirAssets,"ArrowLeft.bmp")) | |
RtfLabel1.SetImages("ArrowR", LoadBitmap(File.DirAssets,"ArrowRight.bmp")) | |
or the file name in the folder "File.DirAssets" (distinctive mark is the "." in the Name). Case sensitive is ignored. | |
Width / Height - width and height in pixels(!) - not "dip" - is converted automatically. | |
RtfLabel1.Text = "{pimage/ArrowL/22/22}Here follows the text to the image..." | |
or: | |
RtfLabel1.Text = "{pimage/ArrowLeft.bmp/22/22}Here follows the text to the image..." | |
![]() |
|
The distance between image and text is set here: | |
RtfLabel1.ImagesBorder = 6dip 'Right and bottom edge | |
If images are centered, they must stand alone in the paragraph: | |
RtfLabel1.Text = "{pc}{pimage/ArrowL/22/22}{pimage/ArrowR/22/22}" & CRLF & "Here follows the text to the images ..." | |
![]() |
ParagraphEndContinuousText: {pect}
Floating text cancel - paragraph text below the image. Examples:
RtfLabel1.Text = "{pimage/ArrowLeft.bmp/22/22}My arrow!" & CRLF & "This text does not refer to the image. " | |
![]() |
|
Floating text cancel with {pect}: | |
RtfLabel1.Text = "{pimage/ArrowLeft.bmp/22/22}My arrow!" & CRLF & "{pect}This text does not refer to the image. " | |
![]() |
(to top)