You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Jill DeLong <ji...@optifacts.com> on 2009/09/14 16:26:15 UTC

Printing Latin-2 characters

We have been using the fop to print out documents so far in English, French
and Swedish with no problems.  However, we now have a need to print in
Polish which uses characters in the ISO-8859-2 character set.  In the
documentation I've read so far for Fop, it says the -ps and -pdf probably do
not handle anything other than ISO-8859-1 (Latin-1) as has seemed to be the
case so far - it prints # signs instead of the accented Polish characters.
The only solution I've found so far is to use the -print argument instead -
this uses the AWT library and, although font size for the line with the
Polish characters looks slightly different from the other lines, it works.
My problem is, however, that it does not seem to allow specifying which
printer to print to - it only allows the -print with no argument.  We would
need this to work for a multi-instance Linux server where the printers are
networked and some can be in Portugal and others in Poland - so we need to
be able to specify where the output will go.

 

Any suggestions?  Or is there an easier/better way to print these
characters?  We tried with UTF-8 but Fop's documentation says it does not
support the multi-byte characters yet.

 

Jill

 


RE: Printing Latin-2 characters

Posted by Jonathan Levinson <Jo...@intersystems.com>.
I've succeeded in printing in Chinese using a Microsoft Windows Chinese
font using FOP 0.95 which can auto-detect operating system fonts.

 

I specified the font family - 'Microsoft JhengHei'.

 

A crucial step was modifying the fop.xconf file to auto-detect OS fonts:

 

   <fonts>

                <auto-detect/>

      </fonts>

 

On Microsoft XP using a Latin-2 font family, I think a similar approach
would work.

 

I realize you are discussing LINUX, but maybe something similar would
work there.

 

Here is a link to the font documentation:
http://xmlgraphics.apache.org/fop/0.95/fonts.html

 

HTH,

Jonathan S. Levinson

 

From: Jill DeLong [mailto:jill@optifacts.com] 
Sent: Monday, September 14, 2009 10:26 AM
To: fop-users@xmlgraphics.apache.org
Subject: Printing Latin-2 characters

 

We have been using the fop to print out documents so far in English,
French and Swedish with no problems.  However, we now have a need to
print in Polish which uses characters in the ISO-8859-2 character set.
In the documentation I've read so far for Fop, it says the -ps and -pdf
probably do not handle anything other than ISO-8859-1 (Latin-1) as has
seemed to be the case so far - it prints # signs instead of the accented
Polish characters.  The only solution I've found so far is to use the
-print argument instead - this uses the AWT library and, although font
size for the line with the Polish characters looks slightly different
from the other lines, it works.  My problem is, however, that it does
not seem to allow specifying which printer to print to - it only allows
the -print with no argument.  We would need this to work for a
multi-instance Linux server where the printers are networked and some
can be in Portugal and others in Poland - so we need to be able to
specify where the output will go.

 

Any suggestions?  Or is there an easier/better way to print these
characters?  We tried with UTF-8 but Fop's documentation says it does
not support the multi-byte characters yet.

 

Jill

 


Re: Printing Latin-2 characters

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
As PostScript output only supports Type 1 fonts at the moment, you need
to look for a Type 1 font that has all the glyphs you need for
ISO-8859-2.

Here are a couple of font packages that should contain fonts with the
necessary characters:
http://canopus.iacp.dvo.ru/~panov/cm-unicode/
http://dir.filewatcher.com/d/FreeBSD/distfiles/Other/urw-fonts.tar.gz.1544494.html

Or you can look at commercial font shops which surely have fonts with
the necessary characters.

On 14.09.2009 17:29:22 Jill DeLong wrote:
> Thank you, Mariusz.
> 
> Do you know which font you are using for this?  It looks like we are trying
> to use Arial for the xsl but when I output using -at application/postscript,
> the resulting file is giving me < ... font-name="any" ... >.  I think this
> may be the culprit and I will try to use Helvetica/Times/Courier instead,
> unless you know of a font that works best for you?
> 
> Jill DeLong
> 
> 
> -----Original Message-----
> From: Mariusz Pekala [mailto:skoot@qi.pl] 
> Sent: Monday, September 14, 2009 10:11 AM
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: Printing Latin-2 characters
> 
> On 2009-09-14 09:26:15 -0500 (Mon, Sep), Jill DeLong wrote:
> > We have been using the fop to print out documents so far in English,
> French
> > and Swedish with no problems.  However, we now have a need to print in
> > Polish which uses characters in the ISO-8859-2 character set.
> [..]
> > 
> > Any suggestions?  Or is there an easier/better way to print these
> > characters?  We tried with UTF-8 but Fop's documentation says it does not
> > support the multi-byte characters yet.
>  
> I can only say that for me, fop works perfectly with Polish, and UTF-8 in
> general.
> 
> I am using fop-0.95beta on the output from css2xslfo1_5_2.
> I don't think css2xslfo changes anything.
> 
> -- 
> iDelfi Polska Sp. z o.o., ul. Kołobrzeska 50, 10-434 Olsztyn
> http://www.idelfi.com
> NIP7393665905 REGON280269116 KRS0000297600 Kapitał zakładowy: 120 000 PLN
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 




Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Printing Latin-2 characters

