Forum Bugs

Problems rendering Registered Trademark symbol

lkanter
I have Prince set up on a remote Linux server (Red Hat Enterprise release 5.6 Tikanga), and am using it to convert HTML to PDF via a web service. The HTML that I am sending contains several special entities, including apostrophes (which I write as ') and registered trademark symbols (which I write as ®). While the apostrophes render as expected, the registered symbols are all showing up strangely formatted with a prepended "A with a circumflex". (screenshot attached -- instead of just being the R inside a circle, there's an extra character appearing in front of it). I have also tried writing the registered entity as ® ...same problem. This only seems to happen when I am running prince remotely on the linux box.
  1. prince_registered_symbol.png2.1 kB
    Example of how the registered entity is being rendered.
mikeday
Must be some kind of character encoding or font issue; would you be able to email me (mikeday@yeslogic.com) a short sample document that demonstrates this issue?
msicorp
I am having the same issue... Seems to only happen with Registered Trademark symbol

Has this been resolved? If so, what was the solution?
mikeday
Is your document UTF-8? Does it have the correct meta charset declaration in the document head?
msicorp
I am using <meta charset="UTF-8"> in my HTML head.

When I generate my PDF, I get a question mark where the symbol should be (see attachment).
  1. error-sample.png2.0 kB
mikeday
Can you attach the HTML, or at least the fragment that has the trademark symbol?
msicorp
See Attached for HTML.

Thanks.
  1. sample.html7.7 kB
mikeday
Thanks, this HTML document is not actually UTF-8, it's Latin1 (ISO-8859-1). If you change the charset declaration then the trademark symbol will be visible, or you can reencode the document in UTF-8.
msicorp
I had that originally but was getting the following error...

*** Mercury runtime: caught segmentation violation ***
cause: address not mapped to object
address involved: 0x9d04
This may have been caused by a stack overflow, due to unbounded recursion.
exiting from signal handler
Segmentation fault

Reason being, ISO-8859-1 doesn't seem to translate the symbol correctly.

Example: McAfee® Security
mikeday
Yikes, we definitely want to fix that crash. Can you reproduce it consistently with the sample document that you attached earlier? Which version of Prince are you running, and on which operating system? 32-bit or 64-bit?
msicorp
Yes, to fix it would be great! Unfortunately it is a consistent error with my document.

Prince: prince-9.0r5 Linux / 64-bit, static
OS: Linux 2.6.18-371.el5 x86_64
mikeday
This error seems to be specific to the statically linked generic Linux package. Can you install the RPM package for RHEL5?
msicorp
I will install it and see how it goes. Thank you.
msicorp
Better, but I now get "prince: internal error: no available fonts".

I built my CSS file using the command --scanfonts.

Peculiar error...



Edited by msicorp

msicorp
Thank you for your help again. Please note that this issue is the only thing preventing us from proceeding with purchasing a license.
mikeday
Probably the Microsoft Core Fonts are not installed, and Prince is trying to fall back to Times New Roman or DejaVu Serif for the default "serif" font family.

You can install the Microsoft fonts like this:
yum install curl cabextract xorg-x11-font-utils fontconfig

rpm -i https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm
msicorp
I ran the first command line, that worked. The second one is giving me an error...

error: Failed dependencies:
rpmlib(FileDigests) <= 4.6.0-1 is needed by msttcore-fonts-installer-2.6-1.noarch
rpmlib(PayloadIsXz) <= 5.2-1 is needed by msttcore-fonts-installer-2.6-1.noarch
mikeday
Software packaging is always a headache. I've tested this alternate method on CentOS 5:
wget http://corefonts.sourceforge.net/msttcorefonts-2.5-1.spec (or download it from a browser)

rpmbuild -bb msttcorefonts-2.5-1.spec

rpm -i /usr/src/redhat/RPMS/noarch/msttcorefonts-2.5-1.noarch.rpm

This downloads a "spec" source file that describes how to create an RPM package, which rpmbuild will create by downloading all the fonts, emitting a lot of log output, and finally producing an rpm file that can be installed. (rpm and rpmbuild will need to be run as root).

Sorry for the inconvenience!
msicorp
I agree, a big headache.

On whichever line in the .spec file, I get 'error: line 1: Unknown tag'. We are using RedHat, not CentOS 5. Would that make the difference?

Thanks.
mikeday
Hmm, difficult to diagnose this remotely. Perhaps it would be better to install the Red Hat Liberation fonts (yum install liberation-fonts). This will require adding some CSS rules to fonts.css:
@font-face {
    font-family: serif;
    src: local("Liberation Serif")
}
msicorp
That seemed to work. Everything is working now. Thanks again for all the help!