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

trouble with fallback fonts

More
IP: 97.115.135.13 7 years 9 months ago #14055 by arlomedia
Since updating my view library from 2.9.11 to the latest 3.15.3, I'm having issues with text not displaying on my users' devices. For example, a German user with an Android 4.4.2 device sees all text except characters with umlauts (ä, ö, ü). Other users with Android 5.1.1 and 6.0.1 see annotations and background colors, but no text at all. I submitted help tickets with examples to Radaee and they said these issues are all because of font embedding, and directed me back to the forum for further help.

In the help ticket, they said I could either distribute the DroidSans font with my app, or change the default fallback font to Arimo in Global.java. They said DroidSans is better for Asian text and Arimo is better for European, so I would like to use Arimo. However, it looks like that is already the default in Global.java. I haven't changed anything in Global.java except adding my license code. I think this is the relevant code:
Code:
// set default font for fixed width font with empty collection. if (!setDefaultFont(null, "Arimo", true) && !setDefaultFont(null, "DroidSansFallback", true) && face_name != null) { setDefaultFont(null, face_name, true); } // set default font for non-fixed width font with empty collection. if (!setDefaultFont(null, "Arimo", false) && !setDefaultFont(null, "DroidSansFallback", false) && face_name != null) { setDefaultFont(null, face_name, false); }

Is this already using Arimo as the fallback font, and if not, what do I need to change?
More
IP: 37.183.44.177 7 years 9 months ago #14056 by support
Replied by support on topic trouble with fallback fonts
Arimo family is better for application size but doesn't contains asian glyphs.
DroidSansFallback is a huge font (>5mb) which contains many glyphs from non-latin charsets.
Are you distributing fonts assets in your package?
More
IP: 37.183.44.177 7 years 9 months ago #14058 by goldkyo
Replied by goldkyo on topic trouble with fallback fonts
A supplement, the code
Code:
setDefaultFont(null, "Arimo", true)
Does not load the font resource, but only set the loaded font resource as default font. By loading the font resource correctly, you should:
1. Place the font file arimo.ttf in your project resource folder.
2. Load the font resource with:
Code:
load_truetype_font( res, R.raw.arimo, new File(files, "arimo.ttf") )
More
IP: 97.115.135.13 7 years 9 months ago #14062 by arlomedia
I think I'm including the Arimo font. In my project files, ViewLib/res/raw has all the arimo, cousine and tinos fonts that came with the library. And Global.java contains the load_truetype_font lines for each file.

I haven't been able to test the fallback fonts on my own devices because I don't have a PDF file with fonts that are neither installed on my devices nor embedded into the file. I tried making a PDF with some unusual fonts from Word and from Illustrator, but both applications always embed the fonts and don't give an option to turn that off. Could someone share a PDF I can test with, along with a screen shot of how the fonts are supposed to look so I can see if the fallback fonts are appearing?
More
IP: 97.115.135.13 7 years 9 months ago #14070 by arlomedia
I think I might understand what's happening here. Does the fallback font only work if there is a fontfileMapping entry for the original font in the PDF file? Radaee support said that the file referenced Arial-BoldMT, while the Global.java file only has a fontfileMapping for ArialMT. I assumed the fallback font would cover any font in the PDF file, but if that's not the case, that would explain why this user's file isn't displaying correctly.
More
IP: 97.115.135.13 7 years 9 months ago #14073 by arlomedia
Well now I'm even more confused. The Knowledge Base suggests that the viewer will use substitute fonts even if they are not specifically mapped with fontfileMapping commands:

www.radaeepdf.com/support/knowledge-base?view=kb&kbartid=5

But I can't explain these situations:

1) One user's file uses TimesNewRomanPS-ItalicMT. I mapped this to Tinos Italic in my Global.java file. But on the user's Android 4.4 device, the text displays in a sans-serif font (Tinos is serif), and characters with umlauts don't display at all.

2) Another user's file uses ArialMT. This was already mapped to Arimo on my Global.java file. But on the user's Android 6.0 device, the text doesn't display at all.

3) Another user's file uses CourierNewPSMT. That is not mapped in my Global.java file. But on the user's device (I don't have an Android version number for this user), the text doesn't display at all. This one would make sense except for the behavior described in the knowledge base and observed in example 1.

What am I not understanding about how this is supposed to work? And why did these files display fine for these users with the old library version 2.9?
Time to create page: 0.482 seconds
Powered by Kunena Forum