Font looks different in simulator and phone

In my game,font looks different on simulator and mobile.I put the same specifications of phone (Honor 9i) in simulator.But the phone output (font) is weird.

In simulator:

In phone:

My config.lua file

application = { content = { fps = 60, width = 320, height = 480, scale = "letterbox", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 2.000, ["@4x"] = 4.000 } } }

What could be the problem?

Seems to me that the font isn’t loaded and that Corona defaults to default system font.

The filenames are cAsE SeNsItiVE on Android, so make sure that the filename in code matches exactly to the file in the project folder, this includes the file type, e.g. “.TTF” vs .“ttf”.

Font spelling is correct. I checked it.
I think that phone forces its default font
in all apps.Is there any way to resolve this?

Can you share some code where you’re creating the text with custom fonts?

Rob

Code is here

 local gameTileText = display.newText(sg, "Color Blast", xc, 100, "a.ttf", 90) local tapToStartText = display.newText(sg, "Tap to start", xc, yc, "a.ttf", 30)

Just to be thorough, would you add this piece of code anywhere in your project:
 

local path = system.pathForFile( "a.ttf", system.ResourceDirectory ) local fhd = io.open( path ) print( fhd )

Do you get an error or a warning message like this: “WARNING: case of filename ‘…long path name…/a.ttf’ differs on disk”, or do you just get a print that reads something like “file (6CA1E080)”?

This is the output

file (6FC7E080)

Is that output from the simulator or from the app running on device (using “adb logcat” to get the device’s console log)?

I’d go with Rob’s suggestion and check out what adb logcat tells you.

At this stage, my guess is that the font you are using is invalid/bugged/broken/etc. and fails to load on Android. I’d suggest trying another font.