How to add svg icon to TextView with default text font?
<p>here is my custom text view:</p>

<pre><code>public class CustomTextView extends TextView {
    public CustomTextView (Context context) {
        super(context);
    }

    public CustomTextView (Context context, AttributeSet attrs) {
        super(context, attrs);
        setCustomFont(context, attrs);
    }

    public CustomTextView (Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        setCustomFont(context, attrs);
    }

    private void setCustomFont(Context ctx, AttributeSet attrs) {
        setCustomFont(ctx);
    }

    public boolean setCustomFont(Context ctx) {

        Typeface tf = null;
        try {
            tf = Typeface.createFromAsset(ctx.getAssets(), "icons/svg_icons.ttf");
        } catch (Exception e) {
            return false;
        }

        setTypeface(tf);
        return true;
    }
}
</code></pre>

<p>my icon code is :</p>

<pre><code>&lt;string name="svg_warning" translatable="false"&gt;&amp;#xe900;&lt;/string&gt;
</code></pre>

<p>I'm adding svg icon to TextView with text by this:</p>

<pre><code>mytextview.setText(String.format("Please Select a Country %s",getResources().getString(R.string.svg_warning)));
</code></pre>

<p><strong>But font of "Please Select a Country" is not the same like default Android font. How to add svg icon to TextView with default Android's text font?</strong></p>

<p>Result:
<a href="https://i.stack.imgur.com/oaCwZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oaCwZ.png" alt="enter image description here"></a></p>