Pages: 1
Print
Author Topic: Customize PDF output fonts and RenerX graphic at bottom of page  (Read 16588 times)
jstaggart
Member

Posts: 11


« on: June 24, 2009, 11:58:20 AM »

I have managed to do some customization of the output. I can change the font size, and color. I have tried to change the font-family to something other then Sans or Serif, but it is ignored.

Is there a way to change the font-family?

Is there a way to remove the RenderX graphic and and message "XML to PDF by RenderX....." from the bottom of the page?
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #1 on: June 25, 2009, 02:45:08 PM »

The DITA OT specifies only three font types for PDF including "Sans", "Serif" and "Monospaced". These are mapped to actual fonts elsewhere.

To change the actual font family you need to map it to "Sans", "Serif" or "Monospaced" (or any other font references in the XSLT / XSL-FO that you might create yourself). This is done in the following file located here (by default):

C:\Program Files\Common Files\XMetaL Shared\DITA_OT\demo\xmfo\cfg\fo\font-mappings.xml
Or
C:\Program Files\Common Files\XMetaL Shared\DITA_OT\demo\fo\cfg\fo\font-mappings.xml

The first is for the "XMetaL Enhanced PDF..." deliverables, the second is for the "Book via RenderX" deliverable (referred to as "PDF2" in the DITA OT docs).

In that file you map "logical fonts" (those referenced in the XSLT / XSL-FO) to "physical fonts" (either Adobe PDF "Base 14" fonts, or those referenced in a file called xep.xml).

If the font you specify is not one of the Adobe PDF "Base 14" fonts you will need to embed it into the PDF to ensure universal readability on every system. This is done by modifying a RenderX XEP configuration file located here (by default):
C:\Program Files\Common Files\XMetaL Shared\renderx\xep.xml

Note: RenderX XEP includes documentation and additional tools inside subfolders in the same folder.

RenderX includes sample font mappings so you can study and reuse those. Find the following comment in xep.xml:
    <!-- Sample configuration for Windows TrueType fonts.  -->

The section right after that comment is entirely commented out, it begins like this:
<font-group xml:base="file:/C:/Windows/Fonts/" label="Windows TrueType" embed="true" subset="true">

This section is a sample, but if you remove the comments surrounding the section XEP will then begin embedding the fonts called "Arial", "Times New Roman", "Courier New", etc... (provided they are installed in C:\Windows\Fonts, which is also configurable in the same section) and provided you have referenced them in the file mentioned previously. You can also add your own sections to map other fonts. The sample is thorough enough that it should show you how to do that.
Logged
jstaggart
Member

Posts: 11


« Reply #2 on: June 29, 2009, 12:53:44 PM »

I am getting closer, but I am getting some error messages. I have the fonts installed and they are in the c:\windows\fonts directory (the *.pfm files). I put hte *.afm files in C:\program files\Common Files\XMetaL Shared\renderx\fonts. I modified the xep.xml file as follows:

    <font-group xml:base="file:/C:/Windows/Fonts/" label="WACustom" embed="true">
      <font-family name="Univers 55 Roman" embed="true">
        <font><font-data afm="UV______.AFM"/ ></font>
        <font style="oblique"><font-data afm="UVO_____.AFM" /></font>
        <font weight="bold"><font-data afm="UVBL____.AFM" /></font>
        <font weight="bold" style="oblique"><font-data afm="UVBLO___.AFM" /></font>
      </font-family>
    </font-group>

If I specify afm=..... I get the message that there is no outline file for font metric. If I specify pfm=... I get the message font metrics file not found. If I include both afm= and pfm= it tells me the configuration is corrupt.

Any ideas as to what I am doing wrong?
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #3 on: June 30, 2009, 01:21:12 PM »

I think the posting here may help you:

http://services.renderx.com/lists/xep-support/1705.html
Logged
jstaggart
Member

Posts: 11


« Reply #4 on: July 01, 2009, 11:05:55 AM »

Thanks Derek! I got it to work.
Logged
PhysicianHealthBC
Member

Posts: 2


« Reply #5 on: August 20, 2010, 02:15:28 PM »

Hi Derek, I am reading all of this and noting that .pfa, .pfb and .afm font types are mentioned. I would like to ask if this customization will work with .ttf font files stored in the Windows fonts area?

Sorry if this is a silly question, I am new here.
Logged
Su-Laine Yeo
Solutions Consultant
Member

Posts: 260


« Reply #6 on: August 20, 2010, 06:19:04 PM »

Yes, you can use TrueType (.tff) fonts. An example of declaring .tff fonts in the xep.xml file is here:
http://services.renderx.com/lists/xep-support/4657.html
Logged

Su-Laine Yeo
Solutions Consultant
JustSystems Canada, Inc.
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #7 on: August 20, 2010, 11:07:44 PM »

You can find detailed information on the types of fonts XEP supports and how it supports them here: http://www.renderx.com/reference.html

Search for "ttf", "font", etc, and you should find information relevent to configuring (specifically) the xep.xml file.

