[![enter image description here](https://i.stack.imgur.com/VK8vj.png)](https://i.stack.imgur.com/VK8vj.png)

Above is the image of what I want to achieve using String.xml

There are three things

1. '76' & '20' will be replaced dynamically using String.format
2. '20' should be bold
3. '20' should be bigger in size

I have tried all the solutions using Html.fromHtml class.

Following are the solutions which I have tried. I am able to make '20' bold but couldn't make the '20' bigger in size.

Following are the differet variations of String.xml which I have tried

```
<string name="points_data">Use %1$d points= &lt;font size="30">₹ %2$d&lt;/font> in payment</string>

<string name="points_data">Use %1$d points= <font size="14"><b>₹ %2$d</b></font> in payment</string>

<string name="points_data">Use %1$d points= &lt;font size="14">&lt;b>₹ %2$d&lt;/b>&lt;/font> in payment</string>

<string name="points_data"><![CDATA[Use %1$d points= <font size="60"><b>₹ %2$d</b></font> in payment]]></string>

<string name="points_data">Use %1$d points= &lt;b>&lt;span style="fontSize='50'">₹ %2$d&lt;/span>&lt;/b> in payment</string>

```

Following is the method I use for parsing above string

```
val formattedText = String.format(getString(R.string.points_data), 76, 20)

textViewPoints.text = HtmlCompat.fromHtml(formattedText, HtmlCompat.FROM_HTML_MODE_LEGACY)

```

I have came across following links while googling for solution but none of them is working for my case. 

1. <https://developer.android.com/guide/topics/resources/string-resource>
2. [Set TextView style (bold or italic)](https://stackoverflow.com/questions/6200533/set-textview-style-bold-or-italic)
3. [Html.fromHtml deprecated in Android N](https://stackoverflow.com/questions/37904739/html-fromhtml-deprecated-in-android-n)

I have tried all the possible solutions which I could think of but none of them is working. I don't know what I am missing to implement. If anyone knows how to achieve this scenarion or knows about a way to achieve this please provide some guidance regarding that.