Delphi

HTML Component Library 3.9 Full Source for Rad Studio 12 Athens

HTML Component Library is a cross-patform and 100% native HTML rendering library for Delphi and Lazarus that brings all the power of HTML/CSS into desktop and mobile Delphi applications.

Unlike other «HTML-...

Description

HTML Component Library is a cross-patform and 100% native HTML rendering library for Delphi and Lazarus that brings all the power of HTML/CSS into desktop and mobile Delphi applications.

Unlike other «HTML-like» libraries it is based on powerful HTML/CSS rendering core with full support of HTML 4.1 and CSS 3 (some of HTML 5 tags are also supported). Tables, shadows, transitions, animations, SVG images, tranforms and much more.

No DLL’s, no ActiveX, no third party libraries dependencies, only pure native Delphi code.

Compatibility
Library supports all Delphi versions from ancient Delphi 5 to Delphi 10.3.2 Rio. For Delphi XE4 - Delphi 10.3.2 Rio all FMX platforms are supported - Win32/64, OSX, Android, iOS and Linux.

Linux GUI is supported with FMXLinux library and in Lazarus

Unicode (including Right-to-Left) is supported even for non-unicode Delphi 5 - 2007 using widestrings and TNT Unicode library.

Updates for new Delphi versions are released in one week (max) after Delphi release.

Parts
Library core contains:

HTML parser with full support of HTML standard and ability to handle incorrect markup. It was tested on thousands of real-world emails so missed closed tags and incorrect tag order is not a problem. Also it is currently fastest native HTML parser for Delphi.
XML Parser with XPath support.
CSS parser with CSS 3 support.
DOM classes with JQuery support.
SVG rendering library.
HTTP client with native implementation for Windows and OSX and https support.
HTML rendering core.
Set of rendering canvases (GDI, GDI+, Direct2D, FMX, Android, iOS, OSX, Linux (Lazarus), Meta, Plain Text)
Set of HTML-enabled VCL controls including Label, Panel, ListBox, ComboBox, Tabs, CheckBox, RadioButton, SpeedButton, PopupMenu, ComboListBox, Virtual Tree, CategoryButtons, BalloonHint.
Powerful cross-platform scripting engine
Bundle also contains
Email framework
SQL framework
HTML rendering class is separated from drawing class so you can choose between available drawing classes or write your own. Currently library contains GDI, GDI+ and Direct2D canvases for VCL (All Delphi versions and Lazarus), FMX canvas for FMX Win32/64, iOS, Android and OSX and also native Android, iOS and OSX canvases.

Performance
Library core is heavily optimized and extremely fast. Parsing speed is about 100Mb/s so parsing of typical 100Kb document takes only 1ms. Style and layout calculations takes additional 20ms for 100Kb document.

Using of native canvas on Android provides smooth scrolling and zoom similar to native Android applications (much better than FMX controls) and correct text rendering with full RTL support, kerning pairs and baseline alignment.

How to use
Drop THtPanel on form and set it’s HTML property. That’s all you have to do to get HTML viewer with automatic scrollbars, build-in zoom support (Ctrl+Wheel or zoom gesture), gestures support for both VCL and FMX, picture loading (from file or internet) with BMP, JPEG, PNG, ICO and GIF support, hints (HTML title attribute) animations and transitons (for elements with :hover or :active styles).

To simply draw HTML on Canvas write

Doc := THtDocument.Create;
try
Doc.Parse(HTML);
Doc.Draw(Canvas, Rect);
finally
Doc.Free
end;


Why do I need it?
VCL and FMX contains a lot of powerful controls with many features. But what if you need something non-standard, for example put an image into listbox item?

Of course writing OnDraw event handler and using canvas methods is a simplest way... as long as image is not placed inside the text and text not contains several lines and some formatting. With HTML enabled list box you can just add Some text with formatting and

image

How many lines of code is neccesary to draw simple rounded rectangle with shadow and gradient? Or tiled background image Or symbol table Changing HTML property could turn simple Panel into this

Additional Information