├── .gitignore ├── CompInstall.ini ├── DzHTMLText.groupproj ├── Example ├── Example.dpr ├── Example.dproj ├── Example.res ├── UFrmExample.dfm ├── UFrmExample.pas └── about.png ├── LICENSE.md ├── LazDzHTMLText.lpk ├── LazDzHTMLText.pas ├── README.md ├── Source ├── Defines.inc ├── Design │ ├── DzHTMLText.dcr │ ├── DzHTMLText.lrs │ ├── DzHTMLTextDesign_FMX.dpk │ ├── DzHTMLTextDesign_FMX.dproj │ ├── DzHTMLTextDesign_FMX.res │ ├── DzHTMLTextDesign_VCL.dpk │ ├── DzHTMLTextDesign_VCL.dproj │ ├── DzHTMLTextDesign_VCL.res │ ├── FMX.DzHTMLTextReg.pas │ └── Vcl.DzHTMLTextReg.pas ├── DzHTMLText_FMX.dpk ├── DzHTMLText_FMX.dproj ├── DzHTMLText_FMX.res ├── DzHTMLText_VCL.dpk ├── DzHTMLText_VCL.dproj ├── DzHTMLText_VCL.res ├── FMX.DHCommon.pas ├── FMX.DHTokenEngine.pas ├── FMX.DzHTMLText.pas ├── Types.inc ├── Vcl.DHCommon.pas ├── Vcl.DHTokenEngine.pas └── Vcl.DzHTMLText.pas ├── Test ├── TestApp.dpr ├── TestApp.dproj ├── TestApp.res ├── UFrmMain.dfm └── UFrmMain.pas └── images ├── LazIcon.bmp ├── app_resources_dialog.png ├── div.png ├── preview.gif └── runtime_print.png /.gitignore: -------------------------------------------------------------------------------- 1 | *.~* 2 | *.identcache 3 | *.local 4 | lib/ 5 | backup/ 6 | **/Win32 7 | *.rc 8 | *.dres 9 | -------------------------------------------------------------------------------- /CompInstall.ini: -------------------------------------------------------------------------------- 1 | [Template] 2 | IniVersion=2 3 | 4 | [General] 5 | Name=Digao Dalpiaz - DzHTMLText component 6 | Version=6.8 7 | DelphiVersions=XE3;XE4;XE5;XE6;XE7;XE8;10;10.1;10.2;10.3;10.4;11;12 8 | Packages=DzHTMLText_VCL;DzHTMLText_FMX;DzHTMLTextDesign_VCL;DzHTMLTextDesign_FMX 9 | AddLibrary=1 10 | OutputPath=Lib\{PLATFORM}\{CONFIG} 11 | 12 | [P_DzHTMLText_VCL] 13 | Path=Source 14 | Allow64bit=1 15 | 16 | [P_DzHTMLText_FMX] 17 | Path=Source 18 | Allow64bit=1 19 | 20 | [P_DzHTMLTextDesign_VCL] 21 | Path=Source\Design 22 | Install=1 23 | 24 | [P_DzHTMLTextDesign_FMX] 25 | Path=Source\Design 26 | Install=1 27 | 28 | [GitHub] 29 | Repository=digao-dalpiaz/DzHTMLText 30 | -------------------------------------------------------------------------------- /DzHTMLText.groupproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {7B7BCD1A-B004-4D21-80FB-86256C40BA70} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | Default.Personality.12 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 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /Example/Example.dpr: -------------------------------------------------------------------------------- 1 | program Example; 2 | 3 | 4 | 5 | {$R *.dres} 6 | 7 | uses 8 | Vcl.Forms, 9 | UFrmExample in 'UFrmExample.pas' {Form1}; 10 | 11 | {$R *.res} 12 | 13 | begin 14 | Application.Initialize; 15 | Application.MainFormOnTaskbar := True; 16 | Application.CreateForm(TForm1, Form1); 17 | Application.Run; 18 | end. 19 | -------------------------------------------------------------------------------- /Example/Example.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digao-dalpiaz/DzHTMLText/79ce4d3998fc77b891cdacfe2c699208cb7bcad0/Example/Example.res -------------------------------------------------------------------------------- /Example/UFrmExample.dfm: -------------------------------------------------------------------------------- 1 | object Form1: TForm1 2 | Left = 0 3 | Top = 0 4 | BorderIcons = [biSystemMenu, biMinimize] 5 | BorderStyle = bsSingle 6 | Caption = 'DzHTMLText Example' 7 | ClientHeight = 320 8 | ClientWidth = 697 9 | Color = clBtnFace 10 | Font.Charset = DEFAULT_CHARSET 11 | Font.Color = clWindowText 12 | Font.Height = -11 13 | Font.Name = 'Tahoma' 14 | Font.Style = [] 15 | OnCreate = FormCreate 16 | TextHeight = 13 17 | object Lb: TDzHTMLText 18 | Left = 8 19 | Top = 8 20 | Width = 337 21 | Height = 273 22 | Font.Charset = ANSI_CHARSET 23 | Font.Color = clWindowText 24 | Font.Height = -13 25 | Font.Name = 'Segoe UI' 26 | Font.Style = [] 27 | Color = clWhite 28 | ParentColor = False 29 | ParentFont = False 30 | Lines.Strings = ( 31 | ' Welcome to my app!' 32 | '' 33 | 34 | 'This is an important text and this is italic text.' + 35 | '
But we have underline too, and strike-out if y' + 36 | 'ou want.

You can change the font name and the font size
The colors are' + 38 | ' allowed too! and images

Alignment, we have!
This is great' 40 | '' 41 | 'Click here to open Google.' 42 | 43 | 'This is an image from resource: Abo' + 44 | 'ut the program') 45 | Images = MyImages 46 | OnLinkClick = LbLinkClick 47 | OnRetrieveImgRes = LbRetrieveImgRes 48 | LineVertAlign = vaCenter 49 | end 50 | object Lb2: TDzHTMLText 51 | Left = 351 52 | Top = 8 53 | Width = 337 54 | Height = 274 55 | Font.Charset = ANSI_CHARSET 56 | Font.Color = clWindowText 57 | Font.Height = -13 58 | Font.Name = 'Segoe UI' 59 | Font.Style = [] 60 | Color = clWhite 61 | ParentColor = False 62 | ParentFont = False 63 | Lines.Strings = ( 64 | 'You can use divs too:' 65 | '' 66 | 67 | '1JOHN100,000' 70 | 71 | '2<' + 72 | 'div:width=200,lncolor=clGray,thick=1,thick_left=0,thick_top=0>SA' + 73 | 'RAH180,000' 75 | 76 | '3<' + 77 | 'div:width=200,lncolor=clGray,thick=1,thick_left=0,thick_top=0>ER' + 78 | 'IC1.150,000' 80 | '' 81 | 'HTML Lists:' 82 | '
    ' 83 | '
  • Item 1
  • ' 84 | '
  • Item 2
  • ' 85 | '
      ' 86 | '
    1. Sub item 1
    2. ' 87 | '
    3. Sub item 2
    4. ' 88 | '
        ' 89 | '
      1. Detail 2.1
      2. ' 90 | '
      3. Detail 2.2
      4. ' 91 | '
      ' 92 | '
    5. Sub item 3
    6. ' 93 | '
    ' 94 | '
  • Item 3
  • ' 95 | '
' 96 | 97 | 'This is a floating div are' + 98 | 'a, where you can write any text and even use tags!!!') 100 | LineVertAlign = vaCenter 101 | end 102 | object Lb3: TDzHTMLText 103 | Left = 8 104 | Top = 288 105 | Width = 681 106 | Height = 33 107 | Font.Charset = ANSI_CHARSET 108 | Font.Color = clWindowText 109 | Font.Height = -11 110 | Font.Name = 'Segoe UI' 111 | Font.Style = [fsItalic] 112 | ParentFont = False 113 | Lines.Strings = ( 114 | 115 | 'Please note that components above have White backgound' + 116 | ' only because I want to show the bounds, to understand line brea' + 117 | 'ks and alignments. Of course you can use parent backgound (defau' + 118 | 'lt), like this.') 119 | end 120 | object MyImages: TImageList 121 | Height = 24 122 | Width = 24 123 | Left = 240 124 | Top = 240 125 | Bitmap = { 126 | 494C010102000800040018001800FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 127 | 0000000000003600000028000000600000001800000001002000000000000024 128 | 000000000000000000000000000000000000D8C3B700AA6D4B00AA6D4B00AA6D 129 | 4B00AA6D4B00AA6D4B00B6ABAC009DCEFB009DCEFB009DCEFB009DCEFB009DCE 130 | FB009DCEFB009DCEFB009DCEFB009DCEFB009DCEFB009DCEFB009DCEFB00A2D0 131 | FA00D8E6F3000000000000000000000000000000000000000000000000000000 132 | 0000000000000000000000000000D5EBF30099DFFA0074D5FE0069D3FF0066D1 133 | FF0064D0FF0069D1FF0075D5FE009BE0FA000000000000000000000000000000 134 | 0000000000000000000000000000000000000000000000000000000000000000 135 | 0000000000000000000000000000000000000000000000000000000000000000 136 | 0000000000000000000000000000000000000000000000000000000000000000 137 | 0000000000000000000000000000000000000000000000000000000000000000 138 | 0000000000000000000000000000000000000000000000000000000000000000 139 | 0000000000000000000000000000000000000000000000000000000000000000 140 | 000000000000000000000000000000000000D8C3B700AA6D4B00917E73006998 141 | B20081888C00AA6D4B00B6ABAC009DCEFB009DCEFB009DCEFB009DCEFB009DCE 142 | FB009DCEFB009DCEFB009DCEFB009DCEFB009DCEFB009DCEFB009DCEFB009DCE 143 | FB00B8D9F7000000000000000000000000000000000000000000000000000000 144 | 0000000000000000000081D9FC0064D1FF0064D0FF0069D4FF0071D8FF0075DB 145 | FF0077DCFF0078DDFF0076DBFF0073DAFF006CD5FF0080D8FD00000000000000 146 | 0000000000000000000000000000000000000000000000000000000000000000 147 | 0000000000000000000000000000000000000000000000000000000000000000 148 | 0000000000000000000000000000000000000000000000000000000000000000 149 | 0000000000000000000000000000000000000000000000000000000000000000 150 | 0000000000000000000000000000000000000000000000000000000000000000 151 | 0000000000000000000000000000000000000000000000000000000000000000 152 | 000000000000000000000000000000000000D8C3B700A96D4C005BA2CA0052A8 153 | D80052A8D80099786600B6ABAC009DCEFB009DCEFB009DCEFB009DCEFB009DCE 154 | FB009DCEFB009DCEFB009DCEFB009DCEFB0094CAFA0094CAFA0094CAFA0096CB 155 | FA00D1E2F4000000000000000000000000000000000000000000000000000000 156 | 0000ADE4F80066D1FF0064D0FF006DD6FF0079DEFF007DE0FF007DE0FF007DE0 157 | FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007CE0FF0077DAFF00B4E5 158 | F700000000000000000000000000000000000000000000000000000000000000 159 | 0000000000000000000000000000000000000000000000000000000000000000 160 | 0000000000000000000000000000000000000000000000000000000000000000 161 | 0000000000000000000000000000000000000000000000000000000000000000 162 | 0000000000000000000000000000000000000000000000000000000000000000 163 | 0000000000000000000000000000000000000000000000000000000000000000 164 | 000000000000000000000000000000000000D8C3B700AA6D4B00649CBB0052A8 165 | D80054A7D500A2735800B6ABAC009DCEFB009DCEFB009DCEFB009DCEFB009DCE 166 | FB009DCEFB009DCEFB009DCEFB0096CBFB0073BCF80073BCF80073BCF80083C2 167 | F9009CCDF600DBE7F200000000000000000000000000000000000000000097DE 168 | FA0064D0FF0066D2FF0077DCFF007DE0FF007DE0FF007BCAF40077A4E6008098 169 | EA008098EA0077A4E6007BCAF4007DE0FF007DE0FF007DE0FF007DE0FF007CDF 170 | FF00B4E6F7000000000000000000000000000000000000000000000000000000 171 | 0000000000000000000000000000000000000000000000000000000000000000 172 | 0000000000000000000000000000000000000000000000000000000000000000 173 | 0000000000000000000000000000000000000000000000000000000000000000 174 | 0000000000000000000000000000000000000000000000000000000000000000 175 | 0000000000000000000000000000000000000000000000000000000000000000 176 | 000000000000000000000000000000000000D8C3B700AA6D4B00A17359008288 177 | 8B0098796800AA6D4B00B6ABAC009DCEFB009DCEFB009DCEFB009DCEFB009DCE 178 | FB009DCEFB009DCEFB009DCEFB009DCEFB009DCEFB009DCEFB009DCEFB009DCE 179 | FB009DCEFB00A9D3F90000000000000000000000000000000000AFE2F80064D0 180 | FF0069D3FF007ADEFF007DE0FF0076C6E9007B84E500807AF9007971F100867F 181 | F800867FF8007971F100807AF9007A83E50076C6E9007DE0FF007DE0FF007DE0 182 | FF007EE0FF00CEEBF50000000000000000000000000000000000000000000000 183 | 0000000000000000000000000000000000000000000000000000000000000000 184 | 0000000000000000000000000000000000000000000000000000000000000000 185 | 0000000000000000000000000000000000000000000000000000000000000000 186 | 0000000000000000000000000000000000000000000000000000000000000000 187 | 0000000000000000000000000000000000000000000000000000000000000000 188 | 000000000000000000000000000000000000D8C3B700AA6D4B00AA6D4B00AA6D 189 | 4B00AA6D4B00AA6D4B00B6ABAC009DCEFB009DCEFB009DCEFB009DCEFB009DCE 190 | FB009DCEFB009DCEFB009DCEFB009DCEFB009DCEFB009DCEFB009DCEFB009DCE 191 | FB009DCEFB00A9D3F900000000000000000000000000D7EBF30066D1FF0066D2 192 | FF007ADEFF007DE0FF006DA9CE005C6C98006B6EC5006F64E5006E64E500766E 193 | EB00766DEB006E64E5006F64E5006B6EC5005C6C98006EAACF007DE0FF007DE0 194 | FF007DE0FF0083E1FE0000000000000000000000000000000000000000000000 195 | 0000000000000000000000000000000000000000000000000000000000000000 196 | 0000000000000000000000000000000000000000000000000000000000000000 197 | 0000000000000000000000000000000000000000000000000000000000000000 198 | 0000000000000000000000000000000000000000000000000000000000000000 199 | 0000000000000000000000000000000000000000000000000000000000000000 200 | 000000000000000000000000000000000000D8C3B700AA6D4B00AA6D4B00AA6D 201 | 4B00AA6D4B00AA6D4B00B6ABAC009DCEFB009DCEFB009DCEFB009DCEFB009DCE 202 | FB009DCEFB009DCEFB009DCEFB009DCEFB0090C8FA0073BCF80073BCF80073BC 203 | F8007BBFF700AAD3F5000000000000000000000000007FD8FD0064D0FF0078DD 204 | FF007DE0FF006DA9CE005B6A96005B6A96005B6A9600666DB800716AE3007066 205 | E6007066E600716AE200666DB8005B6A96005B6A96005B6A96006EAACF007DE0 206 | FF007DE0FF007DE0FF00ACE7F900000000000000000000000000000000000000 207 | 0000000000000000000000000000000000000000000000000000000000000000 208 | 0000000000000000000000000000000000000000000000000000000000000000 209 | 0000000000000000000000000000000000000000000000000000000000000000 210 | 0000000000000000000000000000000000000000000000000000000000000000 211 | 0000000000000000000000000000000000000000000000000000000000000000 212 | 000000000000000000000000000000000000D8C3B700AA6D4B00AA6D4B00AA6D 213 | 4B00AA6D4B00AA6D4B00B6ABAC009DCEFB009DCEFB009DCEFB009DCEFB009DCE 214 | FB009DCEFB009DCEFB009DCEFB009DCEFB009CCEFB0094CAFA0094CAFA0094CA 215 | FA0094CAFA0094CAFA00A0CFF80000000000D3EAF30064D1FF006DD6FF007DE0 216 | FF0076C7E9005C6C98005B6A96005B6A96005B6A96005B6A96005B6A96005B6A 217 | 96005B6A96005B6A96005B6A96005B6A96005B6A96005B6A96005C6C980076C7 218 | E9007DE0FF007DE0FF007FE0FF00000000000000000000000000000000000000 219 | 0000000000000000000000000000000000000000000000000000000000000000 220 | 0000000000000000000000000000000000000000000000000000000000000000 221 | 0000000000000000000000000000000000000000000000000000000000000000 222 | 0000000000000000000000000000000000000000000000000000000000000000 223 | 0000000000000000000000000000000000000000000000000000000000000000 224 | 000000000000000000000000000000000000D8C3B700AA6D4B00AA6D4B00AA6D 225 | 4B00AA6D4B00AA6D4B00B6ABAC009DCEFB009DCEFB009DCEFB009DCEFB009DCE 226 | FB009DCEFB009DCEFB009DCEFB009DCEFB009DCEFB009DCEFB009DCEFB009DCE 227 | FB009DCEFB009DCEFB009DCEFB00DCE7F20099DFFA0064D0FF0079DEFF007DE0 228 | FF00648AB2005B6A960062759E00687BA400687BA400687BA400687BA400687B 229 | A400687BA400687BA400687BA400687BA400687BA40062759E005B6A9600648A 230 | B2007DE0FF007DE0FF007DE0FF00C0E9F6000000000000000000000000000000 231 | 0000000000000000000000000000000000000000000000000000000000000000 232 | 0000000000000000000000000000000000000000000000000000000000000000 233 | 0000000000000000000000000000000000000000000000000000000000000000 234 | 0000000000000000000000000000000000000000000000000000000000000000 235 | 0000000000000000000000000000000000000000000000000000000000000000 236 | 000000000000000000000000000000000000D8C3B700AA6D4B00AA6D4B00AA6D 237 | 4B00AA6D4B00AA6D4B00B6ABAC009DCEFB009DCEFB009DCEFB009DCEFB009DCE 238 | FB009DCEFB009DCEFB009DCEFB009DCEFB009ACDFB008DC7FA008DC7FA008DC7 239 | FA008DC7FA008DC7F900ADD5F7000000000074D5FE0069D3FF007DE0FF0079D3 240 | F3005B6B96007186AC00FBFEFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF 241 | FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FBFEFF007186AC005B6B 242 | 960079D3F3007DE0FF007DE0FF009EE5FB000000000000000000000000000000 243 | 0000000000000000000000000000000000000000000000000000000000000000 244 | 0000000000000000000000000000000000000000000000000000000000000000 245 | 0000000000000000000000000000000000000000000000000000000000000000 246 | 0000000000000000000000000000000000000000000000000000000000000000 247 | 0000000000000000000000000000000000000000000000000000000000000000 248 | 000000000000000000000000000000000000D8C3B700AA6D4B00AA6D4B00AA6D 249 | 4B00AA6D4B00AA6D4B00B6ABAC009DCEFB009DCEFB009DCEFB009DCEFB009DCE 250 | FB009DCEFB009DCEFB009DCEFB009DCEFB0093C9FA007CC0F9007CC0F9007CC0 251 | F9007EC0F80094C9F700DBE8F200000000006AD3FF0071D8FF007DE0FF006A9F 252 | C30053547A008993AE00DAF6FF00DAF6FF00DAF6FF00DAF6FF00DAF6FF00DAF6 253 | FF00DAF6FF00DAF6FF00DAF6FF00DAF6FF00DAF6FF00DAF6FF008993AE005354 254 | 7A006A9FC3007DE0FF007DE0FF008FE3FD000000000000000000000000000000 255 | 0000000000000000000000000000000000000000000000000000000000000000 256 | 0000000000000000000000000000000000000000000000000000000000000000 257 | 0000000000000000000000000000000000000000000000000000000000000000 258 | 0000000000000000000000000000000000000000000000000000000000000000 259 | 0000000000000000000000000000000000000000000000000000000000000000 260 | 000000000000000000000000000000000000D8C3B700AA6D4B00AA6D4B00AA6D 261 | 4B00AA6D4B00AA6D4B00B6ABAC009DCEFB009DCEFB009DCEFB009DCEFB009DCE 262 | FB009DCEFB009DCEFB009DCEFB009DCEFB009DCEFB009DCEFB009DCEFB009DCE 263 | FB009DCEFB009DCEFB00AFD6F8000000000066D1FF0075DBFF007DE0FF007DDE 264 | FE0070B4D6007CBFDE00A6EAFF00A6EAFF00A6EAFF00A6EAFF00A6EAFF00A6EA 265 | FF00A6EAFF00A6EAFF00A6EAFF00A6EAFF00A6EAFF00A6EAFF007CBFDE0070B4 266 | D6007DDEFE007DE0FF007DE0FF0083E1FE000000000000000000000000000000 267 | 0000000000000000000000000000000000000000000000000000000000000000 268 | 0000000000000000000000000000000000000000000000000000000000000000 269 | 0000000000000000000000000000000000000000000000000000000000000000 270 | 0000000000000000000000000000000000000000000000000000000000000000 271 | 0000000000000000000000000000000000000000000000000000000000000000 272 | 000000000000000000000000000000000000D8C3B700AA6D4B00AA6D4B00AA6D 273 | 4B00AA6D4B00AA6D4B00B6ABAC009DCEFB009DCEFB009DCEFB009DCEFB009DCE 274 | FB009DCEFB009DCEFB009DCEFB009DCEFB009DCEFB009DCEFB009DCEFB009DCE 275 | FB009DCEFB009DCEFB00B8D9F7000000000066D1FF0078DCFF007DE0FF007DE0 276 | FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0 277 | FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0 278 | FF007DE0FF007DE0FF007DE0FF0082E1FE000000000000000000000000000000 279 | 0000000000000000000000000000000000000000000000000000000000000000 280 | 0000000000000000000000000000000000000000000000000000000000000000 281 | 0000000000000000000000000000000000000000000000000000000000000000 282 | 0000000000000000000000000000000000000000000000000000000000000000 283 | 0000000000000000000000000000000000000000000000000000000000000000 284 | 000000000000000000000000000000000000D8C3B700AA6D4B00AA6D4B00AA6D 285 | 4B00AA6D4B00AA6D4B00BBA49A00BFDBF700A6D1F9009DCEFB009DCEFB009DCE 286 | FB009DCEFB009DCEFB00ACD4F800C1DCF600C1DCF600C1DCF600C1DCF600C1DC 287 | F600C1DCF600CBE1F40000000000000000006AD4FF0078DDFF007DE0FF007DE0 288 | FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0 289 | FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0 290 | FF007DE0FF007DE0FF007DE0FF008FE2FD000000000000000000000000000000 291 | 0000000000000000000000000000000000000000000000000000000000000000 292 | 0000000000000000000000000000000000000000000000000000000000000000 293 | 0000000000000000000000000000000000000000000000000000000000000000 294 | 0000000000000000000000000000000000000000000000000000000000000000 295 | 0000000000000000000000000000000000000000000000000000000000000000 296 | 000000000000000000000000000000000000E5DCD700D1B6A700D1B6A700D1B6 297 | A700D1B6A700D1B6A700DCCAC0000000000000000000B3D7F8009DCEFB009DCE 298 | FB009DCEFB009DCEFB00B4D7F700000000000000000000000000000000000000 299 | 00000000000000000000000000000000000075D5FE0076DCFF007DE0FF007DE0 300 | FF007BDAF9007AD6F6007DE0FF007DE0FF0079D3F3007CDCFB007DE0FF007DE0 301 | FF007DE0FF007DE0FF007BDAFA007AD4F5007DE0FF007DE0FF0079D4F4007CDB 302 | FA007DE0FF007DE0FF007DE0FF009EE5FB000000000000000000000000000000 303 | 0000000000000000000000000000000000000000000000000000000000000000 304 | 0000000000000000000000000000000000000000000000000000000000000000 305 | 0000000000000000000000000000000000000000000000000000000000000000 306 | 0000000000000000000000000000000000000000000000000000000000000000 307 | 0000000000000000000000000000000000000000000000000000000000000000 308 | 0000000000000000000000000000000000000000000000000000000000000000 309 | 00000000000000000000000000000000000000000000E4EBF1009FCEFA009DCE 310 | FB009DCEFB009DCEFB00A4D1FA00000000000000000000000000000000000000 311 | 00000000000000000000000000000000000098DEFA0073DAFF007DE0FF007DE0 312 | FF0078CFEF006386AF0074C3E50074C1E3006283AC007AD4F5007DE0FF007DE0 313 | FF007DE0FF007DE0FF0079D1F1006384AD0075C3E50075C1E4006284AD0079D3 314 | F3007DE0FF007DE0FF007DE0FF00BFE9F6000000000000000000000000000000 315 | 0000000000000000000000000000000000000000000000000000000000000000 316 | 0000000000000000000000000000000000000000000000000000000000000000 317 | 0000000000000000000000000000000000000000000000000000000000000000 318 | 0000000000000000000000000000000000000000000000000000000000000000 319 | 0000000000000000000000000000000000000000000000000000000000000000 320 | 0000000000000000000000000000000000000000000000000000000000000000 321 | 0000000000000000000000000000000000000000000000000000BCDBF7009DCE 322 | FB009DCEFB009DCEFB00A1CFFA00000000000000000000000000000000000000 323 | 000000000000000000000000000000000000D7ECF3006DD6FF007DE0FF007DE0 324 | FF007DE0FF0076C7E900699CC200699EC40077CBEC007DE0FF007DE0FF007DE0 325 | FF007DE0FF007DE0FF007DE0FF0076C8EA00699DC3006A9DC30076CAEB007DE0 326 | FF007DE0FF007DE0FF007EE0FF00000000000000000000000000000000000000 327 | 0000000000000000000000000000000000000000000000000000000000000000 328 | 0000000000000000000000000000000000000000000000000000000000000000 329 | 0000000000000000000000000000000000000000000000000000000000000000 330 | 0000000000000000000000000000000000000000000000000000000000000000 331 | 0000000000000000000000000000000000000000000000000000000000000000 332 | 0000000000000000000000000000000000000000000000000000000000000000 333 | 0000000000000000000000000000000000000000000000000000CAE0F5009DCE 334 | FB009DCEFB009DCEFB00A0CFFA00000000000000000000000000000000000000 335 | 0000000000000000000000000000000000000000000082D9FD007CDFFF007DE0 336 | FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0 337 | FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0 338 | FF007DE0FF007DE0FF00AAE6F900000000000000000000000000000000000000 339 | 0000000000000000000000000000000000000000000000000000000000000000 340 | 0000000000000000000000000000000000000000000000000000000000000000 341 | 0000000000000000000000000000000000000000000000000000000000000000 342 | 0000000000000000000000000000000000000000000000000000000000000000 343 | 0000000000000000000000000000000000000000000000000000000000000000 344 | 0000000000000000000000000000000000000000000000000000000000000000 345 | 0000000000000000000000000000000000000000000000000000D5E4F3009DCE 346 | FB009DCEFB009DCEFB009FCEFA00000000000000000000000000000000000000 347 | 000000000000000000000000000000000000000000000000000076DAFF007DE0 348 | FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0 349 | FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0 350 | FF007DE0FF0083E1FE0000000000000000000000000000000000000000000000 351 | 0000000000000000000000000000000000000000000000000000000000000000 352 | 0000000000000000000000000000000000000000000000000000000000000000 353 | 0000000000000000000000000000000000000000000000000000000000000000 354 | 0000000000000000000000000000000000000000000000000000000000000000 355 | 0000000000000000000000000000000000000000000000000000000000000000 356 | 0000000000000000000000000000000000000000000000000000000000000000 357 | 0000000000000000000000000000000000000000000000000000E0E9F1009DCE 358 | FB009DCEFB009DCEFB009ECEFA00000000000000000000000000000000000000 359 | 0000000000000000000000000000000000000000000000000000B1E3F7007CDE 360 | FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0 361 | FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0 362 | FF007EE0FF00CDECF50000000000000000000000000000000000000000000000 363 | 0000000000000000000000000000000000000000000000000000000000000000 364 | 0000000000000000000000000000000000000000000000000000000000000000 365 | 0000000000000000000000000000000000000000000000000000000000000000 366 | 0000000000000000000000000000000000000000000000000000000000000000 367 | 0000000000000000000000000000000000000000000000000000000000000000 368 | 0000000000000000000000000000000000000000000000000000000000000000 369 | 0000000000000000000000000000000000000000000000000000000000009DCE 370 | FB009DCEFB009DCEFB00AAD3F900000000000000000000000000000000000000 371 | 000000000000000000000000000000000000000000000000000000000000B4E7 372 | F7007EE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0 373 | FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007EE0 374 | FF00BEEAF6000000000000000000000000000000000000000000000000000000 375 | 0000000000000000000000000000000000000000000000000000000000000000 376 | 0000000000000000000000000000000000000000000000000000000000000000 377 | 0000000000000000000000000000000000000000000000000000000000000000 378 | 0000000000000000000000000000000000000000000000000000000000000000 379 | 0000000000000000000000000000000000000000000000000000000000000000 380 | 0000000000000000000000000000000000000000000000000000000000000000 381 | 000000000000000000000000000000000000000000000000000000000000A7D2 382 | F8009DCEFB009DCEFB00D0E3F300000000000000000000000000000000000000 383 | 0000000000000000000000000000000000000000000000000000000000000000 384 | 0000CCEBF50082E1FE007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0 385 | FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF007DE0FF0083E1FE00CDEC 386 | F500000000000000000000000000000000000000000000000000000000000000 387 | 0000000000000000000000000000000000000000000000000000000000000000 388 | 0000000000000000000000000000000000000000000000000000000000000000 389 | 0000000000000000000000000000000000000000000000000000000000000000 390 | 0000000000000000000000000000000000000000000000000000000000000000 391 | 0000000000000000000000000000000000000000000000000000000000000000 392 | 0000000000000000000000000000000000000000000000000000000000000000 393 | 000000000000000000000000000000000000000000000000000000000000CFE3 394 | F300A7D2FA00CDE1F40000000000000000000000000000000000000000000000 395 | 0000000000000000000000000000000000000000000000000000000000000000 396 | 00000000000000000000ABE6F9007EE0FF007DE0FF007DE0FF007DE0FF007DE0 397 | FF007DE0FF007DE0FF007DE0FF007DE0FF007EE0FF00A3E5FA00000000000000 398 | 0000000000000000000000000000000000000000000000000000000000000000 399 | 0000000000000000000000000000000000000000000000000000000000000000 400 | 0000000000000000000000000000000000000000000000000000000000000000 401 | 0000000000000000000000000000000000000000000000000000000000000000 402 | 0000000000000000000000000000000000000000000000000000000000000000 403 | 0000000000000000000000000000000000000000000000000000000000000000 404 | 0000000000000000000000000000000000000000000000000000000000000000 405 | 0000000000000000000000000000000000000000000000000000000000000000 406 | 0000000000000000000000000000000000000000000000000000000000000000 407 | 0000000000000000000000000000000000000000000000000000000000000000 408 | 000000000000000000000000000000000000BEEAF6009DE5FB008FE2FD0082E1 409 | FE0082E1FE008FE2FD009DE5FB00BFE9F6000000000000000000000000000000 410 | 0000000000000000000000000000000000000000000000000000000000000000 411 | 0000000000000000000000000000000000000000000000000000000000000000 412 | 0000000000000000000000000000000000000000000000000000000000000000 413 | 0000000000000000000000000000000000000000000000000000000000000000 414 | 0000000000000000000000000000000000000000000000000000000000000000 415 | 0000000000000000000000000000000000000000000000000000000000000000 416 | 000000000000000000000000000000000000424D3E000000000000003E000000 417 | 2800000060000000180000000100010000000000200100000000000000000000 418 | 000000000000000000000000FFFFFF00000007FE00FF000000000000000007FC 419 | 003F000000000000000007F0000F000000000000000003E00007000000000000 420 | 000003C000030000000000000000038000030000000000000000038000010000 421 | 0000000000000100000100000000000000000000000000000000000000000100 422 | 0000000000000000000001000000000000000000000001000000000000000000 423 | 0000010000000000000000000000030000000000000000000181FF0000000000 424 | 00000000FF81FF000000000000000000FFC1FF000001000000000000FFC1FF80 425 | 0001000000000000FFC1FFC00003000000000000FFC1FFC00003000000000000 426 | FFE1FFE00007000000000000FFE1FFF0000F000000000000FFE3FFFC003F0000 427 | 00000000FFFFFFFF00FF00000000000000000000000000000000000000000000 428 | 000000000000} 429 | end 430 | end 431 | -------------------------------------------------------------------------------- /Example/UFrmExample.pas: -------------------------------------------------------------------------------- 1 | unit UFrmExample; 2 | 3 | interface 4 | 5 | uses Vcl.Forms, Vcl.ImgList, Vcl.Controls, System.Classes, System.ImageList, 6 | Vcl.DzHTMLText, Vcl.Graphics; 7 | 8 | type 9 | TForm1 = class(TForm) 10 | Lb: TDzHTMLText; 11 | MyImages: TImageList; 12 | Lb2: TDzHTMLText; 13 | Lb3: TDzHTMLText; 14 | procedure FormCreate(Sender: TObject); 15 | procedure LbRetrieveImgRes(Sender: TObject; const ResourceName: string; 16 | Picture: TPicture; var Handled: Boolean); 17 | procedure LbLinkClick(Sender: TObject; Link: TDHBaseLink; 18 | var Handled: Boolean); 19 | end; 20 | 21 | var 22 | Form1: TForm1; 23 | 24 | implementation 25 | 26 | {$R *.dfm} 27 | 28 | uses Vcl.Dialogs; 29 | 30 | procedure TForm1.FormCreate(Sender: TObject); 31 | begin 32 | ReportMemoryLeaksOnShutdown := True; 33 | end; 34 | 35 | procedure TForm1.LbLinkClick(Sender: TObject; Link: TDHBaseLink; 36 | var Handled: Boolean); 37 | begin 38 | if Link.LinkRef.Target='INFO_ABOUT' then 39 | begin 40 | ShowMessage('This is the example app.'); 41 | Handled := True; 42 | end; 43 | end; 44 | 45 | procedure TForm1.LbRetrieveImgRes(Sender: TObject; const ResourceName: string; 46 | Picture: TPicture; var Handled: Boolean); 47 | begin 48 | if ResourceName='LOGO' then 49 | begin 50 | //Load image by myself 51 | Picture.Assign(Application.Icon); 52 | 53 | Handled := True; //tell the component to NOT load resource automatically 54 | end; 55 | end; 56 | 57 | end. 58 | -------------------------------------------------------------------------------- /Example/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digao-dalpiaz/DzHTMLText/79ce4d3998fc77b891cdacfe2c699208cb7bcad0/Example/about.png -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digao-dalpiaz/DzHTMLText/79ce4d3998fc77b891cdacfe2c699208cb7bcad0/LICENSE.md -------------------------------------------------------------------------------- /LazDzHTMLText.lpk: -------------------------------------------------------------------------------- 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 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /LazDzHTMLText.pas: -------------------------------------------------------------------------------- 1 | { This file was automatically created by Lazarus. Do not edit! 2 | This source is only used to compile and install the package. 3 | } 4 | 5 | unit LazDzHTMLText; 6 | 7 | {$warn 5023 off : no warning about unused units} 8 | interface 9 | 10 | uses 11 | Vcl.DzHTMLText, Vcl.DHCommon, Vcl.DHTokenEngine, Vcl.DzHTMLTextReg, 12 | LazarusPackageIntf; 13 | 14 | implementation 15 | 16 | procedure Register; 17 | begin 18 | RegisterUnit('Vcl.DzHTMLTextReg', @Vcl.DzHTMLTextReg.Register); 19 | end; 20 | 21 | initialization 22 | RegisterPackage('LazDzHTMLText', @Register); 23 | end. 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | :newspaper: [Digao Dalpiaz News on Telegram](https://t.me/digaodalpiaznews) 2 | 3 | [![YouTube](https://img.youtube.com/vi/rDRJqccQlkw/0.jpg)](https://www.youtube.com/watch?v=rDRJqccQlkw) 4 | 5 | *Brazilian Portuguese video. Please select automatic translations on YouTube video options.* 6 | 7 | # DzHTMLText 8 | ## Delphi and Lazarus HTML Label component 9 | 10 | ![Delphi Supported Versions](https://img.shields.io/badge/Delphi%20Supported%20Versions-XE3..12-blue.svg) 11 | ![Platforms](https://img.shields.io/badge/Platforms-Win32,Win64,Android,iOS,Mac,Linux-red.svg) 12 | ![Auto Install](https://img.shields.io/badge/-Auto%20Install%20App-orange.svg) 13 | ![VCL and FMX](https://img.shields.io/badge/-VCL%20and%20FMX-lightgrey.svg) 14 | ![Lazarus support](https://img.shields.io/badge/-Lazarus%20support-green.svg) 15 | ![CJK line break](https://img.shields.io/badge/-Chinese+Japanese+Korean%20line%20break%20support-yellowgreen.svg) 16 | ![RTL notation](https://img.shields.io/badge/-RTL%20notation-purple.svg) 17 | 18 | [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/C0C53LVFN) 19 | 20 | - [What's New](#whats-new) 21 | - [Component Description](#component-description) 22 | - [Available tags](#available-tags) 23 | - [Installing](#installing) 24 | - [Component Properties](#component-properties) 25 | - [Events](#events) 26 | - [Procedures/Functions](#proceduresfunctions) 27 | - [Link Reference Tag](#link-reference-tag) 28 | - [Spoiler Tag](#spoiler-tag) 29 | - [Link object](#link-object) 30 | - [Image Tag](#image-tag) 31 | - [Div Tag](#div-tag) 32 | - [Tab Tag](#tab-tag) 33 | - [Literal tag character](#literal-tag-character) 34 | - [Chinese/Japanese/Korean line break](#chinesejapanesekorean-line-break) 35 | - [Auto Scaling](#auto-scaling) 36 | - [Color Notation](#color-notation) 37 | - [Formatted Message Dialog Component](#formatted-message-dialog-component) 38 | - [Donate](#donate) 39 | 40 | ## What's New 41 | 42 | - 03/15/2025 (Version 6.8) 43 | 44 | - Right-to-left (RTL) text supporting. 45 | - When using a Div without "keep properties" (default), now Horizontal Text Alignment get the same value as component pre-defined Horizontal Alignment. 46 | 47 |
48 | Click here to view the entire changelog 49 | 50 | - 01/26/2025 (Version 6.7) 51 | 52 | - Fixed Lazarus compiling (GDI+ units) 53 | 54 | - 11/14/2024 (Version 6.6) 55 | 56 | - Use GDI painting from Windows API when using VCL + Windows to draw rounded div 57 | - Fix access violation when DPI Scaling in VCL (early access to TForm.Monitor) 58 | 59 | - 10/14/2024 (Version 6.5) 60 | 61 | - New Corner Radius ("radius") property for Div tag 62 | 63 | - 03/26/2024 (Version 6.4) 64 | 65 | - Fix Delphi XE3 compiling (Design packages and FMX FillRect) 66 | 67 | - 03/25/2024 (Version 6.3) 68 | 69 | - VCL font scaling review (Height is calculated by default screen PPI) 70 | 71 | - 03/24/2024 (Version 6.2) 72 | 73 | - Better FMX design-time border (using the Delphi pattern). 74 | - Keep Canvas properties state in FMX (font changes and other Canvas properties were retained and could affect the painting of other controls on the form) 75 | 76 | - 02/26/2024 (Version 6.1) 77 | 78 | - Opacity supporting in FMX environment. 79 | 80 | - 02/23/2024 (Version 6.0) 81 | 82 | - New Design packages (build all packages and install only design packages). *The old packages were transformed into Runtime-only packages, so if you already had the component installed previously, you may receive an error message in Delphi saying that the package cannot be installed as it is Runtime-only. You can ignore this message, as the package will not be installed and will no longer be loaded at Designtime.* 83 | - New Syntax Errors list (right click on component in design mode and choose "Show Syntax Errors"). The component border will appear red when syntax errors. 84 | - Fixed word bounds size calculation for some platforms in FMX environment, like Android. The component was using MeasureCanvas to calculate bounds before canvas becomes available. Some platforms return wrong size (smaller) when using generic MeasureCanvas. Now we are using original Canvas, building tokens when Canvas becomes available. **This fix resolves the issue of characters cut in half at the end of the word.** 85 | - Fixed Tab margin on first line and Tab x Line Item x Paragraph Indent margin overload. 86 | - Reintroduced `` tag (as obsolete tag). 87 | 88 | - 02/20/2024 (Version 5.3) 89 | 90 | - Reorganization of component folders (Please completely delete the previous component folder). **WARNING! DCU output folder changed. Now output directory is `Lib\{Platform}\{Config}`. Please review your Library Paths.** 91 | - Auto-install now supports Delphi 12. 92 | 93 | - 01/21/2024 (Version 5.2) 94 | 95 | - Fixed left margin after List tags (Unordered and Ordered lists). 96 | - Reintroduced `` and `` tags. 97 | - New PlainText and GeneratePlainText properties (public) - removed HTMLToPlainText method. 98 | 99 | - 01/12/2024 (Version 5.1) 100 | 101 | - Improved VCL x FMX x HTML color notation. Please read Color Notation topic. 102 | 103 | - 01/05/2024 (Version 5.0) 104 | 105 | | :exclamation: Component breaking changes | 106 | |---------------------------------------------------------------------------------------| 107 | | Tags ``, `` and `` have been removed | 108 | | Please use new tag `
` | 109 | | (`` and `` reintroduced in version 5.2, `` reintroduced in version 6.0) | 110 | 111 | - **NEW COMPONENT ENGINE!!!** 112 | - Improved token processing performance 113 | - FmxLinux supporting 114 | - Refactoring Scaling in VCL 115 | - Fixed Lazarus Scaling (Lazarus IDE stores Design DPI) 116 | - New Div Tag (`
`) 117 | - Removed Tab and Float Tags (``, ``, ``) - *please use new Div tag* 118 | - New Header Tag (``) 119 | - New Custom Style Tag (` - Custom style, according to CustomStyles collection property (name must be the same as Custom Style "Ident" property - case insensitive) 452 | - Line Break (Use "cont" parameter to a continous line. If parameter not specified, a new paragraph will be considered) 453 | - Prevent new line if used after a line break sequence 454 | - Align Left 455 | - Align Center 456 | - Align Right 457 | - Image from ImageList where 'index' is image index 458 | - PNG image from Resource where 'name' is the resource name 459 |
    - Unordered list 460 |
      - Ordered list 461 |
    1. - List item 462 | - Spoiler Title (use "exp" param to show spoiler already expanded) 463 | - Spoiler Detail 464 | - Line spacing where 'aaa' is the height in pixels, and 'bbb' is the height when a new paragraph (plus original line space) 465 | - Paragraph Indent - left margin of a new paragraph in pixels 466 | - Superscript 467 | - Subscript 468 | - Horizontal single or dual color line 469 | "full" option only works when AutoWidth of parent div is disabled 470 | Default values: 471 | width = 100 472 | height = 1 473 | color = Current font color 474 | coloralt = No value (specify a color to draw dual color line, otherwise it will draw a single color line) 475 | - Aligning content vertically to the line 476 | - Content margin spacing 477 | Offset margins are memorized if a new offset tag is specifyed without same parameter name 478 | 479 | OBSOLETE TAGS: 480 | - Tab - left margin offset 481 | - Tab with continuous lines aligned 482 |
      - Floating div area 483 | 484 | ---------- 485 | 486 | * COLOR_VALUE - clColor(VCL)|Color(FMX)|$00GGBBRR|#AARRGGBB|#RRGGBB 487 | * When FMX, all sizes (TPixels) use the "." notation as a decimal separator 488 | ``` 489 | 490 | > The tags notation is case-insensitive, so you can use `Text` or `Text`. 491 | 492 | Tags must follow the hierarchy as they were opened: 493 | 494 | - `text` = CORRECT 495 | - `text` = WRONG 496 | 497 | ![Runtime example](images/runtime_print.png) 498 | 499 | ## Installing 500 | 501 | > If you are using Lazarus: go to the Package menu; Open Package File (.lpk); locate LazDzHTMLText.lpk; open the package; Compile it and Install it. 502 | 503 | ### Autoinstall 504 | 505 | 1. Download Component Installer from: https://github.com/digao-dalpiaz/CompInstall/releases/latest 506 | 2. Put **CompInstall.exe** into the component repository sources folder. 507 | 3. Close Delphi IDE and run **CompInstall.exe** app. 508 | 509 | ### Manual install 510 | 511 | 1. Open **DzHTMLText.groupproj** project in Delphi. 512 | 2. Choose desired platform and ensure **Release** config are selected in all packages (Design packages must be compiled in Win32 platform). 513 | 3. Right-click at root item in the tree and choose **Build All**. 514 | 4. Right-click at **DzHTMLTextDesign_VCL** / **DzHTMLTextDesign_FMX** and choose **Install**. 515 | 5. Add Library Path according to the platform in Tools\Options. Example: If you are using Win32, set path = `Lib\Win32\Release`. 516 | 517 | Supports Delphi XE3..Delphi 12 518 | 519 | ## Component Properties 520 | 521 | > **TPixels** represents `Integer` in **VCL**, or `Single` in **FMX**. 522 | 523 | `AutoBreak: Boolean` = When enabled, the component automatically converts Line Break sequence into a new line. If you don't want the line break in a specific sequence, you can use the `` tag after Line Break sequence. 524 | 525 | `AutoHeight: Boolean` = Auto set height of control when Text property changed 526 | 527 | `AutoWidth: Boolean` = Auto set width of control when Text property changed. 528 | If you are using AutoWidth, the text never wraps to a new line unless a line break is specified at text or there is a value specified in MaxWidth property. 529 | 530 | `AutoOpenLink: Boolean` = Open links automatically on click over, without set event OnLinkClick. 531 | 532 | `Borders: TDHBorders` = Defines `Left`, `Top`, `Right` and `Bottom` sub-properties, specifying the text area margins. 533 | 534 | `Color: TColor` = Background color of control. In FMX environment, `Null` represents transparent background. 535 | 536 | `CustomStyles: TDHHeaderStyles` = Collection of header styles to use with tag ``, where `ident` is Ident property of a header style in collection list. 537 | 538 | `Font: TFont` = Determines the base font. When no tag is specified on text, this base font is used. 539 | 540 | `Images: TCustomImageList` = When using `` tag, you should set this property to specify the ImageList where the images are stored. In FMX environment, this property is only available using Delphi XE8 or higher. 541 | 542 | `LineCount: Integer` = Returns the total lines of text, according to the bounds of control. This property is read-only. 543 | 544 | `Lines: TStrings` = The text you want to show at label control. You can use `
      ` tag to break lines. The default Line Break sequence breaks lines either when AutoBreak property is enabled. 545 | 546 | `LineSpacing: TPixels` = Specify the default line spacing in overall text. You can use `` tag to determine line spacing at specific lines. 547 | 548 | `LineHorzAlign: TDHHorzAlign (haLeft, haCenter, haRight)` = Allows you to specify the horizontal alignment of each element in the line. Default is `haLeft`. 549 | 550 | `LineVertAlign: TDHVertAlign (vaTop, vaCenter, vaBottom)` = Allows you to specify the vertical alignment of each element in the line. This property only take effects when the elements have different heights at same line. Default is `vaTop`. 551 | 552 | `ListLevelPadding: TPixels` = Determines the width of each list level in pixels, when using HTML list tags. 553 | 554 | `MaxWidth: TPixels` = Specify the maximum width of text, when using AutoWidth property. 555 | 556 | `Offset: TDHOffset` = Sets Top and Bottom offset (spacing in Pixels) for each line. When using `` tag, it will replace this setting, according to the specified attribute (top and/or bottom). 557 | 558 | `OverallHorzAlign: TDHHorzAlign (haLeft, haCenter, haRight)` = Determines overall text horizontal alignment. This property only take effects if `AutoWidth` is false. 559 | 560 | `OverallVertAlign: TDHVertAlign (vaTop, vaCenter, vaBottom)` = Determines overall text vertical alignment. This property only take effects if `AutoHeight` is false. 561 | 562 | `ParagraphCount: Integer` = Returns the total paragraphs of text. This property is read-only. 563 | 564 | `ParagraphIndent: TPixels` = Default left margin of a new paragraph. 565 | 566 | `ParagraphSpacing: TPixels` = Specify the default paragraph spacing in overall text. The paragraph spacing is added to original line spacing. You can use `` tag to determine paragraph spacing at specific lines. 567 | 568 | `RightToLeftText: Boolean` = Enables Right-to-left text notation. 569 | 570 | `StyleLinkNormal: TDHStyleLinkProp` = Properties to format a link when is not selected by mouse. 571 | 572 | `StyleLinkHover: TDHStyleLinkProp` = Properties to format a link when is selected by mouse. 573 | 574 | `SyntaxErrors: TDHSyntaxErrorList` (public) = List of syntax errors. Right click on component and choose "Show Syntax Errors" at design time to show syntax errors. **When any syntax error, at design time the border of the component will be draw with red color.** 575 | 576 | `Text: string` (public) = This property is a shortcut to `Lines` property. At run-time, you can read and write this property directly, but the component will store the text at `Lines` property. 577 | 578 | `TextHeight: TPixels` = Returns the total text height. This property is read-only. 579 | 580 | `TextWidth: TPixels` = Returns the total text width. This property is read-only. 581 | 582 | `Transparent: Boolean` (only in VCL) = Enables component transparency. **Warning: When using with links, it will cause flickering when redrawing component.** 583 | 584 | ## Events 585 | 586 | ```delphi 587 | procedure OnLinkEnter(Sender: TObject; Link: TDHBaseLink); 588 | ``` 589 | This event is fired when the mouse enters a link area 590 | 591 | ```delphi 592 | procedure OnLinkLeave(Sender: TObject; Link: TDHBaseLink); 593 | ``` 594 | This event is fired when the mouse leaves a link area 595 | 596 | ```delphi 597 | procedure OnLinkClick(Sender: TObject; Link: TDHBaseLink; var Handled: Boolean); 598 | ``` 599 | This event is fired when a link is left-clicked by the mouse. You can use Handled var to by-pass the AutoOpenLink property (the handled value is False at method start). 600 | 601 | ```delphi 602 | procedure OnLinkRightClick(Sender: TObject; Link: TDHBaseLink; var Handled: Boolean); 603 | ``` 604 | This event is fired when a link is right-clicked by the mouse. You can use Handled var to by-pass the AutoOpenLink property (the handled value is False at method start). 605 | 606 | ```delphi 607 | procedure OnRetrieveImgRes(Sender: TObject; const ResourceName: string; Picture: TAnyPicture; var Handled: Boolean); 608 | ``` 609 | If you are using `` tag, this event will fire on every image tag, allowing you to manually load a image from anywhere, in any image format, assigning it to Picture object. Be sure to set `Handled := True` when you manually load an image. 610 | *Not using this event causes the component to automatically load the image from application resources by name, and must be in PNG format when using VCL environment. In FMX environment you can use any image format supported by Delphi.* 611 | 612 | Example: 613 | 614 | ```delphi 615 | procedure TForm1.DzHTMLText1RetrieveImgRes(Sender: TObject; const ResourceName: string; 616 | Picture: TAnyPicture; var Handled: Boolean); 617 | var JPG: TJpegImage; 618 | begin 619 | if ResourceName='TEST' then 620 | begin 621 | JPG := TJpegImage.Create; 622 | try 623 | JPG.LoadFromFile('C:\Test.jpg'); 624 | Picture.Assign(JPG); 625 | finally 626 | JPG.Free; 627 | end; 628 | 629 | Handled := True; 630 | end; 631 | end; 632 | ``` 633 | 634 | ## Procedures/Functions 635 | 636 | ```delphi 637 | function IsLinkHover: Boolean; 638 | ``` 639 | This function returns true when the mouse is over a link 640 | 641 | ```delphi 642 | function SelectedLink: TDHBaseLink; 643 | ``` 644 | This function returns the object of the selected link. A link is selected when the mouse is over it. If there is no link selected, this property is `nil`. 645 | 646 | ```delphi 647 | procedure Rebuild; 648 | ``` 649 | This method rebuilds all internal text elements to get component ready to paint. Call this method if you want to get some calculated property, like TextWidth and TextHeight. Otherwise, you don't need to call this procedure directly. 650 | 651 | ```delphi 652 | procedure BeginUpdate; 653 | ``` 654 | Increments internal update semaphore, so while reference counting is bigger than zero, the component will not repaint automatically when the properties are changed, like changing Text or Font property. 655 | 656 | ```delphi 657 | procedure EndUpdate(ForceRepaint: Boolean = True); 658 | ``` 659 | Decrements internal update semaphore, so when reference counting is zero, if `ForceRepaint` parameter is True, then the component will repaint the HTML Text. 660 | 661 | *BeginUpdate/EndUpdate example:* 662 | ```delphi 663 | DzHTMLText1.BeginUpdate; 664 | try 665 | DzHTMLText1.Text := 'Text test 1234'; 666 | DzHTMLText1.Font.Color := clRed; 667 | DzHTMLText1.Font.Size := 20; 668 | finally 669 | DzHTMLText1.EndUpdate; 670 | end; 671 | ``` 672 | 673 | > Do not use `Lines.BeginUpdate/Lines.EndUpdate`. These methods are not controlled by the component. 674 | 675 | ## Link Reference Tag 676 | 677 | There are two ways to use link tag: 678 | 679 | 1. Declaring internal link and the text do display: 680 | 681 | `Open Google Search` 682 | 683 | *This will display: [Open Google Search](http://www.google.com)* 684 | 685 | 2. Just using the display text: 686 | 687 | `www.google.com` 688 | 689 | *This will display: www.google.com* 690 | 691 | > You can use any text as internal link code. Then you can handle this code at *link events*, reading `Link` parameter. 692 | 693 | > Do not use link tags (``, ``, ``) inside a `` tag! 694 | 695 | ## Spoiler Tag 696 | 697 | This tag allows you to create a link and a detail div, where the detail is automatically expanded or collapsed when the mouse clicks on the link. 698 | 699 | To create the spoiler link: `This is the spoiler link text` 700 | 701 | To create the detail div: `This is the detail div that will be expanded when the spoiler link is clicked.` 702 | 703 | The spoiler name is **case insensitive**. 704 | 705 | > You can handle spoiler link at *link events*. It's possible to bypass expand/collapse behavior using `Handled` property. 706 | 707 | > You can use another spoilers inside a spoiler detail div. 708 | 709 | > It's allowed to create multiple links pointing to a single detail div, and it's allowed to create a single link pointing to multiple detail divs. 710 | 711 | > Do not use link tags (``, ``, ``) inside a `` tag! 712 | 713 | ## Link object 714 | 715 | **TDHBaseLink has two child classes possible:** 716 | - TDHLinkRef: It's a link created by `` tag. 717 | - TDHSpoiler: It's a spoiler created by `` tag. 718 | 719 | **Properties:** 720 | 721 | - `Kind: TDHLinkKind` = The link kind (lkLinkRef or lkSpoiler). 722 | 723 | - `LinkRef: TDHLinkRef` = References the TDHLinkRef object when link kind is a `` tag. 724 | 725 | **TDHLinkRef object:** 726 | - `Target: string` = The link target specified at `` tag. 727 | - `Text: TStringBuilder` = The link display text specified at `Display Text` inner text. 728 | 729 | - `Spoiler: TDHSpoiler` = References the TDHSpoiler object when link kind is a `` tag. 730 | 731 | **TDHSpoiler object:** 732 | - `Name: string` = The spoiler name. 733 | - `Expanded: Boolean` = If the spoiler details is expanded. 734 | 735 | **Link events** 736 | 737 | You can retrieve this object using OnLinkClick / OnLinkRightClick / OnLinkEnter / OnLinkLeave events. Also you can call `GetSelectedLink` or reading `LinkRefs` and `Spoilers` lists. 738 | 739 | ## Image Tag 740 | 741 | You can use the tags: 742 | 743 | - `` to show an image of a TImageList component. Just assign the Images property to the ImageList. Then use the `index` parameter to indicate the index of the image in the ImageList component. *In FMX environment, this is only available using Delphi XE8 or higher.* 744 | 745 | - `` to show an image of a resource. Include an image into application resources and then use the `name` parameter to indicate the name of the resource. In VCL environment, the image must be in PNG format. In FMX environment, all Delphi supported images are allowed. **Important: the image will be displayed only at runtime.** 746 | 747 | Example: 748 | 749 | ![App Resources Dialog](images/app_resources_dialog.png) 750 | 751 | In this example, the image tag should be `` 752 | 753 | ## Div Tag 754 | 755 | ![Div Example](images/div.png) 756 | 757 | Syntax of the image above: 758 | 759 | ```html 760 | Some text inside a div
      768 | ``` 769 | 770 | The component is based in Div areas. This mean the main area of component is a Div, and you can insert sub divs, and another divs inside divs, and so on. The div tag allows you to work with alignment, colors, borders, margin, and you can even make a table using multiple divs. 771 | 772 | The div tag may be floating, using specific X and Y position, or docked to the current text, when not specifying any position. 773 | 774 | Please, refer to all possible parameters in [Available tags](#available-tags). 775 | 776 | ## Tab Tag 777 | 778 | There are two **tab** tags you can use: 779 | 780 | - `` = Allow you to positioning text exactly on "nnn" position in pixels starting on the left border of component. If the text wraps to a new line, it will be return aligned at left border of component. 781 | - `` = The same as above, but if the text wraps to a new line, it will be aligned in the same position as the first line which the tab started. This tag will produce a better visual text alignment. 782 | 783 | ## Literal tag character 784 | 785 | If you want to display literal special characters in the text, just type the HTML code: 786 | 787 | - `&` = `&` 788 | - `<` = `<` 789 | - `>` = `>` 790 | 791 | There are two class functions to deal with HTML characters: 792 | 793 | ```delphi 794 | class function EscapeTextToHTML(const aText: string): string; 795 | class function UnescapeHTMLToText(const aHTML: string): string; 796 | ``` 797 | 798 | > As this component is not a complete HTML language debugger, there is no need to escape the other special characters. Therefore, for characters such as accentuation, for example, or other signs, you must use them normally. 799 | 800 | ## Chinese/Japanese/Korean line break 801 | 802 | If you have component width smaller than your text, then it will break to a new line according to some specific chars. 803 | These chars are: ` ` (space), `\` and `/`. The bars are considered as word break because if you type some path, for example, then should be a way to split this path into a new line if it was too big. 804 | 805 | When you type Chinese, Japanese or Korean characters, this behavior is quite different. In this case, the component will break lines considering any char as a complete word. 806 | 807 | ## Auto Scaling 808 | 809 | ### VCL (Delphi and Lazarus) 810 | 811 | All measurements will be calculated based on the Design DPI (always 96 pixels per inch), and applied to the current Monitor DPI. Example: if you specified a tab width as 60 pixels, at 96 DPI, when displaying the text on a 120 DPI monitor, the tab width will be larger (75 pixels). 812 | 813 | For automatic scaling by DPI to work correctly, it is necessary to use Windows 8.1 or higher, and Delphi 10 or higher, or Lazarus. 814 | If using Delphi previous version, the scaling will be disabled. 815 | If using Windows previous version, the scaling will be based on the default monitor DPI, and not on application current monitor. 816 | 817 | ### FMX 818 | 819 | In FMX environment, auto scaling is controled by Fire Monkey framework, automatically scaling the entire form layout and its components. 820 | 821 | ## Color Notation 822 | 823 | When using tags like `` or ``, you can specify these color notation options: 824 | 825 | - VCL Style: `$00BBGGRR`, where BB=Blue Color, GG=Green Color, RR=Red Color. 826 | - VCL Literal: `clColor` -> example: clBlack, or clWindowText. 827 | - FMX Style: `#AARRGGBB`, where AA=Alpha Chanel, RR=Red, GG=Green, BB=Blue (when using in VCL, alpha channel only supports `FF` value). 828 | - FMX Literal: `Color` -> example: Black (FMX TAlphaColor does not support system colors). 829 | - HTML Style: `#RRGGBB`, where RR=Red, GG=Green, BB=Blue (when using in FMX, alpha channel will be set to `FF` - solid). 830 | 831 | You can specify VCL notation when using FMX component, or even using FMX notation when using VCL component. The same for HTML notation. 832 | 833 | ## Formatted Message Dialog Component 834 | 835 | Please, take a look at my Message Dialogs Component that uses this HTML Component to display formatted messages. The component will make much more easy to manage your application messages. 836 | 837 | https://github.com/digao-dalpiaz/Dam 838 | 839 | Message Dialog Example: 840 | 841 | ![Dam Example](https://github.com/digao-dalpiaz/Dam/blob/master/images/dam_super_print.png) 842 | 843 | ## Donate 844 | 845 | This project has been developed by several years, and I am trying to continuously updating it. To do that, I need to stop other projects, to make time. 846 | 847 | If you like this work and it's useful to you, consider to contribute, so I can spend more time to enhance the code and functionalities. 848 | 849 | [![](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=623699KF25VZY&item_name=GitHub+Digao+Dalpiaz¤cy_code=USD&source=url) 850 | 851 | **Thank you very much.** :grin: 852 | -------------------------------------------------------------------------------- /Source/Defines.inc: -------------------------------------------------------------------------------- 1 | {$IFDEF FMX} 2 | {$IF CompilerVersion >= 26} //XE5 3 | {$DEFINE USE_NEW_UNITS} 4 | {$ENDIF} 5 | {$IF CompilerVersion >= 29} //XE8 6 | {$DEFINE USE_NEW_ENV} 7 | {$DEFINE USE_IMGLST} 8 | {$ENDIF} 9 | {$ELSE} 10 | {$DEFINE VCL} 11 | {$DEFINE USE_NEW_ENV} 12 | {$DEFINE USE_IMGLST} 13 | 14 | {$IFDEF MSWINDOWS} 15 | {$IFDEF DCC} 16 | {$DEFINE USE_GDI} 17 | {$ENDIF} 18 | {$ENDIF} 19 | {$ENDIF} 20 | 21 | {$ZEROBASEDSTRINGS OFF} 22 | 23 | -------------------------------------------------------------------------------- /Source/Design/DzHTMLText.dcr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digao-dalpiaz/DzHTMLText/79ce4d3998fc77b891cdacfe2c699208cb7bcad0/Source/Design/DzHTMLText.dcr -------------------------------------------------------------------------------- /Source/Design/DzHTMLText.lrs: -------------------------------------------------------------------------------- 1 | LazarusResources.Add('TDzHTMLText','BMP',[ 2 | 'BM'#246#6#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#24#0#0#0#24#0#0#0#1#0#24#0#0#0#0#0 3 | +#192#6#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0'$'#28#237'$'#28#237'$'#28#237'$' 4 | +#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237 5 | +'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28 6 | +#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$' 7 | +#28#237'$'#28#237'$'#28#237'$'#28#237#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0'$' 8 | +#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237 9 | +'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28 10 | +#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237#0#0#0#0#0#0#160#160#160'$'#28 11 | +#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$' 12 | +#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237 13 | +'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237#160#160#160#0#0#0#0#0#0'$' 14 | +#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237 15 | +'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28 16 | +#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237#0#0#0#0#0#0 17 | +#160#160#160'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$' 18 | +#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237 19 | +'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237#160 20 | +#160#160#0#0#0#0#0#0'$'#28#237'$'#28#237'$'#28#237#0#0#0#0#0#0#0#0#0#0#0#0#0 21 | +#0#0#0#0#0#0#0#0#0#0#0#0#0#0'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28 22 | +#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237#0#0#0#0#0#0#160#160 23 | +#160'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$' 24 | +#28#237'$'#28#237'$'#28#237'$'#28#237#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0 25 | +#0#0#0#0'$'#28#237'$'#28#237#160#160#160#0#0#0#0#0#0'$'#28#237'$'#28#237'$' 26 | +#28#237'$'#28#237#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0'$'#28#237'$'#28#237'$'#28#237 27 | +#0#0#0#0#0#0#0#0#0'$'#28#237'$'#28#237#0#0#0#0#0#0#0#0#0'$'#28#237'$'#28#237 28 | +#0#0#0#0#0#0#160#160#160'$'#28#237'$'#28#237#0#0#0#0#0#0#160#160#160'$'#28 29 | +#237#160#160#160#0#0#0#0#0#0'$'#28#237'$'#28#237#0#0#0#0#0#0#0#0#0'$'#28#237 30 | +'$'#28#237#0#0#0#0#0#0#0#0#0'$'#28#237#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0'$'#28 31 | +#237#0#0#0#0#0#0'$'#28#237'$'#28#237'$'#28#237#0#0#0#0#0#0'$'#28#237'$'#28 32 | +#237#0#0#0#0#0#0#0#0#0'$'#28#237'$'#28#237#0#0#0#0#0#0#0#0#0'$'#28#237'$'#28 33 | +#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237#0#0#0#0#0#0'$'#28#237 34 | +'$'#28#237'$'#28#237#0#0#0#0#0#0'$'#28#237'$'#28#237#0#0#0#0#0#0#0#0#0#0#0#0 35 | +#0#0#0#0#0#0#0#0#0'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28 36 | +#237'$'#28#237'$'#28#237#0#0#0#0#0#0'$'#28#237'$'#28#237'$'#28#237#0#0#0#0#0 37 | +#0'$'#28#237'$'#28#237#0#0#0#0#0#0#0#0#0'$'#28#237'$'#28#237#0#0#0#0#0#0#0#0 38 | +#0'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237#0#0 39 | +#0#0#0#0'$'#28#237'$'#28#237'$'#28#237#0#0#0#0#0#0'$'#28#237'$'#28#237#0#0#0 40 | +#0#0#0#0#0#0'$'#28#237'$'#28#237#0#0#0#0#0#0#0#0#0'$'#28#237'$'#28#237'$'#28 41 | +#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237#0#0#0#0#0#0'$'#28#237'$'#28#237 42 | +'$'#28#237#0#0#0#0#0#0'$'#28#237'$'#28#237#0#0#0#0#0#0#0#0#0'$'#28#237'$'#28 43 | +#237#0#0#0#0#0#0#0#0#0'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$' 44 | +#28#237'$'#28#237#0#0#0#0#0#0'$'#28#237'$'#28#237'$'#28#237#0#0#0#0#0#0'$'#28 45 | +#237#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0'$'#28#237'$'#28#237'$' 46 | +#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237#0#0#0#0#0#0#0#0#0#0#0#0'$'#28 47 | +#237#0#0#0#0#0#0#0#0#0#0#0#0'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28 48 | +#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$' 49 | +#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237 50 | +'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28 51 | +#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$' 52 | +#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237 53 | +'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237#164';' 54 | +'S'#164';S'#164';S$'#28#237#164';S$'#28#237'$'#28#237#164';S$'#28#237#164';S' 55 | +#164';S'#164';S$'#28#237'$'#28#237#164';S'#164';S'#164';S$'#28#237#164';S' 56 | +#164';S'#164';S$'#28#237'$'#28#237'$'#28#237#164';S$'#28#237'$'#28#237'$'#28 57 | +#237#164';S$'#28#237'$'#28#237#164';S$'#28#237#164';S$'#28#237'$'#28#237#164 58 | +';S$'#28#237#164';S$'#28#237'$'#28#237'$'#28#237#164';S$'#28#237'$'#28#237'$' 59 | +#28#237'$'#28#237'$'#28#237#164';S$'#28#237'$'#28#237'$'#28#237#164';S'#164 60 | +';S'#164';S'#164';S$'#28#237#164';S$'#28#237#164';S$'#28#237'$'#28#237#164';' 61 | +'S'#164';S$'#28#237'$'#28#237#164';S$'#28#237'$'#28#237'$'#28#237'$'#28#237 62 | +'$'#28#237#164';S$'#28#237'$'#28#237'$'#28#237#164';S$'#28#237'$'#28#237#164 63 | +';S$'#28#237#164';S$'#28#237'$'#28#237#164';S$'#28#237#164';S$'#28#237'$'#28 64 | +#237'$'#28#237#164';S$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237#164';' 65 | +'S$'#28#237'$'#28#237'$'#28#237'$'#28#237#164';S'#164';S$'#28#237'$'#28#237 66 | ,#164';S'#164';S'#164';S$'#28#237'$'#28#237#164';S'#164';S'#164';S$'#28#237 67 | +#164';S$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237 68 | +'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28 69 | +#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237'$' 70 | +#28#237'$'#28#237'$'#28#237'$'#28#237'$'#28#237 71 | ]); 72 | -------------------------------------------------------------------------------- /Source/Design/DzHTMLTextDesign_FMX.dpk: -------------------------------------------------------------------------------- 1 | package DzHTMLTextDesign_FMX; 2 | 3 | {$R *.res} 4 | {$R 'DzHTMLText.dcr'} 5 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} 6 | {$ALIGN 8} 7 | {$ASSERTIONS ON} 8 | {$BOOLEVAL OFF} 9 | {$DEBUGINFO OFF} 10 | {$EXTENDEDSYNTAX ON} 11 | {$IMPORTEDDATA ON} 12 | {$IOCHECKS ON} 13 | {$LOCALSYMBOLS OFF} 14 | {$LONGSTRINGS ON} 15 | {$OPENSTRINGS ON} 16 | {$OPTIMIZATION ON} 17 | {$OVERFLOWCHECKS OFF} 18 | {$RANGECHECKS OFF} 19 | {$REFERENCEINFO OFF} 20 | {$SAFEDIVIDE OFF} 21 | {$STACKFRAMES OFF} 22 | {$TYPEDADDRESS OFF} 23 | {$VARSTRINGCHECKS ON} 24 | {$WRITEABLECONST OFF} 25 | {$MINENUMSIZE 1} 26 | {$IMAGEBASE $400000} 27 | {$DEFINE RELEASE} 28 | {$ENDIF IMPLICITBUILDING} 29 | {$DESCRIPTION 'Digao Dalpiaz - DzHTMLText Component - FMX Designtime'} 30 | {$DESIGNONLY} 31 | {$IMPLICITBUILD ON} 32 | 33 | requires 34 | designide, 35 | DzHTMLText_FMX; 36 | 37 | contains 38 | FMX.DzHTMLTextReg in 'FMX.DzHTMLTextReg.pas'; 39 | 40 | end. 41 | -------------------------------------------------------------------------------- /Source/Design/DzHTMLTextDesign_FMX.dproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {E9214062-122D-489F-A70B-C01ED2C93A53} 4 | DzHTMLTextDesign_FMX.dpk 5 | 19.5 6 | None 7 | True 8 | Release 9 | Win32 10 | 2 11 | Package 12 | 13 | 14 | true 15 | 16 | 17 | true 18 | Base 19 | true 20 | 21 | 22 | true 23 | Base 24 | true 25 | 26 | 27 | true 28 | Base 29 | true 30 | 31 | 32 | true 33 | Cfg_1 34 | true 35 | true 36 | 37 | 38 | true 39 | Base 40 | true 41 | 42 | 43 | true 44 | Cfg_2 45 | true 46 | true 47 | 48 | 49 | .\$(Platform)\$(Config) 50 | .\$(Platform)\$(Config) 51 | false 52 | false 53 | false 54 | false 55 | false 56 | true 57 | true 58 | System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) 59 | All 60 | DzHTMLTextDesign_FMX 61 | true 62 | 1046 63 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 64 | Digao Dalpiaz - DzHTMLText Component - FMX Designtime 65 | 66 | 67 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 68 | Debug 69 | true 70 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 71 | 1033 72 | DzHTMLText_FMX;$(DCC_UsePackage) 73 | 74 | 75 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) 76 | Debug 77 | true 78 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 79 | 1033 80 | DzHTMLText_FMX;$(DCC_UsePackage) 81 | 82 | 83 | DEBUG;$(DCC_Define) 84 | true 85 | false 86 | true 87 | true 88 | true 89 | true 90 | true 91 | 92 | 93 | false 94 | 95 | 96 | false 97 | RELEASE;$(DCC_Define) 98 | 0 99 | 100 | 101 | true 102 | 1033 103 | ..\..\Lib\$(Platform)\$(Config)\Design 104 | 105 | 106 | 107 | MainSource 108 | 109 | 110 | 111 | 112 | 113 | 114 | Base 115 | 116 | 117 | Cfg_1 118 | Base 119 | 120 | 121 | Cfg_2 122 | Base 123 | 124 | 125 | 126 | Delphi.Personality.12 127 | Package 128 | 129 | 130 | 131 | DzHTMLTextDesign_FMX.dpk 132 | 133 | 134 | 135 | True 136 | True 137 | 138 | 139 | 12 140 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /Source/Design/DzHTMLTextDesign_FMX.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digao-dalpiaz/DzHTMLText/79ce4d3998fc77b891cdacfe2c699208cb7bcad0/Source/Design/DzHTMLTextDesign_FMX.res -------------------------------------------------------------------------------- /Source/Design/DzHTMLTextDesign_VCL.dpk: -------------------------------------------------------------------------------- 1 | package DzHTMLTextDesign_VCL; 2 | 3 | {$R *.res} 4 | {$R 'DzHTMLText.dcr'} 5 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} 6 | {$ALIGN 8} 7 | {$ASSERTIONS ON} 8 | {$BOOLEVAL OFF} 9 | {$DEBUGINFO OFF} 10 | {$EXTENDEDSYNTAX ON} 11 | {$IMPORTEDDATA ON} 12 | {$IOCHECKS ON} 13 | {$LOCALSYMBOLS OFF} 14 | {$LONGSTRINGS ON} 15 | {$OPENSTRINGS ON} 16 | {$OPTIMIZATION ON} 17 | {$OVERFLOWCHECKS OFF} 18 | {$RANGECHECKS OFF} 19 | {$REFERENCEINFO OFF} 20 | {$SAFEDIVIDE OFF} 21 | {$STACKFRAMES OFF} 22 | {$TYPEDADDRESS OFF} 23 | {$VARSTRINGCHECKS ON} 24 | {$WRITEABLECONST OFF} 25 | {$MINENUMSIZE 1} 26 | {$IMAGEBASE $400000} 27 | {$DEFINE RELEASE} 28 | {$ENDIF IMPLICITBUILDING} 29 | {$DESCRIPTION 'Digao Dalpiaz - DzHTMLText Component - VCL Designtime'} 30 | {$DESIGNONLY} 31 | {$IMPLICITBUILD ON} 32 | 33 | requires 34 | designide, 35 | DzHTMLText_VCL; 36 | 37 | contains 38 | Vcl.DzHTMLTextReg in 'Vcl.DzHTMLTextReg.pas'; 39 | 40 | end. 41 | -------------------------------------------------------------------------------- /Source/Design/DzHTMLTextDesign_VCL.dproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {AF101202-70E1-4FB5-ABC6-C7CC76E63711} 4 | DzHTMLTextDesign_VCL.dpk 5 | 19.5 6 | None 7 | True 8 | Release 9 | Win32 10 | 2 11 | Package 12 | 13 | 14 | true 15 | 16 | 17 | true 18 | Base 19 | true 20 | 21 | 22 | true 23 | Base 24 | true 25 | 26 | 27 | true 28 | Base 29 | true 30 | 31 | 32 | true 33 | Cfg_1 34 | true 35 | true 36 | 37 | 38 | true 39 | Base 40 | true 41 | 42 | 43 | true 44 | Cfg_2 45 | true 46 | true 47 | 48 | 49 | .\$(Platform)\$(Config) 50 | .\$(Platform)\$(Config) 51 | false 52 | false 53 | false 54 | false 55 | false 56 | true 57 | true 58 | System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) 59 | All 60 | DzHTMLTextDesign_VCL 61 | true 62 | 1046 63 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 64 | Digao Dalpiaz - DzHTMLText Component - VCL Designtime 65 | 66 | 67 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 68 | Debug 69 | true 70 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 71 | 1033 72 | DzHTMLText_VCL;$(DCC_UsePackage) 73 | 74 | 75 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) 76 | Debug 77 | true 78 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 79 | 1033 80 | DzHTMLText_VCL;$(DCC_UsePackage) 81 | 82 | 83 | DEBUG;$(DCC_Define) 84 | true 85 | false 86 | true 87 | true 88 | true 89 | true 90 | true 91 | 92 | 93 | false 94 | 95 | 96 | false 97 | RELEASE;$(DCC_Define) 98 | 0 99 | 100 | 101 | true 102 | 1033 103 | ..\..\Lib\$(Platform)\$(Config)\Design 104 | 105 | 106 | 107 | MainSource 108 | 109 | 110 | 111 | 112 | 113 | 114 | Base 115 | 116 | 117 | Cfg_1 118 | Base 119 | 120 | 121 | Cfg_2 122 | Base 123 | 124 | 125 | 126 | Delphi.Personality.12 127 | Package 128 | 129 | 130 | 131 | DzHTMLTextDesign_VCL.dpk 132 | 133 | 134 | 135 | True 136 | True 137 | 138 | 139 | 12 140 | 141 | 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /Source/Design/DzHTMLTextDesign_VCL.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digao-dalpiaz/DzHTMLText/79ce4d3998fc77b891cdacfe2c699208cb7bcad0/Source/Design/DzHTMLTextDesign_VCL.res -------------------------------------------------------------------------------- /Source/Design/FMX.DzHTMLTextReg.pas: -------------------------------------------------------------------------------- 1 | unit FMX.DzHTMLTextReg; 2 | {$DEFINE FMX} 3 | {$INCLUDE 'Vcl.DzHTMLTextReg.pas'} 4 | -------------------------------------------------------------------------------- /Source/Design/Vcl.DzHTMLTextReg.pas: -------------------------------------------------------------------------------- 1 | {$IFNDEF FMX}unit Vcl.DzHTMLTextReg;{$ENDIF} 2 | 3 | interface 4 | 5 | procedure Register; 6 | 7 | implementation 8 | 9 | uses 10 | {$IFDEF FPC} 11 | ComponentEditors, LResources, Classes, SysUtils, Dialogs, 12 | Vcl.DzHTMLText 13 | {$ELSE} 14 | DesignEditors, DesignIntf, System.Classes, System.SysUtils, Vcl.Dialogs, 15 | {$IFDEF FMX} 16 | FMX.DzHTMLText 17 | {$ELSE} 18 | Vcl.DzHTMLText 19 | {$ENDIF} 20 | {$ENDIF}; 21 | 22 | type 23 | TDHPropEdit = class(TComponentEditor) 24 | public 25 | function GetVerbCount: Integer; override; 26 | function GetVerb(Index: Integer): string; override; 27 | procedure ExecuteVerb(Index: Integer); override; 28 | 29 | procedure ShowSyntaxErrors; 30 | end; 31 | 32 | procedure TDHPropEdit.ExecuteVerb(Index: Integer); 33 | begin 34 | case Index of 35 | 0: ShowSyntaxErrors; 36 | else raise EDHInternalExcept.Create('Property editor verb index invalid'); 37 | end; 38 | end; 39 | 40 | function TDHPropEdit.GetVerb(Index: Integer): string; 41 | begin 42 | case Index of 43 | 0: Result := 'Show Syntax Errors'; 44 | else raise EDHInternalExcept.Create('Property editor verb index invalid'); 45 | end; 46 | end; 47 | 48 | function TDHPropEdit.GetVerbCount: Integer; 49 | begin 50 | Result := 1; 51 | end; 52 | 53 | procedure TDHPropEdit.ShowSyntaxErrors; 54 | var 55 | Lb: TDzHTMLText; 56 | SB: TStringBuilder; 57 | Error: TDHSyntaxError; 58 | Line: string; 59 | begin 60 | Lb := TDzHTMLText(Component); 61 | 62 | SB := TStringBuilder.Create; 63 | try 64 | if Lb.SyntaxErrors.Count=0 then 65 | SB.Append('No syntax errors') 66 | else 67 | begin 68 | SB.AppendLine(Format('Errors (%d):', [Lb.SyntaxErrors.Count])); 69 | for Error in Lb.SyntaxErrors do 70 | begin 71 | if Error.Position>0 then 72 | Line := Format('Position %d: %s', [Error.Position, Error.Description]) 73 | else 74 | Line := Error.Description; 75 | 76 | SB.AppendLine('- ' + Line); 77 | end; 78 | end; 79 | 80 | ShowMessage(SB.ToString); 81 | finally 82 | SB.Free; 83 | end; 84 | end; 85 | 86 | // 87 | 88 | procedure Register; 89 | begin 90 | {$IFDEF FPC}{$I DzHTMLText.lrs}{$ENDIF} 91 | RegisterComponents('Digao', [TDzHTMLText]); 92 | RegisterComponentEditor(TDzHTMLText, TDHPropEdit); 93 | end; 94 | 95 | end. 96 | -------------------------------------------------------------------------------- /Source/DzHTMLText_FMX.dpk: -------------------------------------------------------------------------------- 1 | package DzHTMLText_FMX; 2 | 3 | {$R *.res} 4 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} 5 | {$ALIGN 8} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO OFF} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS OFF} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION ON} 16 | {$OVERFLOWCHECKS OFF} 17 | {$RANGECHECKS OFF} 18 | {$REFERENCEINFO OFF} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES OFF} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DEFINE RELEASE} 27 | {$ENDIF IMPLICITBUILDING} 28 | {$DESCRIPTION 'Digao Dalpiaz - DzHTMLText Component - FMX Runtime'} 29 | {$RUNONLY} 30 | {$IMPLICITBUILD ON} 31 | 32 | requires 33 | fmx; 34 | 35 | contains 36 | FMX.DHCommon in 'FMX.DHCommon.pas', 37 | FMX.DHTokenEngine in 'FMX.DHTokenEngine.pas', 38 | FMX.DzHTMLText in 'FMX.DzHTMLText.pas'; 39 | 40 | end. 41 | -------------------------------------------------------------------------------- /Source/DzHTMLText_FMX.dproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {50D42D48-A4FC-4D2B-B355-507FA7D263DF} 4 | DzHTMLText_FMX.dpk 5 | 19.5 6 | FMX 7 | True 8 | Release 9 | Win32 10 | 2 11 | Package 12 | 13 | 14 | true 15 | 16 | 17 | true 18 | Base 19 | true 20 | 21 | 22 | true 23 | Base 24 | true 25 | 26 | 27 | true 28 | Base 29 | true 30 | 31 | 32 | true 33 | Cfg_1 34 | true 35 | true 36 | 37 | 38 | true 39 | Base 40 | true 41 | 42 | 43 | true 44 | Cfg_2 45 | true 46 | true 47 | 48 | 49 | ..\Lib\$(Platform)\$(Config) 50 | .\$(Platform)\$(Config) 51 | false 52 | false 53 | false 54 | false 55 | false 56 | true 57 | true 58 | System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) 59 | All 60 | DzHTMLText_FMX 61 | 1033 62 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 63 | Digao Dalpiaz - DzHTMLText Component - FMX Runtime 64 | true 65 | 66 | 67 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 68 | Debug 69 | true 70 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 71 | 1033 72 | 73 | 74 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) 75 | Debug 76 | true 77 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 78 | 1033 79 | 80 | 81 | DEBUG;$(DCC_Define) 82 | true 83 | false 84 | true 85 | true 86 | true 87 | true 88 | true 89 | 90 | 91 | false 92 | 93 | 94 | false 95 | RELEASE;$(DCC_Define) 96 | 0 97 | 98 | 99 | true 100 | 101 | 102 | 103 | MainSource 104 | 105 | 106 | 107 | 108 | 109 | 110 | Base 111 | 112 | 113 | Cfg_1 114 | Base 115 | 116 | 117 | Cfg_2 118 | Base 119 | 120 | 121 | 122 | Delphi.Personality.12 123 | Package 124 | 125 | 126 | 127 | DzHTMLText_FMX.dpk 128 | 129 | 130 | 131 | True 132 | True 133 | 134 | 135 | 12 136 | 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /Source/DzHTMLText_FMX.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digao-dalpiaz/DzHTMLText/79ce4d3998fc77b891cdacfe2c699208cb7bcad0/Source/DzHTMLText_FMX.res -------------------------------------------------------------------------------- /Source/DzHTMLText_VCL.dpk: -------------------------------------------------------------------------------- 1 | package DzHTMLText_VCL; 2 | 3 | {$R *.res} 4 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} 5 | {$ALIGN 8} 6 | {$ASSERTIONS ON} 7 | {$BOOLEVAL OFF} 8 | {$DEBUGINFO OFF} 9 | {$EXTENDEDSYNTAX ON} 10 | {$IMPORTEDDATA ON} 11 | {$IOCHECKS ON} 12 | {$LOCALSYMBOLS OFF} 13 | {$LONGSTRINGS ON} 14 | {$OPENSTRINGS ON} 15 | {$OPTIMIZATION ON} 16 | {$OVERFLOWCHECKS OFF} 17 | {$RANGECHECKS OFF} 18 | {$REFERENCEINFO OFF} 19 | {$SAFEDIVIDE OFF} 20 | {$STACKFRAMES OFF} 21 | {$TYPEDADDRESS OFF} 22 | {$VARSTRINGCHECKS ON} 23 | {$WRITEABLECONST OFF} 24 | {$MINENUMSIZE 1} 25 | {$IMAGEBASE $400000} 26 | {$DEFINE RELEASE} 27 | {$ENDIF IMPLICITBUILDING} 28 | {$DESCRIPTION 'Digao Dalpiaz - DzHTMLText Component - VCL Runtime'} 29 | {$RUNONLY} 30 | {$IMPLICITBUILD ON} 31 | 32 | requires 33 | rtl, 34 | vcl, 35 | vclimg; 36 | 37 | contains 38 | Vcl.DHCommon in 'Vcl.DHCommon.pas', 39 | Vcl.DHTokenEngine in 'Vcl.DHTokenEngine.pas', 40 | Vcl.DzHTMLText in 'Vcl.DzHTMLText.pas'; 41 | 42 | end. 43 | -------------------------------------------------------------------------------- /Source/DzHTMLText_VCL.dproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {DD004D11-69DF-4237-8DA8-94C76D6B7B6D} 4 | DzHTMLText_VCL.dpk 5 | 19.5 6 | VCL 7 | True 8 | Release 9 | Win32 10 | 2 11 | Package 12 | 13 | 14 | true 15 | 16 | 17 | true 18 | Base 19 | true 20 | 21 | 22 | true 23 | Base 24 | true 25 | 26 | 27 | true 28 | Base 29 | true 30 | 31 | 32 | true 33 | Cfg_1 34 | true 35 | true 36 | 37 | 38 | true 39 | Base 40 | true 41 | 42 | 43 | true 44 | Cfg_2 45 | true 46 | true 47 | 48 | 49 | ..\Lib\$(Platform)\$(Config) 50 | .\$(Platform)\$(Config) 51 | false 52 | false 53 | false 54 | false 55 | false 56 | true 57 | true 58 | System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace) 59 | All 60 | DzHTMLText_VCL 61 | 1033 62 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 63 | Digao Dalpiaz - DzHTMLText Component - VCL Runtime 64 | true 65 | 66 | 67 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 68 | Debug 69 | true 70 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 71 | 1033 72 | 73 | 74 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) 75 | Debug 76 | true 77 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 78 | 1033 79 | 80 | 81 | DEBUG;$(DCC_Define) 82 | true 83 | false 84 | true 85 | true 86 | true 87 | true 88 | true 89 | 90 | 91 | false 92 | 93 | 94 | false 95 | RELEASE;$(DCC_Define) 96 | 0 97 | 98 | 99 | true 100 | 101 | 102 | 103 | MainSource 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | Base 113 | 114 | 115 | Cfg_1 116 | Base 117 | 118 | 119 | Cfg_2 120 | Base 121 | 122 | 123 | 124 | Delphi.Personality.12 125 | Package 126 | 127 | 128 | 129 | DzHTMLText_VCL.dpk 130 | 131 | 132 | 133 | True 134 | True 135 | 136 | 137 | 12 138 | 139 | 140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /Source/DzHTMLText_VCL.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digao-dalpiaz/DzHTMLText/79ce4d3998fc77b891cdacfe2c699208cb7bcad0/Source/DzHTMLText_VCL.res -------------------------------------------------------------------------------- /Source/FMX.DHCommon.pas: -------------------------------------------------------------------------------- 1 | unit FMX.DHCommon; 2 | {$DEFINE FMX} 3 | {$INCLUDE 'Vcl.DHCommon.pas'} 4 | 5 | -------------------------------------------------------------------------------- /Source/FMX.DHTokenEngine.pas: -------------------------------------------------------------------------------- 1 | unit FMX.DHTokenEngine; 2 | {$DEFINE FMX} 3 | {$INCLUDE 'Vcl.DHTokenEngine.pas'} 4 | -------------------------------------------------------------------------------- /Source/FMX.DzHTMLText.pas: -------------------------------------------------------------------------------- 1 | unit FMX.DzHTMLText; 2 | {$DEFINE FMX} 3 | {$INCLUDE 'Vcl.DzHTMLText.pas'} 4 | -------------------------------------------------------------------------------- /Source/Types.inc: -------------------------------------------------------------------------------- 1 | type 2 | {$IFDEF FPC} 3 | TObjectList = class(TFPGObjectList); 4 | TList = class(TFPGList); 5 | {$ENDIF} 6 | 7 | {$IFDEF FMX} 8 | TAnyRect = TRectF; 9 | TAnyPoint = TPointF; 10 | TAnySize = TSizeF; 11 | TAnyColor = TAlphaColor; 12 | TAnyBitmap = FMX.{$IFDEF USE_NEW_UNITS}Graphics{$ELSE}Types{$ENDIF}.TBitmap; 13 | TAnyPicture = FMX.{$IFDEF USE_NEW_UNITS}Graphics{$ELSE}Types{$ENDIF}.TBitmap; 14 | {$ELSE} 15 | TAnyRect = TRect; 16 | TAnyPoint = TPoint; 17 | TAnySize = TSize; 18 | TAnyColor = TColor; 19 | TAnyBitmap = {$IFDEF DCC}Vcl.{$ENDIF}Graphics.TBitmap; 20 | TAnyPicture = TPicture; 21 | {$ENDIF} 22 | 23 | TPixels = {$IFDEF FMX}Single{$ELSE}Integer{$ENDIF}; 24 | 25 | {$IFDEF FMX} 26 | const clNone = TAlphaColors.Null; 27 | {$ENDIF} 28 | 29 | -------------------------------------------------------------------------------- /Source/Vcl.DHCommon.pas: -------------------------------------------------------------------------------- 1 | {$IFNDEF FMX}unit Vcl.DHCommon;{$ENDIF} 2 | 3 | {$INCLUDE Defines.inc} 4 | 5 | interface 6 | 7 | uses 8 | {$IFDEF FMX}FMX.DzHTMLText{$ELSE}Vcl.DzHTMLText{$ENDIF}, 9 | {$IFDEF FPC} 10 | Types, SysUtils, Graphics, FGL 11 | {$ELSE} 12 | System.Types, System.UITypes, System.SysUtils, 13 | {$IFDEF FMX} 14 | FMX.Types 15 | {$IFDEF USE_NEW_UNITS}, FMX.Graphics{$ENDIF} 16 | {$ELSE} 17 | Vcl.Graphics 18 | {$ENDIF} 19 | {$ENDIF}; 20 | 21 | const 22 | STR_SPACE = ' '; 23 | 24 | {$INCLUDE Types.inc} 25 | type 26 | TDHMultipleTokenParams = class 27 | private 28 | Params: TArray; 29 | public 30 | constructor Create(const StrParams: string); 31 | 32 | function GetParam(const Name: string): string; 33 | function GetParamAsPixels(const Name: string; Def: TPixels): TPixels; 34 | function GetParamAsColor(const Name: string): TAnyColor; 35 | function GetFirstParam: string; 36 | function ParamExists(const Name: string): Boolean; 37 | end; 38 | 39 | TDHCharUtils = class 40 | private 41 | class function IsCJKChar(const C: Char): Boolean; inline; 42 | public 43 | class function IsPunctuationChar(const C: Char): Boolean; 44 | class function FindNextWordBreakChar(const A: string; From: Integer): Integer; inline; 45 | end; 46 | 47 | function SplitStr(const Str, Separator: string; var Left: string; var Right: string): Boolean; 48 | 49 | procedure DefineFontColor(C: TCanvas; Color: TAnyColor); 50 | function GetGenericFontColor(C: TCanvas): TAnyColor; 51 | procedure DefineFontPt(F: TFont; Pt: TPixels; Lb: TDzHTMLText); 52 | function GetGenericFontPt(F: TFont): TPixels; 53 | procedure DefineFontName(F: TFont; const Name: string); 54 | function GetGenericFontName(F: TFont): string; 55 | procedure DefineFillColor(C: TCanvas; Color: TAnyColor); 56 | function GetGenericFillColor(C: TCanvas): TAnyColor; 57 | 58 | procedure GenericFillRect(Lb: TDzHTMLText; C: TCanvas; R: TAnyRect; FixPrecisionFMX: Boolean = False); 59 | 60 | function ParamToColor(const Param: string): TAnyColor; 61 | 62 | function StrToPixels(const StrValue: string; Def: TPixels): TPixels; 63 | 64 | function RoundIfVCL(Value: Extended): TPixels; 65 | 66 | function ParamToHorzAlign(const Param: string): TDHHorzAlign; 67 | function ParamToVertAlign(const Param: string): TDHVertAlign; 68 | 69 | implementation 70 | 71 | {$IFDEF FMX}uses System.UIConsts;{$ENDIF} 72 | 73 | {$REGION 'THTMLTokenParams'} 74 | constructor TDHMultipleTokenParams.Create(const StrParams: string); 75 | begin 76 | Params := StrParams.Split([',']); 77 | end; 78 | 79 | function TDHMultipleTokenParams.GetParam(const Name: string): string; 80 | var 81 | Param: string; 82 | Left, Right: string; 83 | begin 84 | for Param in Params do 85 | begin 86 | if not SplitStr(Param, '=', Left, Right) then Continue; 87 | 88 | if SameText(Left, Name) then 89 | Exit(Right); 90 | end; 91 | 92 | Result := EmptyStr; 93 | end; 94 | 95 | function TDHMultipleTokenParams.GetParamAsPixels(const Name: string; Def: TPixels): TPixels; 96 | begin 97 | Result := StrToPixels(GetParam(Name), Def) 98 | end; 99 | 100 | function TDHMultipleTokenParams.GetParamAsColor(const Name: string): TAnyColor; 101 | begin 102 | Result := ParamToColor(GetParam(Name)); 103 | end; 104 | 105 | function TDHMultipleTokenParams.ParamExists(const Name: string): Boolean; 106 | var 107 | Param: string; 108 | begin 109 | for Param in Params do 110 | if SameText(Param, Name) then Exit(True); 111 | 112 | Result := False; 113 | end; 114 | 115 | function TDHMultipleTokenParams.GetFirstParam: string; 116 | begin 117 | if Length(Params)>0 then 118 | Result := Params[0] 119 | else 120 | Result := EmptyStr; //if tag string param is empty, split results in empty array 121 | end; 122 | {$ENDREGION} 123 | 124 | {$REGION 'TDHCharUtils'} 125 | class function TDHCharUtils.FindNextWordBreakChar(const A: string; From: Integer): Integer; 126 | var 127 | I: Integer; 128 | C: Char; 129 | begin 130 | for I := From to A.Length do 131 | begin 132 | C := A[I]; 133 | 134 | if CharInSet(C, [STR_SPACE,'<','>','/','\',#13,#10]) or IsPunctuationChar(C) or IsCJKChar(C) then 135 | Exit(I); 136 | end; 137 | 138 | Result := 0; 139 | end; 140 | 141 | class function TDHCharUtils.IsPunctuationChar(const C: Char): Boolean; 142 | 143 | function IsArabic: Boolean; 144 | begin 145 | Result := False; 146 | case Integer(C) of 147 | $060C, //comma 148 | $061B //semicolon 149 | : Result := True; 150 | end; 151 | end; 152 | 153 | begin 154 | Result := CharInSet(C, ['?','.',':',',',';','!']) or IsArabic; 155 | end; 156 | 157 | class function TDHCharUtils.IsCJKChar(const C: Char): Boolean; //return if char is Chinese-Japanese-Korean 158 | begin 159 | //East Asian languages break lines in all chars, so each char must be considered as a full word. 160 | { 161 | Block Range Comment 162 | CJK Unified Ideographs 4E00-9FFF Common 163 | CJK Unified Ideographs Extension A 3400-4DBF Rare 164 | CJK Unified Ideographs Extension B 20000-2A6DF Rare, historic 165 | CJK Unified Ideographs Extension C 2A700-2B73F Rare, historic 166 | CJK Unified Ideographs Extension D 2B740-2B81F Uncommon, some in current use 167 | CJK Unified Ideographs Extension E 2B820-2CEAF Rare, historic 168 | CJK Compatibility Ideographs F900-FAFF Duplicates, unifiable variants, corporate characters 169 | CJK Compatibility Ideographs Supplement 2F800-2FA1F Unifiable variants 170 | } 171 | if C < #10000 then Exit(False); //fast check 172 | 173 | case Integer(C) of 174 | $4E00..$9FFF, 175 | $3400..$4DBF, 176 | $20000..$2A6DF, 177 | $2A700..$2B73F, 178 | $2B740..$2B81F, 179 | $2B820..$2CEAF, 180 | $F900..$FAFF, 181 | $2F800..$2FA1F: Exit(True); 182 | end; 183 | 184 | Result := False; 185 | end; 186 | {$ENDREGION} 187 | 188 | function SplitStr(const Str, Separator: string; var Left: string; var Right: string): Boolean; 189 | var 190 | I: Integer; 191 | begin 192 | I := Str.IndexOf(Separator); 193 | Result := I>-1; 194 | if Result then 195 | begin 196 | Left := Str.Substring(0, I).Trim; 197 | Right := Str.Substring(I+Separator.Length).Trim; 198 | end; 199 | end; 200 | 201 | function GetDecimalSettings: TFormatSettings; 202 | begin 203 | Result := Default(TFormatSettings); 204 | Result.DecimalSeparator := '.'; 205 | end; 206 | 207 | function StrToFloatDefPoint(const StrValue: string; Def: Extended): Extended; 208 | begin 209 | Result := StrToFloatDef(StrValue, Def, GetDecimalSettings); 210 | end; 211 | 212 | function StrToPixels(const StrValue: string; Def: TPixels): TPixels; 213 | begin 214 | Result := 215 | {$IFDEF FMX} 216 | StrToFloatDefPoint(StrValue, Def) 217 | {$ELSE} 218 | StrToIntDef(StrValue, Def) 219 | {$ENDIF}; 220 | end; 221 | 222 | function ParamToColor(const Param: string): TAnyColor; 223 | 224 | function FillParts(const Value: string; var P1: string; var P2: string; var P3: string; var P4: string): Boolean; 225 | begin 226 | if Value.Length<>9 then Exit(False); 227 | 228 | P1 := Copy(Value, 2, 2); 229 | P2 := Copy(Value, 4, 2); 230 | P3 := Copy(Value, 6, 2); 231 | P4 := Copy(Value, 8, 2); 232 | 233 | Result := True; 234 | end; 235 | 236 | const 237 | SOLID_VCL = '00'; 238 | SOLID_FMX = 'FF'; 239 | var 240 | A, Alpha, R, G, B: string; 241 | IsHex: Boolean; 242 | begin 243 | Result := clNone; 244 | 245 | A := Param; 246 | if A.IsEmpty then Exit; 247 | 248 | IsHex := False; 249 | case A[1] of 250 | '$': //Delphi VCL notation (BGR) 251 | begin 252 | if not FillParts(A, Alpha, B, G, R) then Exit; 253 | if Alpha<>SOLID_VCL then Exit; //vcl only supports solid colors 254 | {$IFDEF FMX}Alpha := SOLID_FMX;{$ENDIF} 255 | IsHex := True; 256 | end; 257 | 258 | '#': //HTML notation or Delphi FMX notation (RGB) 259 | begin 260 | if A.Length=7 then Insert(SOLID_FMX, A, 2); 261 | if not FillParts(A, Alpha, R, G, B) then Exit; 262 | {$IFDEF VCL}if Alpha<>SOLID_FMX then Exit;{$ENDIF} //vcl only supports solid colors 263 | IsHex := True; 264 | end; 265 | end; 266 | 267 | if IsHex then 268 | A := '$'+{$IFDEF FMX}Alpha+R+G+B{$ELSE}SOLID_VCL+B+G+R{$ENDIF}; 269 | 270 | try 271 | Result := {$IFDEF FMX}StringToAlphaColor(A){$ELSE}StringToColor(A){$ENDIF}; 272 | except 273 | //invalid color 274 | end; 275 | end; 276 | 277 | procedure DefineFontColor(C: TCanvas; Color: TAnyColor); 278 | begin 279 | C.{$IFDEF FMX}Stroke{$ELSE}Font{$ENDIF}.Color := Color; 280 | end; 281 | 282 | function GetGenericFontColor(C: TCanvas): TAnyColor; 283 | begin 284 | Result := C.{$IFDEF FMX}Stroke{$ELSE}Font{$ENDIF}.Color; 285 | end; 286 | 287 | procedure DefineFontPt(F: TFont; Pt: TPixels; Lb: TDzHTMLText); 288 | begin 289 | {$IFDEF VCL}Pt := Lb.CalcFontHeight(Pt);{$ENDIF} 290 | 291 | F.{$IFDEF FMX}Size{$ELSE}Height{$ENDIF} := Pt; 292 | end; 293 | 294 | function GetGenericFontPt(F: TFont): TPixels; 295 | begin 296 | Result := F.{$IFDEF FMX}Size{$ELSE}Height{$ENDIF}; 297 | end; 298 | 299 | procedure DefineFontName(F: TFont; const Name: string); 300 | begin 301 | F.{$IFDEF FMX}Family{$ELSE}Name{$ENDIF} := Name; 302 | end; 303 | 304 | function GetGenericFontName(F: TFont): string; 305 | begin 306 | Result := F.{$IFDEF FMX}Family{$ELSE}Name{$ENDIF}; 307 | end; 308 | 309 | procedure DefineFillColor(C: TCanvas; Color: TAnyColor); 310 | begin 311 | C.{$IFDEF FMX}Fill{$ELSE}Brush{$ENDIF}.Color := Color; 312 | end; 313 | 314 | function GetGenericFillColor(C: TCanvas): TAnyColor; 315 | begin 316 | Result := C.{$IFDEF FMX}Fill{$ELSE}Brush{$ENDIF}.Color; 317 | end; 318 | 319 | procedure GenericFillRect(Lb: TDzHTMLText; C: TCanvas; R: TAnyRect; FixPrecisionFMX: Boolean = False); 320 | begin 321 | {$IFDEF FMX} 322 | if FixPrecisionFMX then R.Left := Trunc(R.Left); 323 | {$ENDIF} 324 | 325 | C.FillRect( 326 | {$IFDEF FMX} 327 | R, 0, 0, [], Lb.Opacity 328 | {$ELSE} 329 | R 330 | {$ENDIF}); 331 | end; 332 | 333 | function RoundIfVCL(Value: Extended): TPixels; 334 | begin 335 | Result := {$IFDEF VCL}Round{$ENDIF}(Value); 336 | end; 337 | 338 | function ParamToHorzAlign(const Param: string): TDHHorzAlign; 339 | begin 340 | if SameText(Param, 'left') then Result := haLeft else 341 | if SameText(Param, 'center') then Result := haCenter else 342 | if SameText(Param, 'right') then Result := haRight else 343 | Result := haLeft; 344 | end; 345 | 346 | function ParamToVertAlign(const Param: string): TDHVertAlign; 347 | begin 348 | if SameText(Param, 'top') then Result := vaTop else 349 | if SameText(Param, 'center') then Result := vaCenter else 350 | if SameText(Param, 'bottom') then Result := vaBottom else 351 | Result := vaTop; 352 | end; 353 | 354 | end. 355 | -------------------------------------------------------------------------------- /Test/TestApp.dpr: -------------------------------------------------------------------------------- 1 | program TestApp; 2 | 3 | uses 4 | Vcl.Forms, 5 | UFrmMain in 'UFrmMain.pas' {FrmMain}; 6 | 7 | {$R *.res} 8 | 9 | begin 10 | Application.Initialize; 11 | Application.MainFormOnTaskbar := True; 12 | Application.CreateForm(TFrmMain, FrmMain); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /Test/TestApp.dproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {8D65E6E8-CD34-4125-ABA8-3DEF2EBEAF3D} 4 | 19.5 5 | VCL 6 | TestApp.dpr 7 | True 8 | Debug 9 | Win32 10 | 1 11 | Application 12 | 13 | 14 | true 15 | 16 | 17 | true 18 | Base 19 | true 20 | 21 | 22 | true 23 | Base 24 | true 25 | 26 | 27 | true 28 | Base 29 | true 30 | 31 | 32 | true 33 | Cfg_1 34 | true 35 | true 36 | 37 | 38 | true 39 | Cfg_1 40 | true 41 | true 42 | 43 | 44 | true 45 | Base 46 | true 47 | 48 | 49 | true 50 | Cfg_2 51 | true 52 | true 53 | 54 | 55 | true 56 | Cfg_2 57 | true 58 | true 59 | 60 | 61 | .\$(Platform)\$(Config) 62 | .\$(Platform)\$(Config) 63 | false 64 | false 65 | false 66 | false 67 | false 68 | System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace) 69 | $(BDS)\bin\delphi_PROJECTICON.ico 70 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png 71 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png 72 | TestApp 73 | 74 | 75 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 76 | Debug 77 | true 78 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 79 | 1033 80 | $(BDS)\bin\default_app.manifest 81 | 82 | 83 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) 84 | Debug 85 | true 86 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 87 | 1033 88 | $(BDS)\bin\default_app.manifest 89 | 90 | 91 | DEBUG;$(DCC_Define) 92 | true 93 | false 94 | true 95 | true 96 | true 97 | 98 | 99 | false 100 | true 101 | PerMonitorV2 102 | 103 | 104 | PerMonitorV2 105 | 106 | 107 | false 108 | RELEASE;$(DCC_Define) 109 | 0 110 | 0 111 | 112 | 113 | true 114 | PerMonitorV2 115 | 116 | 117 | PerMonitorV2 118 | 119 | 120 | 121 | MainSource 122 | 123 | 124 |
      FrmMain
      125 | dfm 126 |
      127 | 128 | Base 129 | 130 | 131 | Cfg_1 132 | Base 133 | 134 | 135 | Cfg_2 136 | Base 137 | 138 |
      139 | 140 | Delphi.Personality.12 141 | Application 142 | 143 | 144 | 145 | TestApp.dpr 146 | 147 | 148 | 149 | 150 | 151 | TestApp.exe 152 | true 153 | 154 | 155 | 156 | 157 | 1 158 | 159 | 160 | Contents\MacOS 161 | 1 162 | 163 | 164 | 0 165 | 166 | 167 | 168 | 169 | classes 170 | 1 171 | 172 | 173 | classes 174 | 1 175 | 176 | 177 | 178 | 179 | res\xml 180 | 1 181 | 182 | 183 | res\xml 184 | 1 185 | 186 | 187 | 188 | 189 | library\lib\armeabi-v7a 190 | 1 191 | 192 | 193 | 194 | 195 | library\lib\armeabi 196 | 1 197 | 198 | 199 | library\lib\armeabi 200 | 1 201 | 202 | 203 | 204 | 205 | library\lib\armeabi-v7a 206 | 1 207 | 208 | 209 | 210 | 211 | library\lib\mips 212 | 1 213 | 214 | 215 | library\lib\mips 216 | 1 217 | 218 | 219 | 220 | 221 | library\lib\armeabi-v7a 222 | 1 223 | 224 | 225 | library\lib\arm64-v8a 226 | 1 227 | 228 | 229 | 230 | 231 | library\lib\armeabi-v7a 232 | 1 233 | 234 | 235 | 236 | 237 | res\drawable 238 | 1 239 | 240 | 241 | res\drawable 242 | 1 243 | 244 | 245 | 246 | 247 | res\values 248 | 1 249 | 250 | 251 | res\values 252 | 1 253 | 254 | 255 | 256 | 257 | res\values-v21 258 | 1 259 | 260 | 261 | res\values-v21 262 | 1 263 | 264 | 265 | 266 | 267 | res\values 268 | 1 269 | 270 | 271 | res\values 272 | 1 273 | 274 | 275 | 276 | 277 | res\drawable 278 | 1 279 | 280 | 281 | res\drawable 282 | 1 283 | 284 | 285 | 286 | 287 | res\drawable-xxhdpi 288 | 1 289 | 290 | 291 | res\drawable-xxhdpi 292 | 1 293 | 294 | 295 | 296 | 297 | res\drawable-ldpi 298 | 1 299 | 300 | 301 | res\drawable-ldpi 302 | 1 303 | 304 | 305 | 306 | 307 | res\drawable-mdpi 308 | 1 309 | 310 | 311 | res\drawable-mdpi 312 | 1 313 | 314 | 315 | 316 | 317 | res\drawable-hdpi 318 | 1 319 | 320 | 321 | res\drawable-hdpi 322 | 1 323 | 324 | 325 | 326 | 327 | res\drawable-xhdpi 328 | 1 329 | 330 | 331 | res\drawable-xhdpi 332 | 1 333 | 334 | 335 | 336 | 337 | res\drawable-mdpi 338 | 1 339 | 340 | 341 | res\drawable-mdpi 342 | 1 343 | 344 | 345 | 346 | 347 | res\drawable-hdpi 348 | 1 349 | 350 | 351 | res\drawable-hdpi 352 | 1 353 | 354 | 355 | 356 | 357 | res\drawable-xhdpi 358 | 1 359 | 360 | 361 | res\drawable-xhdpi 362 | 1 363 | 364 | 365 | 366 | 367 | res\drawable-xxhdpi 368 | 1 369 | 370 | 371 | res\drawable-xxhdpi 372 | 1 373 | 374 | 375 | 376 | 377 | res\drawable-xxxhdpi 378 | 1 379 | 380 | 381 | res\drawable-xxxhdpi 382 | 1 383 | 384 | 385 | 386 | 387 | res\drawable-small 388 | 1 389 | 390 | 391 | res\drawable-small 392 | 1 393 | 394 | 395 | 396 | 397 | res\drawable-normal 398 | 1 399 | 400 | 401 | res\drawable-normal 402 | 1 403 | 404 | 405 | 406 | 407 | res\drawable-large 408 | 1 409 | 410 | 411 | res\drawable-large 412 | 1 413 | 414 | 415 | 416 | 417 | res\drawable-xlarge 418 | 1 419 | 420 | 421 | res\drawable-xlarge 422 | 1 423 | 424 | 425 | 426 | 427 | res\values 428 | 1 429 | 430 | 431 | res\values 432 | 1 433 | 434 | 435 | 436 | 437 | 1 438 | 439 | 440 | Contents\MacOS 441 | 1 442 | 443 | 444 | 0 445 | 446 | 447 | 448 | 449 | Contents\MacOS 450 | 1 451 | .framework 452 | 453 | 454 | Contents\MacOS 455 | 1 456 | .framework 457 | 458 | 459 | 0 460 | 461 | 462 | 463 | 464 | 1 465 | .dylib 466 | 467 | 468 | 1 469 | .dylib 470 | 471 | 472 | 1 473 | .dylib 474 | 475 | 476 | Contents\MacOS 477 | 1 478 | .dylib 479 | 480 | 481 | Contents\MacOS 482 | 1 483 | .dylib 484 | 485 | 486 | 0 487 | .dll;.bpl 488 | 489 | 490 | 491 | 492 | 1 493 | .dylib 494 | 495 | 496 | 1 497 | .dylib 498 | 499 | 500 | 1 501 | .dylib 502 | 503 | 504 | Contents\MacOS 505 | 1 506 | .dylib 507 | 508 | 509 | Contents\MacOS 510 | 1 511 | .dylib 512 | 513 | 514 | 0 515 | .bpl 516 | 517 | 518 | 519 | 520 | 0 521 | 522 | 523 | 0 524 | 525 | 526 | 0 527 | 528 | 529 | 0 530 | 531 | 532 | 0 533 | 534 | 535 | Contents\Resources\StartUp\ 536 | 0 537 | 538 | 539 | Contents\Resources\StartUp\ 540 | 0 541 | 542 | 543 | 0 544 | 545 | 546 | 547 | 548 | 1 549 | 550 | 551 | 1 552 | 553 | 554 | 1 555 | 556 | 557 | 558 | 559 | 1 560 | 561 | 562 | 1 563 | 564 | 565 | 1 566 | 567 | 568 | 569 | 570 | 1 571 | 572 | 573 | 1 574 | 575 | 576 | 1 577 | 578 | 579 | 580 | 581 | 1 582 | 583 | 584 | 1 585 | 586 | 587 | 1 588 | 589 | 590 | 591 | 592 | 1 593 | 594 | 595 | 1 596 | 597 | 598 | 1 599 | 600 | 601 | 602 | 603 | 1 604 | 605 | 606 | 1 607 | 608 | 609 | 1 610 | 611 | 612 | 613 | 614 | 1 615 | 616 | 617 | 1 618 | 619 | 620 | 1 621 | 622 | 623 | 624 | 625 | 1 626 | 627 | 628 | 1 629 | 630 | 631 | 1 632 | 633 | 634 | 635 | 636 | 1 637 | 638 | 639 | 1 640 | 641 | 642 | 1 643 | 644 | 645 | 646 | 647 | 1 648 | 649 | 650 | 1 651 | 652 | 653 | 1 654 | 655 | 656 | 657 | 658 | 1 659 | 660 | 661 | 1 662 | 663 | 664 | 1 665 | 666 | 667 | 668 | 669 | 1 670 | 671 | 672 | 1 673 | 674 | 675 | 1 676 | 677 | 678 | 679 | 680 | 1 681 | 682 | 683 | 1 684 | 685 | 686 | 1 687 | 688 | 689 | 690 | 691 | 1 692 | 693 | 694 | 1 695 | 696 | 697 | 1 698 | 699 | 700 | 701 | 702 | 1 703 | 704 | 705 | 1 706 | 707 | 708 | 1 709 | 710 | 711 | 712 | 713 | 1 714 | 715 | 716 | 1 717 | 718 | 719 | 1 720 | 721 | 722 | 723 | 724 | 1 725 | 726 | 727 | 1 728 | 729 | 730 | 1 731 | 732 | 733 | 734 | 735 | 1 736 | 737 | 738 | 1 739 | 740 | 741 | 1 742 | 743 | 744 | 745 | 746 | 1 747 | 748 | 749 | 1 750 | 751 | 752 | 1 753 | 754 | 755 | 756 | 757 | 1 758 | 759 | 760 | 1 761 | 762 | 763 | 1 764 | 765 | 766 | 767 | 768 | 1 769 | 770 | 771 | 1 772 | 773 | 774 | 1 775 | 776 | 777 | 778 | 779 | 1 780 | 781 | 782 | 1 783 | 784 | 785 | 1 786 | 787 | 788 | 789 | 790 | 1 791 | 792 | 793 | 1 794 | 795 | 796 | 1 797 | 798 | 799 | 800 | 801 | 1 802 | 803 | 804 | 1 805 | 806 | 807 | 1 808 | 809 | 810 | 811 | 812 | 1 813 | 814 | 815 | 1 816 | 817 | 818 | 819 | 820 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 821 | 1 822 | 823 | 824 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 825 | 1 826 | 827 | 828 | 829 | 830 | 1 831 | 832 | 833 | 1 834 | 835 | 836 | 837 | 838 | ..\ 839 | 1 840 | 841 | 842 | ..\ 843 | 1 844 | 845 | 846 | 847 | 848 | 1 849 | 850 | 851 | 1 852 | 853 | 854 | 1 855 | 856 | 857 | 858 | 859 | 1 860 | 861 | 862 | 1 863 | 864 | 865 | 1 866 | 867 | 868 | 869 | 870 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 871 | 1 872 | 873 | 874 | 875 | 876 | ..\ 877 | 1 878 | 879 | 880 | ..\ 881 | 1 882 | 883 | 884 | 885 | 886 | Contents 887 | 1 888 | 889 | 890 | Contents 891 | 1 892 | 893 | 894 | 895 | 896 | Contents\Resources 897 | 1 898 | 899 | 900 | Contents\Resources 901 | 1 902 | 903 | 904 | 905 | 906 | library\lib\armeabi-v7a 907 | 1 908 | 909 | 910 | library\lib\arm64-v8a 911 | 1 912 | 913 | 914 | 1 915 | 916 | 917 | 1 918 | 919 | 920 | 1 921 | 922 | 923 | 1 924 | 925 | 926 | Contents\MacOS 927 | 1 928 | 929 | 930 | Contents\MacOS 931 | 1 932 | 933 | 934 | 0 935 | 936 | 937 | 938 | 939 | library\lib\armeabi-v7a 940 | 1 941 | 942 | 943 | 944 | 945 | 1 946 | 947 | 948 | 1 949 | 950 | 951 | 952 | 953 | Assets 954 | 1 955 | 956 | 957 | Assets 958 | 1 959 | 960 | 961 | 962 | 963 | Assets 964 | 1 965 | 966 | 967 | Assets 968 | 1 969 | 970 | 971 | 972 | 973 | 974 | 975 | 976 | 977 | 978 | 979 | 980 | 981 | 982 | 983 | True 984 | False 985 | 986 | 987 | 12 988 | 989 | 990 | 991 | 992 |
      993 | -------------------------------------------------------------------------------- /Test/TestApp.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digao-dalpiaz/DzHTMLText/79ce4d3998fc77b891cdacfe2c699208cb7bcad0/Test/TestApp.res -------------------------------------------------------------------------------- /Test/UFrmMain.dfm: -------------------------------------------------------------------------------- 1 | object FrmMain: TFrmMain 2 | Left = 0 3 | Top = 0 4 | Caption = 'FrmMain' 5 | ClientHeight = 662 6 | ClientWidth = 831 7 | Color = clBtnFace 8 | Font.Charset = DEFAULT_CHARSET 9 | Font.Color = clWindowText 10 | Font.Height = -11 11 | Font.Name = 'Tahoma' 12 | Font.Style = [] 13 | OnCreate = FormCreate 14 | TextHeight = 13 15 | object DzHTMLText1: TDzHTMLText 16 | Left = 8 17 | Top = 8 18 | Width = 153 19 | Height = 81 20 | Font.Charset = ANSI_CHARSET 21 | Font.Color = clWindowText 22 | Font.Height = -19 23 | Font.Name = 'Courier New' 24 | Font.Style = [] 25 | Color = clWhite 26 | ParentColor = False 27 | ParentFont = False 28 | Lines.Strings = ( 29 | 'text spacing test') 30 | end 31 | object DzHTMLText2: TDzHTMLText 32 | Left = 8 33 | Top = 96 34 | Width = 153 35 | Height = 89 36 | Font.Charset = ANSI_CHARSET 37 | Font.Color = clWindowText 38 | Font.Height = -19 39 | Font.Name = 'Courier New' 40 | Font.Style = [] 41 | Color = clWhite 42 | ParentColor = False 43 | ParentFont = False 44 | Lines.Strings = ( 45 | 46 | 'text <' + 47 | '/bc>spacing test') 48 | end 49 | object DzHTMLText3: TDzHTMLText 50 | Left = 168 51 | Top = 8 52 | Width = 289 53 | Height = 169 54 | Font.Charset = DEFAULT_CHARSET 55 | Font.Color = clWindowText 56 | Font.Height = -13 57 | Font.Name = 'Tahoma' 58 | Font.Style = [] 59 | Color = clWhite 60 | ParentColor = False 61 | ParentFont = False 62 | Lines.Strings = ( 63 | 'floating test:' 64 | 'my test panel 1234
      ' 65 | 'Text after floating.' 66 | 67 | 'And' + 68 | ' here a new floating panel abc' 69 | 'Break BIG' 70 | 'Text after second panel') 71 | LineVertAlign = vaCenter 72 | end 73 | object DzHTMLText4: TDzHTMLText 74 | Left = 8 75 | Top = 280 76 | Width = 153 77 | Height = 89 78 | Font.Charset = ANSI_CHARSET 79 | Font.Color = clWindowText 80 | Font.Height = -19 81 | Font.Name = 'Courier New' 82 | Font.Style = [] 83 | Color = clWhite 84 | ParentColor = False 85 | ParentFont = False 86 | Lines.Strings = ( 87 | 88 | 'text spacing test') 90 | end 91 | object DzHTMLText5: TDzHTMLText 92 | Left = 8 93 | Top = 191 94 | Width = 153 95 | Height = 81 96 | Font.Charset = ANSI_CHARSET 97 | Font.Color = clWindowText 98 | Font.Height = -19 99 | Font.Name = 'Courier New' 100 | Font.Style = [] 101 | Color = clWhite 102 | ParentColor = False 103 | ParentFont = False 104 | Lines.Strings = ( 105 | 'text spacing test') 106 | end 107 | object DzHTMLText6: TDzHTMLText 108 | Left = 168 109 | Top = 184 110 | Width = 289 111 | Height = 185 112 | Font.Charset = DEFAULT_CHARSET 113 | Font.Color = clWindowText 114 | Font.Height = -13 115 | Font.Name = 'Tahoma' 116 | Font.Style = [] 117 | Color = clWhite 118 | ParentColor = False 119 | ParentFont = False 120 | Lines.Strings = ( 121 | 'Spoiler Test:' 122 | 'Click here for details' 123 | ' Some detailed info about this spoiler.' 124 | '' 125 | ' Click here for sub-details' 126 | 127 | ' Some detailed info about this sub-spoiler.' 129 | '' 130 | 'You can open first spoiler here too.' 131 | '' 132 | 133 | 'This is more info about the first spoiler') 135 | end 136 | object DzHTMLText7: TDzHTMLText 137 | Left = 463 138 | Top = 8 139 | Width = 281 140 | Height = 195 141 | Font.Charset = DEFAULT_CHARSET 142 | Font.Color = clWindowText 143 | Font.Height = -19 144 | Font.Name = 'Tahoma' 145 | Font.Style = [] 146 | ParentFont = False 147 | Lines.Strings = ( 148 | 'Line 1 (spacing in comp props)' 149 | 'Line 2' 150 | 'Line 3' 151 | '' 152 | 'Line 5 (obs: autoheight enabled)') 153 | AutoHeight = True 154 | LineSpacing = 20 155 | end 156 | object DzHTMLText8: TDzHTMLText 157 | Left = 463 158 | Top = 209 159 | Width = 281 160 | Height = 180 161 | Font.Charset = DEFAULT_CHARSET 162 | Font.Color = clWindowText 163 | Font.Height = -19 164 | Font.Name = 'Tahoma' 165 | Font.Style = [] 166 | ParentFont = False 167 | Lines.Strings = ( 168 | 'Line 1' 169 | 'Line 2 (Line Space: 5px)' 170 | 'Line 3' 171 | '' 172 | 'Line 5 (obs: autoheight enabled)') 173 | AutoHeight = True 174 | LineSpacing = 20 175 | end 176 | object DzHTMLText9: TDzHTMLText 177 | Left = 169 178 | Top = 375 179 | Width = 289 180 | Height = 258 181 | Lines.Strings = ( 182 | 'Header 1' 183 | 'Header 2' 184 | 'Header 3' 185 | 'Header 4' 186 | 'Header 5' 187 | 'Header 6' 188 | 'Header invalid' 189 | 'Custom Header' 190 | 191 | 'text italic but now using style without italic' 193 | 194 | 'one styleinside another one') 196 | CustomStyles = < 197 | item 198 | Ident = 'Custom' 199 | FontColor = 33023 200 | end 201 | item 202 | Ident = 'Other' 203 | StyleItalic = False 204 | BackColor = clGreen 205 | end> 206 | OverallVertAlign = vaCenter 207 | OverallHorzAlign = haCenter 208 | end 209 | object DzHTMLText10: TDzHTMLText 210 | Left = 464 211 | Top = 411 212 | Width = 281 213 | Height = 174 214 | Color = clCream 215 | ParentColor = False 216 | Lines.Strings = ( 217 | 218 | 'Some test with borders and Au' + 219 | 'toHeight' 220 | '' 221 | '' 222 | '' 223 | '' 224 | 'Google' 225 | '' 226 | 'Formula = a2 + t3') 227 | AutoHeight = True 228 | Borders.All = 20 229 | end 230 | object DzHTMLText11: TDzHTMLText 231 | Left = 7 232 | Top = 375 233 | Width = 155 234 | Height = 83 235 | Lines.Strings = ( 236 | 'Testing offset (top and bottom)') 237 | AutoHeight = True 238 | Offset.Top = 20 239 | Offset.Bottom = 50 240 | end 241 | object DzHTMLText12: TDzHTMLText 242 | Left = 8 243 | Top = 464 244 | Width = 155 245 | Height = 184 246 | Lines.Strings = ( 247 | 'Testing offset (top and bottom)' 248 | 249 | 'new line with specific offset' 251 | 252 | 'new line with specific full' + 253 | ' offset') 254 | AutoHeight = True 255 | Offset.Top = 20 256 | Offset.Bottom = 50 257 | end 258 | end 259 | -------------------------------------------------------------------------------- /Test/UFrmMain.pas: -------------------------------------------------------------------------------- 1 | unit UFrmMain; 2 | 3 | interface 4 | 5 | uses Vcl.Forms, System.Classes, Vcl.Controls, Vcl.DzHTMLText; 6 | 7 | type 8 | TFrmMain = class(TForm) 9 | DzHTMLText1: TDzHTMLText; 10 | DzHTMLText2: TDzHTMLText; 11 | DzHTMLText3: TDzHTMLText; 12 | DzHTMLText4: TDzHTMLText; 13 | DzHTMLText5: TDzHTMLText; 14 | DzHTMLText6: TDzHTMLText; 15 | DzHTMLText7: TDzHTMLText; 16 | DzHTMLText8: TDzHTMLText; 17 | procedure FormCreate(Sender: TObject); 18 | end; 19 | 20 | var 21 | FrmMain: TFrmMain; 22 | 23 | implementation 24 | 25 | {$R *.dfm} 26 | 27 | procedure TFrmMain.FormCreate(Sender: TObject); 28 | begin 29 | ReportMemoryLeaksOnShutdown := True; 30 | end; 31 | 32 | end. 33 | -------------------------------------------------------------------------------- /images/LazIcon.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digao-dalpiaz/DzHTMLText/79ce4d3998fc77b891cdacfe2c699208cb7bcad0/images/LazIcon.bmp -------------------------------------------------------------------------------- /images/app_resources_dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digao-dalpiaz/DzHTMLText/79ce4d3998fc77b891cdacfe2c699208cb7bcad0/images/app_resources_dialog.png -------------------------------------------------------------------------------- /images/div.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digao-dalpiaz/DzHTMLText/79ce4d3998fc77b891cdacfe2c699208cb7bcad0/images/div.png -------------------------------------------------------------------------------- /images/preview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digao-dalpiaz/DzHTMLText/79ce4d3998fc77b891cdacfe2c699208cb7bcad0/images/preview.gif -------------------------------------------------------------------------------- /images/runtime_print.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digao-dalpiaz/DzHTMLText/79ce4d3998fc77b891cdacfe2c699208cb7bcad0/images/runtime_print.png --------------------------------------------------------------------------------