DelphiFeeds.com

  • Dashboard
  • Popular Stories
  • Trending Stories
  • Feeds
  • Login
Trending now

Learn A Powerful Python Concept: Modules And Packages With A Delphi Windows GUI App

The IFDEF Problem!

Quickly Build Natural Language Processing Capable GUI Apps With Delphi And Python NLTK

Freebie Friday: capture controls or forms

Easily Learn How To Use Python List Comprehensions In A Delphi Windows GUI App

Powerful Native Open Source Hard Disk, Folder and Storage Analyzer Built In Delphi

Incredible Database Development And Visualization Tool Is Built In Delphi

User Defined Functions with InterBase

Learn How To Use C++ Extending Sizeof For Windows Development

Learn How Easy It Is To Apply Updates With TFDQuery.OnUpdateRecord In Delphi

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

1
Anbarasan Anbarasan 2 months ago in coderage 2019, Delphi, FireMonkey, FMX, object pascal, programming, RAD Studio, Text Formatting, Text Rendering, TTextLayout 0

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.

  • TTextLayout is an abstract class that provides mechanisms to render text quickly. Such rendering systems are supported by DirectWrite API (Windows) and Core Text framework (OS X). Also used to calculate glyph positions, measure text, draw text, and covert to curves for path effects and 3D extrusion.
  • To create this class, use TTextLayoutManager – In charge of choosing the appropriate layout class type for the current running platform.
  • Use AddAttribute to assign text block properties like TTextRange (starting position and length) and TTextAttribute (font and color).
  • When changing several properties of the layout, you should use the BeginUpdate and EndUpdate procedures.
  • Use RenderLayout to render the text on a canvas.
  • The PositionAtPoint method returns the position in the text by the position’s coordinates.
  • The RegionForRange method returns the array of the rectangles surrounding the range of the text specified in ARange.
  • Another feature is the ability to convert text to a TPathData object by calling the ConvertToPath procedure.

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

Trending Stories

  • Learn A Powerful Python Concept: Modules And Packages With A...

  • The IFDEF Problem!

  • Quickly Build Natural Language Processing Capable GUI Apps With Delphi...

Embarcadero GetIt

  • Brook Framework

    Microframework which helps to develop web Pascal applications.

  • Trial - TMS Scripter

    Add the ultimate flexibility and power into your apps with native Pascal or Basic scripting and […]

  • Trial - TMS VCL Chart

    DB-aware and non DB-aware feature-rich charting components for business, statistical, financial […]

  • Trial - TMS VCL Cloud Pack

    TMS VCL Cloud Pack is a Delphi and C++Builder component library to seamlessly use all major cloud […]

  • Trial - TMS VCL UI Pack

    Create modern-looking & feature-rich Windows applications faster with well over 600 components […]

  • Learn Delphi Programming
  • Learn C++
  • Embarcadero Blogs
  • BeginEnd.net
  • Python GUI
  • Firebird News
  • Torry’s Delphi Pages
Copyright DelphiFeeds.com 2021. All Rights Reserved
Embarcadero
Login Register

Login

Lost Password

Register

Lost Password