Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1
  • 2

TOPIC:

How to add font file to radaee library 9 years 3 months ago #8336

  • asliyanage
  • asliyanage's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 100
  • Thank you received: 0
Hi nermeen,radaee,

I have added below code to copy arial,helvatica and time roman

AssetManager asset = act.getAssets();

addFont(act, asset, "helr45w.ttf");
addFont(act, asset, "helr46w.ttf");
addFont(act, asset, "helr65w.ttf");
addFont(act, asset, "helr66w.ttf");

addFont(act, asset, "timr45w.ttf");
addFont(act, asset, "timr46w.ttf");
addFont(act, asset, "timr65w.ttf");
addFont(act, asset, "timr66w.ttf");

addFont(act, asset, "arial.ttf");
addFont(act, asset, "arialbd.ttf");
addFont(act, asset, "arialbi.ttf");
addFont(act, asset, "ariali.ttf");

fontfileListStart();


String fontPath1 = act.getFilesDir().getAbsolutePath() + "/helr45w.ttf";
fontfileListAdd(fontPath1);
String fontPath2 = act.getFilesDir().getAbsolutePath() + "/helr46w.ttf";
fontfileListAdd(fontPath2);
String fontPath3 = act.getFilesDir().getAbsolutePath() + "/helr65w.ttf";
fontfileListAdd(fontPath3);
String fontPath4 = act.getFilesDir().getAbsolutePath() + "/helr66w.ttf";
fontfileListAdd(fontPath4);

String fontPath5 = act.getFilesDir().getAbsolutePath() + "/timr45w.ttf";
fontfileListAdd(fontPath5);
String fontPath6 = act.getFilesDir().getAbsolutePath() + "/timr46w.ttf";
fontfileListAdd(fontPath6);
String fontPath7 = act.getFilesDir().getAbsolutePath() + "/timr65w.ttf";
fontfileListAdd(fontPath7);
String fontPath8 = act.getFilesDir().getAbsolutePath() + "/timr66w.ttf";
fontfileListAdd(fontPath8);

String fontPath9 = act.getFilesDir().getAbsolutePath() + "/arial.ttf";
fontfileListAdd(fontPath9);
String fontPath10 = act.getFilesDir().getAbsolutePath() + "/arialbd.ttf";
fontfileListAdd(fontPath10);
String fontPath11 = act.getFilesDir().getAbsolutePath() + "/arialbi.ttf";
fontfileListAdd(fontPath11);
String fontPath12 = act.getFilesDir().getAbsolutePath() + "/ariali.ttf";
fontfileListAdd(fontPath12);



fontfileListEnd();

I checked the data folder using debugging and font files are copied.I have added below to map Time Roman font to mapping.Could you please provide me how to add mappings to Arial and Helvettica?

fontfileMapping("TimesNewRoman", "Times New Roman");
fontfileMapping("TimesNewRomanPSMT", "Times New Roman");
Last edit: by Docrishav.
The topic has been locked.

How to add font file to radaee library 9 years 3 months ago #8346

  • asliyanage
  • asliyanage's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 100
  • Thank you received: 0
thanks radaee and nermeen.I added font files in radaee library res/raw folder and load from it.now its working.
The topic has been locked.
  • Page:
  • 1
  • 2
Powered by Kunena Forum