Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about Android development and PDF

How to add font file to radaee library

More
IP: 192.168.0.71 11 years 2 months ago - 11 years 2 months ago #8336 by asliyanage
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: 11 years 2 months ago by Docrishav.
More
IP: 192.168.0.71 11 years 2 months ago #8346 by asliyanage
thanks radaee and nermeen.I added font files in radaee library res/raw folder and load from it.now its working.
Time to create page: 0.335 seconds
Powered by Kunena Forum