I've a problem exporting PDF with custom fonts. I tried using kendo.pdf.defineFont like this:
"RobotoStamp" : "kendo/fonts/Roboto/RobotoCondensed-Regular.ttf",
but it gives the following error, on the simulator and on the device:
Uncaught Error: Cannot load font from kendo/fonts/Roboto/RobotoCondensed-Regular.ttf" at file: kendo/js/kendo.all.min.
It doesn't work also if I use the absolute path to the font; it seems that this function tries to find the files without using the base path.
If I don't specify the font-family in the css rule of the page to export, it tries to find automatically the dejavu font but it doesn't find it on the device (on the simulator it works), also if the ttf files are in the correct place:
"Uncaught Error: Cannot load font from file:///data/....../kendo/styles/fonts/DejaVu/DejaVuSans.ttf?v=1.1"
I tried to define the custom font in the css file using @font-face and then giving the same font-family to the the style of to the div to export, but it can't find it and gives the same error (on the simulator it works correctly) :
"Uncaught Error: Cannot load font from file:///data/..../styles/fonts/Roboto/RobotoCondensed-Regular.ttf"
Last try: Giving an inexistent font-family to the page to export in the css rule, ( es. font-family:'' ) it works without giving any error and it uses a standard font.
- The function kendo.pdf.defineFont never works, neither on the device nor on the simulator.
- Defining the custom ttf font using @font-face doesn't work on the device, but works on the simulator.
- Defining an inexistent font-family on the div style to export, works using a standard serif font.
- Not defining any font-family attribute on the div style, doesn't work on the device, because it tries to find the DejaVu Sans font.
- The DejaVu Sans font is correctly found on the simulator, but not on the device.
Can you help me?