Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!

AndroidAppmethodCode SnippetDelphiFiremonkey

Custom True Type Fonts On Android With Delphi XE5 and XE6 Firemonkey

Delphi XE5 Firemonkey TTF Fonts AndroidOver on the Embarcadero forum for Firemonkey there is a question and answer thread about dynamically loading a TrueType font on Android in a Delphi XE5 Firemonkey app. This method also works with Delphi XE6 and should work with AppMethod. Douglas Rudd wrote the instructions for making it happen and they involve copying the FMX.FontGlyphs.Android file to your project directory. You then modify the Delphi unit with some custom code to load a TTF file from the directory of your application. The magic takes place in the createFromFile() function in TJTypeFace:

You also include your TrueType font file inside your APK using the Delphi Deployment functionality. Add the TTF file to your Deployment and change the directory to: .\assets\internal\ One gotcha that you have to watch out for is that you must use the actual name of the font file minus the .ttf in the Font Family property in Delphi. Using the name of the font and not the filename will not work and remember Java is case sensitive (and so are the filenames).

The instructions are originally from two different blogs in Chinese here and here.

Head over and read the full forum thread on the Embarcadero site on using a custom font in Delphi Firemonkey on Android.

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Related posts
AndroidC++BuilderCode SnippetDelphiDemoFiremonkeyIOSOSXShowcaseWindows

Powerful Cross Platform Email App Sample In Delphi 10.4.1 FireMonkey For Android And IOS

AndroidC++BuilderDelphiFiremonkeyIOSOSXWindows

Significant Update Available For Delphi FireMonkey 10.4.1 On Android, IOS, OSX, Windows, And Linux

C++BuilderDelphiIDEWindows

Professional SVG Icon Image List For Delphi 10.4 FireMonkey On Windows

AndroidC++BuilderDelphiFiremonkeyIOSLiveBindingsOSXWindows

Top Tips And Tricks To Speed Up Development With Delphi 10.4 FireMonkey On Android and IOS

Sign up for our Newsletter and
stay informed

Leave a Reply