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

TOPIC:

Wrong font displayed in document. 9 years 11 months ago #6142

  • LingvistonTheOne
  • LingvistonTheOne's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 10
  • Thank you received: 0
I don't understand what you mean. Now I'm using these lines:
load_std_font("PR.ttf", assets, files);
fontfileListAdd(act.getFilesDir().getAbsolutePath() + "/PR.ttf");
setDefaultFont(null, "Palatino-Roman", true);
Like you suggested in two previous comments.
Can you provide a complete example not by scratches? If this code is ok then it seems like I'm using wrong font.
Last edit: by chetberry.
The topic has been locked.

Wrong font displayed in document. 9 years 11 months ago #6145

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
like these codes, these codes must placed after fontfileListStart() and before fontfileListEnd()
in Global.Init().
	String PRFont_path = files.getAbsolutePath() + "/PR.ttf";// get destiny
	sub = new File(PRFont_path);
	if (!sub.exists()) {
		try {
			InputStream src;
			FileOutputStream dst = new FileOutputStream(
			new File(PRFont_path));
			src = assets.open("PR.ttf");
			while ((read = src.read(buf)) > 0)
				dst.write(buf, 0, read);
			src.close();
			src = null;
			dst.close();
			dst = null;
		} catch (Exception e) {
		}
	}
	sub = null;
	fontfileListAdd(PRFont_path);
Last edit: by .
The topic has been locked.
  • Page:
  • 1
  • 2
Powered by Kunena Forum