Enabling legacy Object.Create doesn't let me call android.graphics.Typeface.create()

To allow for FPC compatibility, I need to enable the legacy Object.Create method in the project settings. When I do this, however, my build crashes on a call to android.graphics.Typeface.create() with error E317: No overloaded constructor with these parameters for type "android.graphics.Typeface".

As a possible workaround in the meantime, is there any way to bypass this problem by making a direct Java call?

try either escaping create with &

android.graphics.Typeface.&create() 

or surrounding it bu guillemets:

android.graphics.Typeface.«create»() 

If neither works, I;m afraid this might need a compiler fix to support properly, I’ll check with the team what we can do there.

ps: by “crash” I assume you mean simply that does not compile and give the error, not actually crash, right?

Escaping with & solved the problem. And yes, sorry - the build did not crash but exited with errors. Thanks Marc!

1 Like

Excellent!