iOS Tutorial Custom Fonts

Erel

Administrator
Staff member
Licensed User
In order to add custom font files to your application you need to follow these instructions:
1. Add the font file to the "special" folder: <project>\Files\Special
2. Add the #AppFont attribute for each font file (including the extension):
B4X:
#AppFont: papercuts-2.ttf
#AppFont: vermidirouge 1.0.ttf
3. Find the font name. You can double click on the font file:



4. Create a new font with this font name. The name should not include spaces:
B4X:
Label1.Font = Font.CreateNew2("VermidiRouge", 30)
Label2.Font = Font.CreateNew2("PaperCuts2", 20)



Note that #AppFont and the special folder features are not available in the current beta.
 

Attachments

GiulioVale

Active Member
Licensed User
HI Erel,
with this example I have
Error occurred on line: 30 (main)
Object was not initialized (UIFont)

Any help?

edit:
ooooppss my fault I not read the message for the current beta. Sorry
 
Last edited:

GiulioVale

Active Member
Licensed User
HI Erel,
with btnSeguente.CustomLabel.Font = Font.CreateNew2("FontAwesome", 20) i want assign a font to a text button.
My text is UnescapeUnicode("\uf061")
How i can assign at runtime this char to button label?
 

susu

Well-Known Member
Licensed User
Your app runs on iPhone 5S (iOS 7.1.2) but there's no change of font? Is it a bug?
 

susu

Well-Known Member
Licensed User
Yes, I just download your code and run as "Debug".
 

omidaghakhani1368

Well-Known Member
Licensed User
Hi.
I use custom font and it's work good but still cannot change fontsize.
of course sometime i get error "The file 'J:\Basic4x\Basic4iOS\Chapter 18\Attachment\Project\Objects\src\tahoma' already exists." what it is?
How change font size? (I use label1.Font = Font.CreateNew(30))
 

omidaghakhani1368

Well-Known Member
Licensed User
I try change font size from settings.I dont want to change font size in designer.Is there a way?
 
Top