android - Multiple font to single textview depending on langugage -


so @ moment have textviews english text , arabic text , doing applying font depending language in textview , there times when have both english , arabic in single text , how possible me apply arabic , english font on same textview? possible merge 2 fonts in 1 font type , , apply every where, work?

found this:

string firststring = "aaaaaa: "; string secondstring = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";  spannablestringbuilder sb = new spannablestringbuilder(firststring + secondstring);  sb.setspan(new stylespan(android.graphics.typeface.bold), 0, firststring.length(),         spannable.span_inclusive_inclusive);  sb.setspan(new foregroundcolorspan(color.rgb(255, 0, 0)), firststring.length() + 1,         firststring.length() + secondstring.length(),         spannable.span_inclusive_inclusive);  textview.settext(sb); 

might work


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -