Correct font folder contradiction in docs and blogpost

What is the correct folder for custom fonts?

In the docs it says that they have to be in the main folder:

https://docs.coronalabs.com/guide/system/customFont/index.html

But in a blogpost it says they can also be in a subfolder:

https://coronalabs.com/blog/2016/02/25/important-changes-loading-fonts-just-got-easier-in-corona-sdk/

I’ve tried and the log from the build looks different but from what I can see, the font is found in both places. 

I’ve updated the docs. They can go into a subfolder. They will be live shortly.

-- Standard text object -- font in a folder named "fonts" local displayText = display.newText( "Hello World", 150, 80, "fonts/CoolCustomFont.ttf", 24 )

Thanks for the catch!

I did a quick little test. When I put the font file in a subfolder, it was not mentioned even once in the build logs. However, when I put it in the root folder, I found this in the build log (scattered):

populateUIAppFonts: Found font file: Roboto-Light.ttf

populateUIAppFonts:  AFTER: #1: tmpUIAppFonts: [“Roboto-Light.ttf”]

“UIAppFonts”:[“Roboto-Light.ttf”] (in the “Settings -> iphone -> plist” section)

adding extra plist setting UIAppFonts: [“Roboto-Light.ttf”]

                    

It seems like something “more” is done with the font file when it is in the root folder, although I do not fully understand what.

In the light of the above, are you sure that fonts can go in either folder?

I’m 100% certain fonts work in a folder. We just may not be logging it to the console log.

But check it yourself. Do you see your custom font in the simulator? Build for device? Do you see your custom font?

It wouldn’t take big sample/test app to prove this works.

Rob

Well, it works but I just figured that since the log output from building was different, there was still something different between the two ways of doing it. Anyway, it could be that you just do not log it in the same way…

I’ve updated the docs. They can go into a subfolder. They will be live shortly.

-- Standard text object -- font in a folder named "fonts" local displayText = display.newText( "Hello World", 150, 80, "fonts/CoolCustomFont.ttf", 24 )

Thanks for the catch!

I did a quick little test. When I put the font file in a subfolder, it was not mentioned even once in the build logs. However, when I put it in the root folder, I found this in the build log (scattered):

populateUIAppFonts: Found font file: Roboto-Light.ttf

populateUIAppFonts:  AFTER: #1: tmpUIAppFonts: [“Roboto-Light.ttf”]

“UIAppFonts”:[“Roboto-Light.ttf”] (in the “Settings -> iphone -> plist” section)

adding extra plist setting UIAppFonts: [“Roboto-Light.ttf”]

                    

It seems like something “more” is done with the font file when it is in the root folder, although I do not fully understand what.

In the light of the above, are you sure that fonts can go in either folder?

I’m 100% certain fonts work in a folder. We just may not be logging it to the console log.

But check it yourself. Do you see your custom font in the simulator? Build for device? Do you see your custom font?

It wouldn’t take big sample/test app to prove this works.

Rob

Well, it works but I just figured that since the log output from building was different, there was still something different between the two ways of doing it. Anyway, it could be that you just do not log it in the same way…