I was using calligraphy before the Font resources, one we see this we moved to Font resources and all works well,only one problem i am getting if my text view content is html and bold attribute(),its not highlighting, but if i remove the Font resources via xml and use the programmatic way it is working with same font.
i can give an example i am using Font resources like below
font_regular.xml
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:app="http://schemas.android.com/apk/res-auto">
<font
app:font="@font/myfont"
app:fontStyle="normal"
app:fontWeight="700" />
</font-family>
My textview
<TextView
app:fontFamily="@font/font_regular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000000"
android:textSize="15sp"
/>
When i apply this to a html data contain bold,all data is coming from server as html data like example data as below
Data
<p>Hi i am <b>bold</b></p>
Expected result
Hi i am bold
But out put will be
Hi i am bold
The font is applying successfully but the portion of bold is not getting bold
But when i use programmatically via Typeface its working
Programmatically
Typeface typeFace= Typeface.createFromAsset(context.getAssets(),
"fonts/myfont.otf");
I google and gone through all the doc that i have seen via google none of them pointing me how to achieve this via Font resources.
Please help me to know whether i can achieve this via Font resources
Hi i am bold
, i run in all device android pie,marshmallow,oreio,even in gingerbread, font is applying but the area i need to get bold is not setting – Ramz Jun 27 '19 at 12:39