Posted by Mariusz Pekala <m....@idelfi.com>.
On 2009-09-14 10:29:22 -0500 (Mon, Sep), Jill DeLong wrote:
> Thank you, Mariusz.
> 
> Do you know which font you are using for this?  It looks like we are trying
> to use Arial for the xsl but when I output using -at application/postscript,
> the resulting file is giving me < ... font-name="any" ... >.  I think this
> may be the culprit and I will try to use Helvetica/Times/Courier instead,
> unless you know of a font that works best for you?
> 

Ah, sorry. I should say it at once ;-)

I am using freefonts-ttf from http://savannah.nongnu.org/projects/freefont/

I have created xml files for these fonts (It may be not necessary now,
but it worked for me and I decided "if it works then don't fix it").

The info on how to make the font's xml file is on http://xmlgraphics.apache.org/fop/0.95/fonts.html
and I attached my old Rakefile, in case you find it useful.

Part of my fop.xconf file:
  <font metrics-url="file:///home/case/fonts/FreeSans.xml" kerning="yes" embed-url="file:///home/case/fonts/f/FreeSans.ttf">
    <font-triplet name="FreeSans"   style="normal" weight="normal"/>
    <font-triplet name="Verdana"    style="normal" weight="normal"/>
    <font-triplet name="Arial"      style="normal" weight="normal"/>
    <font-triplet name="sans-serif" style="normal" weight="normal"/>
  </font>
  <font metrics-url="file:///home/case/fonts/FreeSansBold.xml" kerning="yes" embed-url="file:///home/case/fonts/f/FreeSansBold.ttf">
    <font-triplet name="FreeSans"   style="normal" weight="bold"/>
    <font-triplet name="Verdana"    style="normal" weight="bold"/>
    <font-triplet name="Arial"      style="normal" weight="bold"/>
    <font-triplet name="sans-serif" style="normal" weight="bold"/>
  </font>
  <font metrics-url="file:///home/case/fonts/FreeSansOblique.xml" kerning="yes" embed-url="file:///home/case/fonts/f/FreeSansOblique.ttf">
    <font-triplet name="FreeSans"   style="italic"  weight="normal"/>
    <font-triplet name="Verdana"    style="italic"  weight="normal"/>
    <font-triplet name="Arial"      style="italic"  weight="normal"/>
    <font-triplet name="sans-serif" style="italic"  weight="normal"/>

    <font-triplet name="FreeSans"   style="oblique" weight="normal"/>
    <font-triplet name="Verdana"    style="oblique" weight="normal"/>
    <font-triplet name="Arial"      style="oblique" weight="normal"/>
    <font-triplet name="sans-serif" style="oblique" weight="normal"/>
  </font>
  <font metrics-url="file:///home/case/fonts/FreeSansBoldOblique.xml" kerning="yes" embed-url="file:///home/case/fonts/f/FreeSansBoldOblique.ttf">
    <font-triplet name="FreeSans"   style="italic"  weight="bold"/>
    <font-triplet name="Verdana"    style="italic"  weight="bold"/>
    <font-triplet name="Arial"      style="italic"  weight="bold"/>
    <font-triplet name="sans-serif" style="italic"  weight="bold"/>

    <font-triplet name="FreeSans"   style="oblique" weight="bold"/>
    <font-triplet name="Verdana"    style="oblique" weight="bold"/>
    <font-triplet name="Arial"      style="oblique" weight="bold"/>
    <font-triplet name="sans-serif" style="oblique" weight="bold"/>
  </font>


  <font metrics-url="file:///home/case/fonts/FreeSerif.xml" kerning="yes" embed-url="file:///home/case/fonts/f/FreeSerif.ttf">
    <font-triplet name="FreeSerif"  style="normal" weight="normal"/>
    <font-triplet name="Georgia"    style="normal" weight="normal"/>
    <font-triplet name="Times"      style="normal" weight="normal"/>
    <font-triplet name="serif"      style="normal" weight="normal"/>
    <font-triplet name="any"        style="normal" weight="normal"/>
  </font>
  <font metrics-url="file:///home/case/fonts/FreeSerifBold.xml" kerning="yes" embed-url="file:///home/case/fonts/f/FreeSerifBold.ttf">
    <font-triplet name="FreeSerif"  style="normal" weight="bold"/>
    <font-triplet name="Georgia"    style="normal" weight="bold"/>
    <font-triplet name="Times"      style="normal" weight="bold"/>
    <font-triplet name="serif"      style="normal" weight="bold"/>
    <font-triplet name="any"        style="normal" weight="bold"/>
  </font>
  <font metrics-url="file:///home/case/fonts/FreeSerifItalic.xml" kerning="yes" embed-url="file:///home/case/fonts/f/FreeSerifItalic.ttf">
    <font-triplet name="FreeSerif"  style="italic"  weight="normal"/>
    <font-triplet name="Georgia"    style="italic"  weight="normal"/>
    <font-triplet name="Times"      style="italic"  weight="normal"/>
    <font-triplet name="serif"      style="italic"  weight="normal"/>
    <font-triplet name="any"        style="italic"  weight="normal"/>
  </font>
  <font metrics-url="file:///home/case/fonts/FreeSerifBoldItalic.xml" kerning="yes" embed-url="file:///home/case/fonts/f/FreeSerifBoldItalic.ttf">
    <font-triplet name="FreeSerif"  style="italic"  weight="bold"/>
    <font-triplet name="Georgia"    style="italic"  weight="bold"/>
    <font-triplet name="Times"      style="italic"  weight="bold"/>
    <font-triplet name="serif"      style="italic"  weight="bold"/>
    <font-triplet name="any"        style="italic"  weight="bold"/>
  </font>


  <font metrics-url="file:///home/case/fonts/FreeMono.xml" kerning="yes" embed-url="file:///home/case/fonts/f/FreeMono.ttf">
    <font-triplet name="FreeMono"   style="normal" weight="normal"/>
    <font-triplet name="Courier"    style="normal" weight="normal"/>
    <font-triplet name="monospace"  style="normal" weight="normal"/>
  </font>
  <font metrics-url="file:///home/case/fonts/FreeMonoBold.xml" kerning="yes" embed-url="file:///home/case/fonts/f/FreeMonoBold.ttf">
    <font-triplet name="FreeMono"   style="normal" weight="bold"/>
    <font-triplet name="Courier"    style="normal" weight="bold"/>
    <font-triplet name="monospace"  style="normal" weight="bold"/>
  </font>
  <font metrics-url="file:///home/case/fonts/FreeMonoOblique.xml" kerning="yes" embed-url="file:///home/case/fonts/f/FreeMonoOblique.ttf">
    <font-triplet name="FreeMono"   style="italic"  weight="normal"/>
    <font-triplet name="Courier"    style="italic"  weight="normal"/>
    <font-triplet name="monospace"  style="italic"  weight="normal"/>

    <font-triplet name="FreeMono"   style="oblique" weight="normal"/>
    <font-triplet name="Courier"    style="oblique" weight="normal"/>
    <font-triplet name="monospace"  style="oblique" weight="normal"/>
  </font>
  <font metrics-url="file:///home/case/fonts/FreeMonoBoldOblique.xml" kerning="yes" embed-url="file:///home/case/fonts/f/FreeMonoBoldOblique.ttf">
    <font-triplet name="FreeMono"   style="italic"  weight="bold"/>
    <font-triplet name="Courier"    style="italic"  weight="bold"/>
    <font-triplet name="monospace"  style="italic"  weight="bold"/>

    <font-triplet name="FreeMono"   style="oblique" weight="bold"/>
    <font-triplet name="Courier"    style="oblique" weight="bold"/>
    <font-triplet name="monospace"  style="oblique" weight="bold"/>
  </font>
