LMD VCL - MiniHTML

From LMD
Revision as of 13:12, 1 October 2007 by Bocharov (talk | contribs)

Jump to: navigation, search

<< Back to Getting started or Product Resources page

[edit]

Supported subset of HTML tags

LMD Tools 2007 Mini HTML supports following subset of HTML tags:

TagSyntaxComments & samples
Bold<b>, </b>bold
Italic<i>, </i>italic
Underline<u>, </u>underline
Strikeout<strikeout>, </strikeout> or <s>, </s>striked out
Paragraph<p [align="left|right|center"]>Use align parameter to specify the alignment of the text in the paragraph. Default value for align is "left".
Subscript<sub>, </sub>Subscript text is drawn with smaller font and with baseline moved down.
Superscript<sup>, </sup>Superscript text is drawn with smaller font and with baseline moved up.
Unordered list of elements<ul><li>item</li>...</ul>
  • item 1
  • item 2
Ordered list of elements<ol><li>item</li>...</ol>
  1. item 1
  2. item 2
Horizontal divider<hr [width="width"]>If no value for width attribute is specified, then it will take maximum available value.
Line break<br> 
Font<font [name="fontname"] [size="x|+x|-x"] [color={"#rrggbb"|"color name"}] [bgcolor={"#rrggbb"|"color name"}]>text</font> You can specify the name of the font, size (absolute size or increase, decrease of size),

font and font background color. Color must be a valid hexadecimal value in common HTML format or valid VCL color identifier (clWhite, clBtnFace for example) or valid HTML color identifier (red, black, btnshadow for example. You can use background synonym for bgcolor attribute.
Note: If size value is greater than 0 and less than 10 and there is no plus or minus sign, then it means standard font increase relative to default size. Example:
<font name="Arial" size=2>
<font name="Arial" size=3>
<font name="Arial" size=4>

Hyperlink<a href="link">link text</a>Link parameter value is passed to OnLinkClick event handler, present in some controls (not all controls support clicking on the URLs.
Embedded image<img src="image" [width="w"] [height="h"]>The src parameter value is passed to the OnImageNeeded event handler. You can specify the width and height of the image rectangle if needed. By default the width and height are taken from the image you provide in event handler, but you can stretch image on drawing by specifying width and height explicitly.

The simplest OnImageNeeded event handlers:

procedure TForm1.LMDHTMLLabel1ImageNeeded(Sender: TObject; SourceName: TLMDString; var Image: TPicture);
begin
  Image.LoadFromFile(SourceName);
end;

procedure TForm1.LMDHTMLLabel1ImageNeeded(Sender: TObject; SourceName: TLMDString; var Image: TPicture);
begin
  ImageList1.GetBitmap(strtoint(SourceName), Image.Bitmap);
end;


Supported special symbols

&Aacute Á &cent ¢ &Iacute Í &oacute ó &sup1 ¹
&aacute á &copy © &iacute í &Ocirc Ô &sup2 ²
&Acirc  &curren ¤ &Icirc Î &ocirc ô &sup3 ³
&acirc â &deg ° &icirc î &Ograve Ò &szlig ß
&acute ´ &divide ÷ &iexcl ¡ &ograve ò &THORN Þ
&AElig Æ &Eacute É &Igrave Ì &ordf ª &times ×
&aelig æ &eacute é &igrave ì &ordm º &trade
&Agrave À &Ecirc Ê &iquest ¿ &Oslash Ø &UacuteÚ
&agrave à &ecirc ê &Iuml Ï &oslash ø &uacuteú
&amp & &Egrave È &iuml ï &Otilde Õ &Ucirc Û
&Aring Å &egrave è &laquo « &otilde õ &UgraveÙ
&aring å &ETH Ð &lt < &Ouml Ö &ugraveù
&Atilde à &eth ð &macr ¯ &ouml ö &uml ¨
&atilde ã &Euml Ë &micro µ &para &Uuml Ü
&Auml Ä &euml ë &middot · &plusmn ± &YacuteÝ
&auml ä &euro &nbsp   &pound £ &yen ¥
&brvbar ¦ &frac12 ½ &not ¬ &quot "   
&Ccedil Ç &frac14 ¼ &Ntilde Ñ &raquo »   
&ccedil ç &frac34 ¾ &ntilde ñ &reg ®   
&cedil ¸ &gt > &Oacute Ó &sect §