Mashiane Expert Licensed User Longtime User Dec 1, 2015 #1 Hi How can I get the font name from a ttf/otf file stored in the assets folder? I am able to set a font label with.. B4X: Sub SetLabelFont(v As Label, fontFile As String) Dim ff As Typeface ff = Typeface.LoadFromAssets(fontFile) v.Typeface = ff ff = Null End Sub Assuming that I know the fontFile. I want to enable a user to select from a list of available fonts using exact font names, can someone please advise? Thanks,
Hi How can I get the font name from a ttf/otf file stored in the assets folder? I am able to set a font label with.. B4X: Sub SetLabelFont(v As Label, fontFile As String) Dim ff As Typeface ff = Typeface.LoadFromAssets(fontFile) v.Typeface = ff ff = Null End Sub Assuming that I know the fontFile. I want to enable a user to select from a list of available fonts using exact font names, can someone please advise? Thanks,
Erel B4X founder Staff member Licensed User Longtime User Dec 1, 2015 #2 You can create a text file with all the fonts names and then load it with File.ReadList. Upvote 0
Mashiane Expert Licensed User Longtime User Dec 1, 2015 #3 Erel said: You can create a text file with all the fonts names and then load it with File.ReadList. Click to expand... Hi, there is no way to read the font name directory from the ttf/otf like loading the font to a font object and reading the name from there? Upvote 0
Erel said: You can create a text file with all the fonts names and then load it with File.ReadList. Click to expand... Hi, there is no way to read the font name directory from the ttf/otf like loading the font to a font object and reading the name from there?
Erel B4X founder Staff member Licensed User Longtime User Dec 1, 2015 #4 No. You can use a map to map between the typeface and the name: https://www.b4x.com/android/forum/threads/map-collection-the-most-useful-collection.60304/ Upvote 0
No. You can use a map to map between the typeface and the name: https://www.b4x.com/android/forum/threads/map-collection-the-most-useful-collection.60304/
Mashiane Expert Licensed User Longtime User Dec 1, 2015 #5 Erel said: No. You can use a map to map between the typeface and the name: https://www.b4x.com/android/forum/threads/map-collection-the-most-useful-collection.60304/ Click to expand... Thanks, thought that was possible. Upvote 0
Erel said: No. You can use a map to map between the typeface and the name: https://www.b4x.com/android/forum/threads/map-collection-the-most-useful-collection.60304/ Click to expand... Thanks, thought that was possible.