Domanda

I have been using Highcharts on a Windows-based webserver and have recently migrated to a Oracle Enterprise Linux server instead. I'm having an issue with fonts when I export charts to PNG format: the fonts in the SVG are not being honoured.

I have followed instructions in various places to install Microsoft fonts and to ensure that Lucida Grande (the preferred font family, as specified in the SVG) is installed as a TrueType font on the Linux machine.

Despite my efforts (including using -font-family option of the rasterizer to specify a default font family), all the fonts in generated PNGs come out as something bold and italic (I don't know what font it is).

So, in summary, my questions are:

  1. Should Batik rasterizer automatically be able to use whatever fonts are installed on the Linux machine?
  2. Do I have to tell the rasterizer where the fonts are?
  3. Have I installed fonts correctly, judging from the links I supplied above? (Both appeared successful.)
È stato utile?

Soluzione

Solved it!

The answers to my questions are:

  1. Yes.
  2. No.
  3. Yes.

The issue was that when I followed the instructions to install TrueType fonts, this was done as root but the permissions weren't automatically set, meaning that other users (like the apache user that runs the webserver) weren't allowed to read the font files.

The fix, therefore, was:

cd /usr/share/fonts
chmod 755 ttfonts/
cd ttfonts/
chmod 644 *.*
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top