Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Learn To Add Custom Text Rendering And Formatting Capabilities To Your Delphi FMX Controls Quickly

Most applications demand high-quality text rendering, resolution-independent outline fonts, and full Unicode text and layout support. Looking for a device-independent text layout system that improves text readability in documents and in UI for Your Delphi/C++ applications? How to build such Text Rendering Capabilities to your FireMonkey controls? This post will guide you. (e.g) Let’s see how to enhance the TLabel control with Rendering and formatting capabilities for the Text in HTML Tags.

How to create:
1. Create a descendant of TLabel that supports a limited selection of HTML tags. Parse the label for HTML tags every time the text changes.
2. Override its Dochanged method to parse the text for HTML tags
3. Use Firemonkey’s TTextLayout class to apply formatting attributes to parts of the text.
Note: No need to use HTML for formatting instead we can use TTextlayout.

Check out the full Video of creating a Simple FMX HTML control below.

Exit mobile version