But yes, it supports TTF in addition to these other types. If you open the xep.xml file (discussed in this thread) you will see a sample section inside it that is commented out (search for ".ttf"). It lists .ttf fonts that Microsoft commonly installs as part of Windows (Arial, Times New Roman, etc).
« Last Edit: August 20, 2010, 11:09:33 PM by Derek Read » Logged
PhysicianHealthBC
Member

Posts: 2


« Reply #8 on: August 25, 2010, 02:48:28 PM »

Thank you Su for the prompt reply. I will check it out.

Also in this thread title it mentioned about the RenderX graphic at the bottom of the page. Can someone kindly please advise on removing all RenderX references and links that appear on the PDF outputs.
One line reads: 'XML to PDF by RenderX XEP XSL-FO Formatter, visit us at http://www.renderx.com/' and there is also the RenderX graphic logo along with a message saying 'Welcome to XML Author' on all pdf outputs.

Thank you in advance.


* renderX image.jpg (14.83 KB, 1037x129 - viewed 1289 times.)
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #9 on: August 25, 2010, 04:51:35 PM »

If you are running XMetaL Author Enterprise in trial mode then RenderX XEP is also running in trial mode. In trial mode XEP puts this logo on the bottom of each page and also prints blank pages after the first dozen.

If you convert a trial install to a licensed install you may continue to see the XEP logo. This is described in the release notes that ship with XMetaL Author Enterprise 6.0:

Quote from: XMEE 6.0 Release Notes
Generating PDF output still shows watermark after activating from a Trial to Full version
Before you generate output from a map after activating a Trial version to a Full version, do the following:

   1. Click Tools > Configure Output and click the Advanced tab.
   2. In the Advanced tab, change the value of the cmd_dita_ot_per_user_version parameter as follows: cmd_dita_ot_per_user_version = 0

When you generate output, you may be asked if you want to upgrade to a newer version of the toolkit. Click OK.

The text that states "Welcome to XMetaL Author" is coming from the map title. If you change the map title or produce a PDF from a different map with a different title this text should change. If you do not want to ever see titles in this location then customizations will need to be made to the XSLT that produce output.
« Last Edit: August 25, 2010, 04:53:23 PM by Derek Read » Logged
IF
Member

Posts: 80


« Reply #10 on: October 01, 2010, 02:15:10 PM »

All this information and the info in  http://forums.xmetal.com/index.php/topic,968.0.html   is very useful.

However, I can’t figure out how to specify the Calibri font in the xep.xml file.

This does not work
<font-family name="Calibri">
<font><font-data ttf="calibri.ttf"/></font>
<font style="oblique"><font-data ttf="calibrii.ttf"/></font>
<font weight="bold"><font-data ttf="calibrib.ttf"/></font>
<font weight="bold" style="oblique"><font-data ttf="calibriz.ttf"/></font>
</font-family>

I get the following error message when I try to create output from XMetal (Enhanced PDF with RenderX XEP), XMetal 6, Windows 7

<log_line>
[java] [error] Cannot read font metric from file:/C:/Windows/Fonts/calibrii.tff</log_line><log_line>
[java] [error] java.io.FileNotFoundException: C:\Windows\Fonts\calibrii.tff (The system cannot find the file specified)</log_line><log_line>
[java] Rendering failed: Could not obtain font metric for font family 'Calibri'</log_line>

Does anyone know how to refer to the calibri italic, calibri bold, and calibri italic bold fonts on Windows 7? I can get calibri regular to work (XEP accepts calibri.tff but cannot find calibrii.tff for instance)

When I search for these fonts on my machine, I see the following in the c:\windows\font directory: Calibri Bold, Calibri Bold Italic, Calibri Regular, Calibri Italic. There are no file extensions (e.g., no .tff).

Thanks.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #11 on: October 01, 2010, 04:18:04 PM »

I assume surrounding what you have posted is something like the following so XEP knows where the directory is:
<font-group xml:base="file:/C:/Windows/Fonts/" label="Windows TrueType" embed="true" subset="true">

Perhaps the fonts really are missing or somehow located somewhere else? I can reproduce the exact same error when I specify a missing font file. I'm not sure how to reproduce it otherwise.

See this thread that discusses how to view font file names in Windows 7: http://www.sevenforums.com/general-discussion/84516-fonts-dont-show-file-extensions.html

Or perhaps your font does not allow embedding? Following is from the XEP docs:
Quote
Note: TrueType and OpenType fonts may contain internal flags that prohibit their embedding or subsetting. XEP honors these flags and may refuse to embed or subset your font if the respective action is not authorized by the flags inside it.

Though in that case I would sort of expect XEP to give a better error message.
Logged
IF
Member

Posts: 80


« Reply #12 on: October 01, 2010, 04:56:11 PM »

Thanks - I confirmed the filename extensions using the command prompt window. I then tried to edit the xep.xml file again and this time it worked. I'm embarrassed to say that it did not work the first time because I made a typo (ttf vs tff). I should have picked that up from the log error message if I had read it carefully.  Thanks for the prompt reply.
Logged
Pages: 1
Print
Jump to:  

email us