</fonts>


==== Rakefile:

FOP_CLASSPATH=%w[
  /home/case/fop-0.95beta/lib/xmlgraphics-commons-1.3.jar
  /home/case/fop-0.95beta/lib/xml-apis-ext.jar
  /home/case/fop-0.95beta/lib/xml-apis-1.3.02.jar
  /home/case/fop-0.95beta/lib/xercesImpl-2.7.1.jar
  /home/case/fop-0.95beta/lib/xalan-2.7.0.jar
  /home/case/fop-0.95beta/lib/serializer-2.7.0.jar
  /home/case/fop-0.95beta/lib/commons-logging-1.0.4.jar
  /home/case/fop-0.95beta/lib/commons-io-1.3.1.jar
  /home/case/fop-0.95beta/lib/batik-all-1.7.jar
  /home/case/fop-0.95beta/lib/avalon-framework-4.2.0.jar
  /home/case/fop-0.95beta/build/fop.jar
  /home/case/fop-0.95beta/build/fop-sandbox.jar
  /home/case/fop-0.95beta/build/fop-hyph.jar
  .
]
FOP_CLASSPATH_LINE = FOP_CLASSPATH.join(':')

FONTS=%w[
  FreeMonoBoldOblique
  FreeMonoBold
  FreeMonoOblique
  FreeMono
  FreeSansBoldOblique
  FreeSansBold
  FreeSansOblique
  FreeSans
  FreeSerifBoldItalic
  FreeSerifBold
  FreeSerifItalic
  FreeSerif
]

