Android Question Changing font dynamically


Well-Known Member
Licensed User
I would like to enable the user to change font in y app.

I searched the forum to find a way to change font dynamically in an EditText, as opposed to within the Designer, but all I found was an old post of mine dating from 2016, which never receive any reply:

The best I could find is below, but it is valid only for a string. And it is not quite clear about Bold and Italic. Although there is an example for Underline, so I will try to experiment.

But what I would really like to do is to change the typeface for anything that will be typed, just like I would do in the Designer.

Any help will be greatly appreciated :)


Well-Known Member
Licensed User
Slightly confused .. looking at your question here that went unreplied, it would appear you wish to use Roboto-Thin ttf.

Yet in another thread you received an answer how to achieve this (albeit a Label) ..

So above you ask .. "a way to change font dynamically in an EditText"

Dim roboto As Typeface
    roboto = Typeface.LoadFromAssets("Roboto-Thin.ttf")
'OR roboto = Typeface.CreateNew(Typeface.LoadFromAssets("Roboto-Thin.ttf"), Typeface.STYLE_ITALIC)
    EditText1.Typeface = roboto

But you also ask ..
I would like to enable the user to change font in y app.
Unsure if there is a Font chooser / dialogue.
You could use this lib
Then possibly set up some font example labels contained in a panel, to be presented to the user.. unless there is something available.
Upvote 0