Oxygen 12.1, Arial Unicode MS font, bold not appearing in PDF

Here should go questions about transforming XML with XSLT and FOP.
mexiken
Posts: 2
Joined: Tue Nov 08, 2011 10:53 pm

Oxygen 12.1, Arial Unicode MS font, bold not appearing in PDF

Post by mexiken »

Very similar issue to a few that I have read on this forum, but the solutions there did not work.

The problem I am having is two-fold. First, my symbols were not appearing in my Docbook > PDF output. All my Ohm symbols were #. I read that I could change my body.font.family from default (serif) to Arial Unicode MS.

Changing the body.font.family fixed the problem with my symbols, but now none of my bold or italics are showing up in my PDF.

Do you have any suggestions that can solve both of these problems? Thanks so much!

-kk

Image
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Oxygen 12.1, Arial Unicode MS font, bold not appearing in PDF

Post by sorin_ristache »

Hello,

If you need Arial Unicode MS for normal text, bold text and italic text in the body of the document then you need to register in the FOP configuration file all these 3 variants of Arial Unicode MS, something like:

Code: Select all

      <fonts>
<font metrics-url="Arialuni.xml" kerning="yes"
embed-url="file:/Library/Fonts/Arialuni.ttf">
<font-triplet name="Arialuni" style="normal" weight="normal"/>
</font>

<font metrics-url="Arialuni-Bold.xml" kerning="yes"
embed-url="file:/Library/Fonts/Arialuni-Bold.ttf">
<font-triplet name="Arialuni" style="normal" weight="bold"/>
</font>

<font metrics-url="Arialuni-Italic.xml" kerning="yes"
embed-url="file:/Library/Fonts/Arialuni-Italic.ttf">
<font-triplet name="Arialuni" style="italic" weight="normal"/>
</font>
</fonts>
There is an example config file that comes with Oxygen: [Oxygen-install-folder]/lib/fop-config.xml. The procedure is the same and should be executed once for each font variant from the FOP configuration file.


Regards,
Sorin
mexiken
Posts: 2
Joined: Tue Nov 08, 2011 10:53 pm

Re: Oxygen 12.1, Arial Unicode MS font, bold not appearing in PDF

Post by mexiken »

Hi Sorin,

Thanks for your quick reply. The font I was trying to use is called "Arial Unicode MS". The fonts in Windows XP had slightly different names than your example. I have updated your sample code to show what I did that worked.

Code: Select all

<fonts>

<font metrics-url="Arialuni.xml" kerning="yes"
embed-url="file:c:/Windows/Fonts/Arialuni.ttf">
<font-triplet name="Arial Unicode MS" style="normal" weight="normal"/>
</font>

<font metrics-url="Arialuni-Bold.xml" kerning="yes"
embed-url="file:C:/Windows/Fonts/Arialbd.ttf">
<font-triplet name="Arial Unicode MS" style="normal" weight="bold"/>
</font>

<font metrics-url="Arialuni-Italic.xml" kerning="yes"
embed-url="file:C:/Windows/Fonts/Ariali.ttf">
<font-triplet name="Arial Unicode MS" style="italic" weight="normal"/>
</font>

<directory>C:\Windows\Fonts</directory>
<auto-detect/>
</fonts>
The ttfConvert.bat file was as follows:

Code: Select all

set LIB=lib
set CMD=java -cp "%LIB%\fop.jar;%LIB%\avalon-framework-4.2.0.jar;%LIB%\xercesImpl.jar"
set CMD=%CMD% org.apache.fop.fonts.apps.TTFReader
set FONT_DIR=C:\Windows\Fonts
%CMD% %FONT_DIR%\Arialuni.ttf Arialuni.xml
%CMD% %FONT_DIR%\ArialBd.ttf Arialuni-Bold.xml
%CMD% %FONT_DIR%\Ariali.ttf Arialuni-Italic.xml
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Oxygen 12.1, Arial Unicode MS font, bold not appearing in PDF

Post by sorin_ristache »

Hi,

Thanks for letting us know. I am glad setting the FOP fonts worked for you.


Regards,
Sorin
Post Reply