2

I'm trying to use a custom font for my Android app, I tried many ways but no luck. the pas file FMX.FontGlyphs.pas does not have to be modified I believe as they updated it in Delphi 10.4 which I'm using now. what I've done so far to test :

I've added FMX.FontGlyphs.pas the project

Font Moncao is deployed correctly in the app path: /assest/internal name of file Moncao.ttf

Label1 Family set to Moncao, loads visually in the IDE.

still not work, I've modified FMX.FontGlyphs.pas FontFile to external location : FontFile := 'sdcard/Project1/Monaco.ttf'; and added the font Monaco.ttf to the path in the code. yet still no luck.

I've tested the font exists in both the App path and 'sdcard/Project1/Monaco.ttf'

is there a point I'm missing here ?! or is this a bug in Delphi 10.4?

UPDATE

I've tested it also in Delphi 10.1 Berlin and it works if you rename the font to match the Family property of the font settings. However, this method dose not work for Delphi 10.4

Delphier
  • 65
  • 5

2 Answers2

0

It must be a bug. I noticed that when you call "Show" for the same window again, the fonts are replaced with custom.

Andrew
  • 1
  • 1
0

Delphi 10.4 Fmx Android

Don't need Embed Font, you can change

label1.Font.Family := 'Tahoma'
label1.Font.Family := 'Font'
Peter Csala
  • 17,736
  • 16
  • 35
  • 75