1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
// ligne 1217 du source FMX.DZHTMLText.pas
const DEF_TOKENS: array[0..25+5] of TDefToken = (
(Ident: 'BR'; Kind: ttBreak; Single: True),
(Ident: 'B'; Kind: ttBold),
(Ident: 'I'; Kind: ttItalic),
(Ident: 'U'; Kind: ttUnderline),
(Ident: 'S'; Kind: ttStrike),
(Ident: 'FN'; Kind: ttFontName; AllowPar: True),
(Ident: 'FS'; Kind: ttFontSize; AllowPar: True; ProcValue: Tag_IntOneBased_ProcValue),
{$REGION 'Adding Headers Tags'}
(Ident: 'H0'; Kind: ttFontSize; AllowPar: False),
(Ident: 'H1'; Kind: ttFontSize; AllowPar: False),
(Ident: 'H2'; Kind: ttFontSize; AllowPar: False),
(Ident: 'H3'; Kind: ttFontSize; AllowPar: False),
(Ident: 'H4'; Kind: ttFontSize; AllowPar: False),
{$ENDREGION}
(Ident: 'FC'; Kind: ttFontColor; AllowPar: True; ProcValue: Tag_Color_ProcValue),
(Ident: 'BC'; Kind: ttBackColor; AllowPar: True; ProcValue: Tag_Color_ProcValue),
(Ident: 'A'; Kind: ttLink; AllowPar: True; OptionalPar: True),
(Ident: 'L'; Kind: ttAlignLeft),
(Ident: 'C'; Kind: ttAlignCenter),
(Ident: 'R'; Kind: ttAlignRight),
(Ident: 'T'; Kind: ttTab; Single: True; AllowPar: True; ProcValue: Tag_IntOneBased_ProcValue),
(Ident: 'TF'; Kind: ttTabF; Single: True; AllowPar: True; ProcValue: Tag_IntOneBased_ProcValue),
(Ident: 'IMG'; Kind: ttImage; Single: True; AllowPar: True; ProcValue: Tag_IntZeroBased_ProcValue),
(Ident: 'IMGRES'; Kind: ttImageResource; Single: True; AllowPar: True),
(Ident: 'UL'; Kind: ttBulletList), //Unordered HTML List
(Ident: 'OL'; Kind: ttNumberList), //Ordered HTML List
(Ident: 'LI'; Kind: ttListItem), //HTML List Item
(Ident: 'FLOAT'; Kind: ttFloat; AllowPar: True), //Floating div
(Ident: 'SPOILER'; Kind: ttSpoilerTitle; AllowPar: True),
(Ident: 'SDETAIL'; Kind: ttSpoilerDetail; AllowPar: True),
(Ident: 'LS'; Kind: ttLineSpace; AllowPar: True; ProcValue: Tag_IntZeroBased_ProcValue),
(Ident: 'SUP'; Kind: ttSuperscript),
(Ident: 'SUB'; Kind: ttSubscript)
);
function TBuilder.ProcessTag(const Tag: string): Boolean;
..
begin
...
// ligne 1312
{$REGION 'Compute Headers Tags'}
if A='H0' then value:=40;
if A='H1' then value:=32;
if A='H2' then value:=26;
if A='H3' then value:=22;
if A='H4' then value:=20;
{$ENDREGION}
AddToken(Def.Kind, TOff, Par, Value);
Result := True;
Exit;
end;
end;
end; |
Partager