rule( '.xml' => proc {|task_name| 'f/' + task_name.sub(/\.xml$/,'.ttf')} ) do |t|
  sh "java", '-classpath', FOP_CLASSPATH_LINE, 'org.apache.fop.fonts.apps.TTFReader', t.source, t.name
end

task( :all => FONTS.map {|f| f + '.xml'} )

#task :font do
#  #h "java", '-classpath', FOP_CLASSPATH_LINE, 'org.apache.fop.cli.Main', "a.fo", "b.pdf"
#  #h "java", '-classpath', FOP_CLASSPATH_LINE, 'org.apache.fop.fonts.apps.PFMReader', 'f/n019003l.afm', 'nimbus.xml'
#  sh "java", '-classpath', FOP_CLASSPATH_LINE, 'org.apache.fop.fonts.apps.TTFReader', 'f/FreeSans.ttf', 'free_sans.xml'
#end

===== EOF
-- 
iDelfi Polska Sp. z o.o., ul. Kołobrzeska 50, 10-434 Olsztyn
http://www.idelfi.com
NIP7393665905 REGON280269116 KRS0000297600 Kapitał zakładowy: 120 000 PLN

RE: Printing Latin-2 characters

Posted by Jill DeLong <ji...@optifacts.com>.
Thank you, Mariusz.

Do you know which font you are using for this?  It looks like we are trying
to use Arial for the xsl but when I output using -at application/postscript,
the resulting file is giving me < ... font-name="any" ... >.  I think this
may be the culprit and I will try to use Helvetica/Times/Courier instead,
unless you know of a font that works best for you?

Jill DeLong


-----Original Message-----
From: Mariusz Pekala [mailto:skoot@qi.pl] 
Sent: Monday, September 14, 2009 10:11 AM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Printing Latin-2 characters

On 2009-09-14 09:26:15 -0500 (Mon, Sep), Jill DeLong wrote:
> We have been using the fop to print out documents so far in English,
French
> and Swedish with no problems.  However, we now have a need to print in
> Polish which uses characters in the ISO-8859-2 character set.
[..]
> 
> Any suggestions?  Or is there an easier/better way to print these
> characters?  We tried with UTF-8 but Fop's documentation says it does not
> support the multi-byte characters yet.
 
I can only say that for me, fop works perfectly with Polish, and UTF-8 in
general.

I am using fop-0.95beta on the output from css2xslfo1_5_2.
I don't think css2xslfo changes anything.

-- 
iDelfi Polska Sp. z o.o., ul. Kołobrzeska 50, 10-434 Olsztyn
http://www.idelfi.com
NIP7393665905 REGON280269116 KRS0000297600 Kapitał zakładowy: 120 000 PLN



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Printing Latin-2 characters

Posted by Mariusz Pekala <sk...@qi.pl>.
On 2009-09-14 09:26:15 -0500 (Mon, Sep), Jill DeLong wrote:
> We have been using the fop to print out documents so far in English, French
> and Swedish with no problems.  However, we now have a need to print in
> Polish which uses characters in the ISO-8859-2 character set.
[..]
> 
> Any suggestions?  Or is there an easier/better way to print these
> characters?  We tried with UTF-8 but Fop's documentation says it does not
> support the multi-byte characters yet.
 
I can only say that for me, fop works perfectly with Polish, and UTF-8 in general.

I am using fop-0.95beta on the output from css2xslfo1_5_2.
I don't think css2xslfo changes anything.

-- 
iDelfi Polska Sp. z o.o., ul. Kołobrzeska 50, 10-434 Olsztyn
http://www.idelfi.com
NIP7393665905 REGON280269116 KRS0000297600 Kapitał zakładowy: 120 000 PLN