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.

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

  1. Pingback: Use And Deploy Custom True Type Fonts In Delphi XE7 Firemonkey On Android And IOS | Delphi XE5 XE6 XE7 Firemonkey, Delphi Android, Delphi IOS

Leave a Reply

Show Buttons
Hide Buttons
Read previous post:
Ten Tips And Tricks For Building Games With Delphi XE5 And XE6 On Android And IOS

Game Loop. Using a game loop to handle game state updates is one method for architecting your game. The basic...