Skip to content

Deploy FMX

Carlo Barazzetta edited this page May 3, 2024 · 7 revisions

Deploy FMX application (on Windows)

You must deploy the Icon Fonts used in your application to the target windows machine during setup process, so the Font is available for the application.

Deploy FMX application (on Android)

  • You must define in Project Deployment entries for the actual font you want to include (beware to do so for all the target platforms, bitness and configurations you need). In our demos we use the Material Design Icons font so we need to distribute it in the app bundle. You can find the Material Design Icons.ttf file in the \Demo\Fonts folder of this repository.

  • Patch FMX source file: FMX.FontGlyphs.Android.pas as follow:

<   Androidapi.JNIBridge, Androidapi.Helpers, IOUtils;
---
>   Androidapi.JNIBridge, Androidapi.Helpers;
67d66
<   LFontFileName: string;
87,93c86
< 
<     LFontFileName := TPath.GetDocumentsPath + PathDelim + CurrentSettings.Family + '.ttf';
<     if FileExists(LFontFileName) then
<       Typeface := TJTypeface.JavaClass.createFromFile(StringToJString(LFontFileName))
<     else
<       Typeface := TJTypeface.JavaClass.Create(FamilyName, TypefaceFlag);
< 
---
>     Typeface := TJTypeface.JavaClass.create(FamilyName, TypefaceFlag);

We are using the font family name (Material Design Icons) to lookup the corresponding TTF file (beware name should match case sensitively).

Deploy FMX application (on iOS)

You must define in Project Deployment...

Clone this wiki locally