1

When I have loaded a dynamic font in Windows with

AddFontResource("myfontpath.ttf");

I need to choose it on the canvas and draw text with it:

Canvas.Font.Family := "myfontname"

On OS X and iOS it works fine! - because loading of the custom font is done through the .plist outside of the application. However, on Windows it does not recognize the font and falls back to a standard font.

I found these topics indicating that it is a general problem with FMX. Firemonkey: Adding a font from resource to memory and using it and Install font in firemonkey

These questions do NOT end up with a solution, though one of them suggest working with styles, but in my situation I am using the font on a custom non-styled component (inherited from TControl and not from TStyledControl)

Did anyone find a solution or a workaround?

PS. Installing the font by the installer in Windows is not an option because the font should be hidden for other applications. It is not a text font! I use AddFontResourceEx( ... ,FR_PRIVATE, ... ) to achieve this, but the FMX problem I describe is the same with AddFontResource.

Community
  • 1
  • 1
Hans
  • 2,220
  • 13
  • 33

0 Answers0