How to change the font for <package> on PDF generation
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 41
- Joined: Fri Dec 15, 2006 8:09 pm
- Location: Madrid
- Contact:
How to change the font for <package> on PDF generation
Dear members,
I can configurate the font family for HTML generation process, because you only have to redefine the style, for example:
on *.css file, but how can I do the same for PDF generation. On the generation properties I don't see such configuration property.
Thanks in advance,
David
I can configurate the font family for HTML generation process, because you only have to redefine the style, for example:
Code: Select all
.package {
font-family:"Courier New", Courier, monospace
}
Thanks in advance,
David
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello,
For PDF output you can set the font family for the body text with the body.font.family parameter and the body font size with the body.font.master parameter. You can find an example in the article "How to Add a Font to the <oXygen/> Built-in FO processor" available on the Documentation page.
Regards,
Sorin
For PDF output you can set the font family for the body text with the body.font.family parameter and the body font size with the body.font.master parameter. You can find an example in the article "How to Add a Font to the <oXygen/> Built-in FO processor" available on the Documentation page.
Regards,
Sorin
-
- Posts: 41
- Joined: Fri Dec 15, 2006 8:09 pm
- Location: Madrid
- Contact:
Dear Sorin,
Thanks again for your fast reply. Following your recomendation I am not sure if I have explained well on my last post the problem, becuase I just want to change the font only for <package> node not for body font.
On your replay the properties to set look quite general for all body text. I don't see where I have to set that for example whenerer it will find <package>com.abc.x</package> I will obtain the text of com.abc.x in courier font for the generated document for example.
Thanks in advance,
David
Thanks again for your fast reply. Following your recomendation I am not sure if I have explained well on my last post the problem, becuase I just want to change the font only for <package> node not for body font.
On your replay the properties to set look quite general for all body text. I don't see where I have to set that for example whenerer it will find <package>com.abc.x</package> I will obtain the text of com.abc.x in courier font for the generated document for example.
Thanks in advance,
David
-
- Posts: 4
- Joined: Mon Apr 23, 2007 9:20 pm
You could add this to your XSL customization layer:
<xsl:template match="package">
<fo:inline font-family="YourFont">
<xsl:apply-templates/>
</fo:inline>
</xsl:template>
Make sure your font is already added as previously discussed.
<xsl:template match="package">
<fo:inline font-family="YourFont">
<xsl:apply-templates/>
</fo:inline>
</xsl:template>
Make sure your font is already added as previously discussed.
[url=http://docbook.theblog.ca[/url]DocBook case study[/url]
-
- Posts: 41
- Joined: Fri Dec 15, 2006 8:09 pm
- Location: Madrid
- Contact:
Sorin,
Thanks again, I don't need to generate a new font becuase courier was defined. About the definition on the configuration file, your solution works only if you define the root node like this:
otherwise you have to specify the long name:
Regards,
David
Thanks again, I don't need to generate a new font becuase courier was defined. About the definition on the configuration file, your solution works only if you define the root node like this:
Code: Select all
<xsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format">
Code: Select all
<xsl:template match="package">
<fo:inline xmlns:fo="http://www.w3.org/1999/XSL/Format font-family="Courier">
<xsl:apply-templates/>
</fo:inline>
</xsl:template>
David
-
- Posts: 41
- Joined: Fri Dec 15, 2006 8:09 pm
- Location: Madrid
- Contact:
Dear Sorin,
I want to do the same process for for <foreignphrase> in order to use a different length:
it works for Courier font, but for Modern it doesn't. I have found the font names on location:
I have tried also with: Arial Narrow, Times New Roman, such fonts are very common, so I guess it should be built-in.
I am doing something wrong?
Where do I can find the fonts provided?
Thanks,
David
I want to do the same process for for <foreignphrase> in order to use a different length:
Code: Select all
<xsl:template match="foreignphrase">
<fo:inline font-family="Modern">
<xsl:apply-templates/>
</fo:inline>
</xsl:template>
Code: Select all
C:\WINDOWS\Fonts
I am doing something wrong?
Where do I can find the fonts provided?
Thanks,
David
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello,
You have to register Modern, Arial Narrow or Times New Roman in a FOP configuration file which you must set for FOP in Options -> Preferences -> XML -> XSLT/FO/XQuery -> FO Processors. See the article about registering fonts in FOP on the Documentation page.
Regards,
Sorin
You have to register Modern, Arial Narrow or Times New Roman in a FOP configuration file which you must set for FOP in Options -> Preferences -> XML -> XSLT/FO/XQuery -> FO Processors. See the article about registering fonts in FOP on the Documentation page.
Regards,
Sorin
-
- Posts: 41
- Joined: Fri Dec 15, 2006 8:09 pm
- Location: Madrid
- Contact:
Dear Sorin,
I am following the steps you recomend, I have generated the times and arial xml files using the ttconverter.bat.
My fopConfiguration.xml file looks like this:
I am assuming the location of *.ttf file has to be my local location of: C:/Windows/Fonts. I have added as external FO processor file on Oxygen configuration.
I didn't change the property body.font.family, because I don't want to change the default font, instead just to use Aria font for my: foreignphrase:
¿What I am doing wrong?
Thanks,
David
I am following the steps you recomend, I have generated the times and arial xml files using the ttconverter.bat.
My fopConfiguration.xml file looks like this:
Code: Select all
<?xml version="1.0" encoding="iso-8859-1"?>
<configuration>
<fonts>
<font metrics-file="arial.xml" kerning="yes" embed-file="file:C:/Windows/Fonts/Arial.ttf">
<font-triplet name="Arial" style="normal" weight="normal"/>
</font>
<font metrics-file="times.xml" kerning="yes" embed-file="file:C:/Windows/Fonts/times.ttf">
<font-triplet name="Arial" style="normal" weight="normal"/>
</font>
</fonts>
</configuration>
I didn't change the property body.font.family, because I don't want to change the default font, instead just to use Aria font for my: foreignphrase:
Code: Select all
<xsl:template match="foreignphrase">
<fo:inline font-family="Arial">
<xsl:apply-templates/>
</fo:inline>
</xsl:template>
Thanks,
David
-
- Posts: 4
- Joined: Mon Apr 23, 2007 9:20 pm
embed-file="file:C:/Windows/Fonts/Arial.ttf"
is the "file" necessary? Couldn't you just use:
embed-file="C:/Windows/Fonts/Arial.ttf"
or perhaps
embed-file="C:\Windows\Fonts\Arial.ttf"
is the "file" necessary? Couldn't you just use:
embed-file="C:/Windows/Fonts/Arial.ttf"
or perhaps
embed-file="C:\Windows\Fonts\Arial.ttf"
[url=http://docbook.theblog.ca[/url]DocBook case study[/url]
-
- Posts: 41
- Joined: Fri Dec 15, 2006 8:09 pm
- Location: Madrid
- Contact:
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello,
Regards,
Sorin
You used the same name for both fonts in the attribute name. You should use different names.dleal wrote:Code: Select all
<?xml version="1.0" encoding="iso-8859-1"?>
<configuration>
...
<font-triplet name="Arial" style="normal" weight="normal"/>
...
<font-triplet name="Arial" style="normal" weight="normal"/>
...
</configuration>
Regards,
Sorin
-
- Posts: 41
- Joined: Fri Dec 15, 2006 8:09 pm
- Location: Madrid
- Contact:
Dear Sorin,
Thanks again, I have modified, the fopConfiguration.xml, now I have:
and on the customization file I have:
but I don't get times on foreignphrase...
Do you have any suggestion, thans in advance,
David
Thanks again, I have modified, the fopConfiguration.xml, now I have:
Code: Select all
<?xml version="1.0" encoding="iso-8859-1"?>
<configuration>
<fonts>
<font metrics-file="arial.xml" kerning="yes" embed-file="C:\Windows\Fonts\Arial.ttf">
<font-triplet name="Arial" style="normal" weight="normal"/>
</font>
<font metrics-file="times.xml" kerning="yes" embed-file="C:\Windows\Fonts\Times.ttf">
<font-triplet name="Times" style="normal" weight="normal"/>
</font>
</fonts>
</configuration>
Code: Select all
<xsl:template match="foreignphrase">
<fo:inline font-family="Times">
<xsl:apply-templates/>
</fo:inline>
</xsl:template>
Do you have any suggestion, thans in advance,
David
-
- Posts: 41
- Joined: Fri Dec 15, 2006 8:09 pm
- Location: Madrid
- Contact:
Dear Sorin,
In order to reduce possible errors, I have moved the *.ttf to the same location of fopConfiguration.xml, so now I don't have the problem about the path on the XML, but the result is the same, it doesn't take into account the Arial/Time fonts.
Because it works with built-in fonts (I have tested it for Courier), please could you tell me another different font name that comes with Oxygen?
Thanks,
David
In order to reduce possible errors, I have moved the *.ttf to the same location of fopConfiguration.xml, so now I don't have the problem about the path on the XML, but the result is the same, it doesn't take into account the Arial/Time fonts.
Because it works with built-in fonts (I have tested it for Courier), please could you tell me another different font name that comes with Oxygen?
Thanks,
David
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello,
The oXygen installer does not install or copy font files to your computer. The fonts that you can set in oXygen are the ones that the Java virtual machine can find on your computer. I think it is a FOP problem and probably you can get more help from Apache FOP experts on the FOP mailing list.
Regards,
Sorin
The oXygen installer does not install or copy font files to your computer. The fonts that you can set in oXygen are the ones that the Java virtual machine can find on your computer. I think it is a FOP problem and probably you can get more help from Apache FOP experts on the FOP mailing list.
Regards,
Sorin
-
- Posts: 41
- Joined: Fri Dec 15, 2006 8:09 pm
- Location: Madrid
- Contact:
Dear Sorin,
Thanks again, just to higthlight, that it is also an Oxygen problem, because following the steps on the document "How to add a new font", I can't obtain the expected result. I am going to ask on such mailing list, if I find any solution, I will post on this forum.
Thanks again for your help,
David
Thanks again, just to higthlight, that it is also an Oxygen problem, because following the steps on the document "How to add a new font", I can't obtain the expected result. I am going to ask on such mailing list, if I find any solution, I will post on this forum.
Thanks again for your help,
David
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service