Forum How do I...?

Very weird font problem

pkmiec
I use PrinceXML to generate reports for my customers. I've been hearing from a few customers that when they open a report, all the text is in the dingbats font. This is not something I've been able to reproduce (even after replicating their windows / acrobat setup)... but customers continue to experience this problem. Finally, I went to one of the customers and asked them to show me the problem. We generated a report, and in fact it contained dingbats. The report remained opened while we discussed the issue. Then all of the sudden, the dingbats changed into readable text. So, I repeated the steps and it seems like report opens with dingbats and the actual fonts are filled in a bit later. The timing seemed to depend on the size of the pdf.

I am lost as to what the problem is. Here is the command I use,

/usr/local/bin/prince 
--baseurl https://<our site>/ 
--media=print 
--no-xinclude 
--no-network 
--no-embed-fonts 
--style fonts.css 
--style report.css 
report.html 
--output report.pdf


My font.css references the standard msttcorefonts. However, it also contains

@font-face {
    font-family: micr;
    font-style: normal;
    src: url("fonts/truetype/gnu/GnuMICR.ttf")
}


But this font is not used in the report.

I don't know if this is something related to prince or not, but I'm hoping you have some insights :).
mikeday
Is the PDF being viewed online, over the web? It seems strange to have a significant delay in bringing up the correct fonts if it is a local file.
pkmiec
That's interesting. The pdf reports are definitely downloaded from our online service. But we assumed the file has been completely downloaded by the time the browser shows the dialog with 'Open'. Thanks, I'll double check that.

However, even if the file has not been downloaded completely and we're using default fonts, why would we see this problem? Is there different method of encoding pdfs for 'streaming'?
mikeday
Internet Explorer with the Adobe Acrobat plugin will often try to download the PDF when the file has only partially been downloaded, so that large files can be opened without a long wait. I'm surprised that it is using dingbats though, there is no reason for that at all. It is possible to write linearised PDFs, which Prince currently does not do, but I would hope that would not be necessary in a situation like this, where the fonts are not even embedded anyway.
pkmiec
For testing purposes, do you know of a tool I can use to convert a normal pdf to a linearized one?
mikeday
Acrobat and GhostScript should each be able to do this, and I'm sure some other tools as well.