gjoisa Active Member Licensed User Longtime User Jan 19, 2011 #1 I am using a custom font in my app . i used the code as : Dim mf As TypeFace ....... mf=Typeface.LoadFromAssets("sgj.ttf") Now how to make this font as bold font ?
I am using a custom font in my app . i used the code as : Dim mf As TypeFace ....... mf=Typeface.LoadFromAssets("sgj.ttf") Now how to make this font as bold font ?
Erel B4X founder Staff member Licensed User Longtime User Jan 19, 2011 #2 Code: Copy mf = Typeface.CreateNew(mf, Typeface.STYLE_BOLD) Upvote 0
bsnqt Active Member Licensed User Longtime User Nov 19, 2013 #3 Erel said: Code: Copy mf = Typeface.CreateNew(mf, Typeface.STYLE_BOLD) Click to expand... For me it does not work (Sony Xperia S, Android 4.1) ... now I don't know how to make the text bold... Upvote 0
Erel said: Code: Copy mf = Typeface.CreateNew(mf, Typeface.STYLE_BOLD) Click to expand... For me it does not work (Sony Xperia S, Android 4.1) ... now I don't know how to make the text bold...
Erel B4X founder Staff member Licensed User Longtime User Nov 20, 2013 #4 Which font file have you loaded? Upvote 0
bsnqt Active Member Licensed User Longtime User Nov 21, 2013 #5 Dear Erel, I use Roboto Thin font (.ttf). I can upload it here upon your request. My code: Code: Copy Dim myfont As TypeFace myfont = Typeface.LoadFromAssets("RobotoThin.ttf") myfont = Typeface.CreateNew(myfont , Typeface.STYLE_BOLD) Label1.Typeface = myfont I need to mention that my Label1 is used for adding to a CustomListView. I don't get any error. It just displays the same thin font without changing it to BOLD as expected Last edited: Nov 21, 2013 Upvote 0
Dear Erel, I use Roboto Thin font (.ttf). I can upload it here upon your request. My code: Code: Copy Dim myfont As TypeFace myfont = Typeface.LoadFromAssets("RobotoThin.ttf") myfont = Typeface.CreateNew(myfont , Typeface.STYLE_BOLD) Label1.Typeface = myfont I need to mention that my Label1 is used for adding to a CustomListView. I don't get any error. It just displays the same thin font without changing it to BOLD as expected
Erel B4X founder Staff member Licensed User Longtime User Nov 21, 2013 #6 Your code is correct. The font file probably doesn't have a "bold" variant. Upvote 0