Custom Font Issue

Bill Norris

Active Member
Licensed User
Longtime User
I have the following code in Process_Globals of Main activity.

B4X:
Dim default_font, default_font_bold, default_font_italic As Typeface
default_font=Typeface.LoadFromAssets("micross.ttf")
default_font_bold=Typeface.CreateNew(default_font,default_font.STYLE_BOLD)
default_font_italic=Typeface.CreateNew(default_font, default_font.STYLE_ITALIC)

This enables me to use a custom font throughout my project and I can simply assign typeface of labels, buttons, etc. to default_font, default_font_bold or default_font_italic by referencing their global values. Problem is when I assign the bold or italic, it is not bold or italic, just show same as a regular. Can't figure out what I need to do to get italic of the font to work.
 

Bill Norris

Active Member
Licensed User
Longtime User
RE:

Well - apparently it does not. I figured it would generate an error if such was the case, but does not. I don't see any such variations when I look at it in the Fonts folder of my PC. I mistakenly thought this was the default font of B4A. When I find a font with Italics and Bold styles, do I need to add all variations to the file folders?

Thanks
 
Upvote 0
Top