Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8729211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:47:37+00:00 2026-06-13T08:47:37+00:00

Main.java: Main instanceMain = this; String Dataz = FN.getHtmlData(instanceMain,BMitra,20,(getResources().getString(R.string.matn2))); btne.loadDataWithBaseURL(file:///android_asset/, Dataz, text/html, utf-8, null);

  • 0

Main.java:

Main instanceMain = this;
    String Dataz = FN.getHtmlData(instanceMain,"BMitra",20,(getResources().getString(R.string.matn2)));
    btne.loadDataWithBaseURL("file:///android_asset/", Dataz, "text/html", "utf-8", null);

FN.java:

public static String getHtmlData(Context context,String fontname,Integer fontsize, String data){
    String head = "<head><style type=\"text/css\">@font-face {font-family: 'MYFNT';src: url('"+fontname+".ttf');} body {text-align:justify;font-family: 'MYFNT';color: Black;}</style></head>";
    String htmlData= "<html>"+head+"<body dir=\"rtl\">"+data+"</body></html>" ;
    return htmlData;
 }

strings.xml:

<string name="matn2">
    <![CDATA[
    <html><body><b>سلام</b> non bold text . <b>english bold</b></body></html>
    ]]>
</string>

but bold tag not working and output is : سلام english bold . non bold text

by the way i found some report issue


in another way :

Main.java :

Main instanceMain = this;
    String Dataz = FN.getHtmlData(instanceMain,getResources().getString(R.string.matn2)));
    btne.loadDataWithBaseURL("file:///android_asset/", Dataz, "text/html", "utf-8", null);

FN.java:

public static String getHtmlData(Context paramContext, String paramString)
  {
    return "<!DOCTYPE HTML><html lang=\"fa-ir\" dir=\"rtl\"><head>" + "<link rel=\"stylesheet\" type=\"text/css\" href=\"justified_textview.css\" />" + "</head>" + "    <body>" + paramString + "</body></html>";
  }

justified_textview.css (in assest folder) :

/*@font-face {
font-family:"MyFont";
src:url('file:///android_asset/BMITRA.TTF');
}

@font-face {
font-family:"MyFont";
src:url('file:///android_asset/BMITRABD.TTF');
font-weight: bold;
}*/

@font-face {
font-family: 'Conv_BMITRA';
src: url('file:///android_asset/BMITRA.ttf');
font-weight: normal;
font-style: normal;
}

@font-face {
font-family: 'Conv_BMITRA';
src: url('file:///android_asset/BMITRABD.ttf');
font-weight: bold;
font-style: normal;
}


body {
font-family:'Conv_BMITRA';
text-align:justify;
line-height: 20pt;  
color: Black;      
}

and matn2(strings.xml) :

<string name="matn">
    <![CDATA[
    م ولادت توی وب با سی اس اس
    normal text
    <b>ولایت بولد م bold text</b>
    ]]>
    </string>

and now its work on android 2.3.3 or 2.3.5 but not working on android 4.0.x

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:47:38+00:00Added an answer on June 13, 2026 at 8:47 am

    It’s not possible, because of Webview rather than Android OS progress, is broken. If you set a custom font for Webview, in some device and Android OS it works and in some others not, unfortunately.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I saved this code in FirstApp.java: class FirstApp { public static void main (String[]
This is my code in my main java file. How would i make another
Exception in thread main java.lang.NullPointerException at Library.loadBooks(Library.java:179) at UseLibrary.main(UseLibrary.java:105) This error makes me crazy!
i write this code in main.java ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); try{ HttpClient httpclient
I'm having a problem where I receive this error: Exception in thread main java.lang.NullPointerException
I've been getting this Java runtime error: Exception in thread main java.lang.UnsatisfiedLinkError: no jogl
I am getting this error: java.lang.ClassCastException: $Proxy0 cannot be cast to rmi.engine.Call at Main.main(Main.java:39)
Consider this package structure java.assignments Main.java java.assignments.lab1 Exe1.java java.assignments.lab2 Exe1.java Exe2.java Exe3.java java.assignments.lab3 Exe1.java
Java code: import javax.swing.Timer; class Main { public static void main(String args[]) { MyListener
import java.util.HashMap; import java.util.Map; public class Main { public static void main(String[] args) {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.