klaus Expert Licensed User Longtime User Feb 7, 2017 #1 What is the best method to set the FontAwesome & Material Icons TypeFaces to a view added in the code? Currently I added the MaterialIcons.ttf file to the Assets folder and created a new TypeFace: Code: Private MyTypeface as Typeface MyTypeface = Typeface.LoadFromAssets("B4X_MaterialIcons.ttf") Label1.Text = Chr(0xE149)
What is the best method to set the FontAwesome & Material Icons TypeFaces to a view added in the code? Currently I added the MaterialIcons.ttf file to the Assets folder and created a new TypeFace: Code: Private MyTypeface as Typeface MyTypeface = Typeface.LoadFromAssets("B4X_MaterialIcons.ttf") Label1.Text = Chr(0xE149)
Erel B4X founder Staff member Licensed User Longtime User Feb 7, 2017 #2 Currently the recommended way is to add a hidden label (lblFontAwesome) with the designer and set its font. Code: SomeOtherLabel.Typeface = lblFontAwesome.Typeface Upvote 0
Currently the recommended way is to add a hidden label (lblFontAwesome) with the designer and set its font. Code: SomeOtherLabel.Typeface = lblFontAwesome.Typeface
DonManfred Expert Licensed User Longtime User Feb 7, 2017 #3 Erels suggested way is to set a label in designer with this fontface. In code you then can get the fontface from the label loaded by the design and put it on other views. Upvote 0
Erels suggested way is to set a label in designer with this fontface. In code you then can get the fontface from the label loaded by the design and put it on other views.
klaus Expert Licensed User Longtime User Feb 7, 2017 #4 Erel, will there be a more 'direct' method in the future? Because I am using it in a CustomView class. Adding it in the Designer no problem. But I want the user also be able to add in the code. Therefore I need to add the hidden Label and set the Typeface as a property. Last edited: Mar 21, 2021 Upvote 0
Erel, will there be a more 'direct' method in the future? Because I am using it in a CustomView class. Adding it in the Designer no problem. But I want the user also be able to add in the code. Therefore I need to add the hidden Label and set the Typeface as a property.
Erel B4X founder Staff member Licensed User Longtime User Feb 7, 2017 #5 klaus said: Erel, will there be a more 'direct' method in the future? Click to expand... The main issue here is that the font files are only added to the APK when the font is used in the designer. It might be improved in the future. Upvote 0
klaus said: Erel, will there be a more 'direct' method in the future? Click to expand... The main issue here is that the font files are only added to the APK when the font is used in the designer. It might be improved in the future.