Hi Jeremias,

Thanks for your detailed answer. I'm trying to follow your instructions but
got some troubles.

I've put that:   
  < font embed-url="file:///C:/home/debug/pdf/base14/Helvetica.pfb">
   ...
in PDF renderer section and
   <referenced-fonts>
      <match font-family="Helvetica"/>
   </referenced-fonts>
in general section, before renderer definitions and get:

SEVERE: Exception
org.apache.fop.apps.FOPException: Failed to resolve font with embed-url
'file:///C:/home/debug/pdf/base14/Helvetica.pfb'
        at org.apache.fop.util.LogUtil.handleError(LogUtil.java:38)
        at
org.apache.fop.fonts.FontInfoConfigurator.getFontInfo(FontInfoConfigurator.java:212)

Changing .pfb into .amf doesn't help:
SEVERE: Exception
org.apache.fop.apps.FOPException: Failed to resolve font with embed-url
'file:///C:/home/debug/pdf/base14/Helvetica.amf'
        at org.apache.fop.util.LogUtil.handleError(LogUtil.java:38)
        at
org.apache.fop.fonts.FontInfoConfigurator.getFontInfo(FontInfoConfigurator.java:212)

I've double checked path and file names. Am I missing something?

What do you think about another idea: I could change
src\codegen\fonts\Helvetica.xml from StandardEncoding into CEEncoding, then
modify "codegen" target in build.xml, replacing WinAnsiEncoding with
CEEncoding and build FOP from sources. Is it proper way to go?

Regards,

Tomasz


Jeremias Maerki-2 wrote:
> 
> Hi Tomasz
> 
> FOP currently hardcodes the base14 fonts as Java classes and in
> single-byte, single-encoding mode. That means (except for Symbol and
> ZapfDingbats) WinAnsiEncoding only. So currently, there is no
> possibility to get CE characters out of the box, because FOP doesn't
> have the character metrics for these additional characters.
> 
> PDF 1.4 defines the set of Base 14 fonts and mentions that the
> corresponding AFM metrics files can be downloaded from Adobe's website.
> That also implies that all characters found in the AFM files are to be
> considered available. As you've seen above, FOP only supports a subset
> of that at the moment.
> 
> What you can do at this time is just configure the base 14 fonts in
> userconfig.xml to override FOP's built-in set:
> 
> Download the base 14 AFM set from here:
> 
> http://www.adobe.com/devnet/font.html
> http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/font/pdfs/Core14_AFMs.zip
> 
> Put all the AFMs in a directory. Repeat the following for every base 14
> font that you need:
> 
>    
>      <font-triplet name="Helvetica" style="normal" weight="normal"/>
>      <font-triplet name="sans-serif" style="normal" weight="normal"/>
>      <font-triplet name="any" style="normal" weight="normal"/>
>    
> 
> Obviously, you have to adjust the file URL and change font-triplets as
> necessary. And you'll note my use of the ".pfb" file (tha actual font
> program) which is not in the ZIP downloaded from Adobe. That doesn't
> matter. FOP derives the ".afm" file from the ".pfb" filename. The final
> clue is not to embed the font by adding:
> 
>   <fonts> <!-- that's the general "fonts" section, not the format-specific
> one! -->
>     <referenced-fonts>
>       <match font-family="Helvetica"/>
>     </referenced-fonts>
>   </fonts>
> 
> See http://xmlgraphics.apache.org/fop/1.0/fonts.html#embedding
> 
> That should give you what you're looking for.
> 
> 
> On 23.06.2011 23:42:33 Tomasz Judycki wrote:
>> 
>> Mehdi,
>> 
>> May be I don't understand details in PDF technology - I'm not an expert
>> in
>> this area. It seems to me that my example of PDF file use WinAnsi
>> encoding
>> for base 14 fonts. Look inside, at font definitions:
>> /Type /Font
>> /Subtype /Type1
>> /Name /BF5
>> /Encoding 4 0 R
>> /BaseFont /Helvetica
>> 
>> Encoding is defined in 4 0 R, I've quoted it already:
>> 4 0 obj
>> <<
>> /Type /Encoding
>> /BaseEncoding /WinAnsiEncoding
>> /Differences [
>> 143 /Zacute
>> 159 /zacute
>> ....
>> 
>> Isn't in Base14 font in WinAnsi encoding? And still some extra characters
>> -
>> defined by glyph names - are displayed properly.
>> 
>> I don't want FOP to support other encodings in Base14 fonts - I'm not
>> sure
>> if it's possible according to PDF format. I just want to add that
>> "/Differences" - this mechanism is supported in PDFEncoding.java but
>> that's
>> for embedded fonts only, I believe.
>> 
>> If you know perfectly FOP source code and assure that there is absolutely
>> no
>> way to produce a PDF like the one I've attached then I'll try to
>> implement
>> that mechanism in FOP. It could be difficult to me because of my limited
>> knowledge of FOP and PDF but it's worth trying.
>> 
>> Tomasz
>> 
>> 
>> mehdi houshmand wrote:
>> > 
>> > Hi Tomasz,
>> > 
>> > Sorry, maybe I didn't communicate what I meant properly. I wasn't
>> > saying there's no way to do that in PDF, or that the PDF spec doesn't
>> > allow that. I only meant that in FOP the base 14 fonts are encoded
>> > using WinAnsi. This means that FOP doesn't do what you're asking for.
>> > It is possible to get FOP to support more encodings, but the feature
>> > would have to be implemented.
>> > 
>> > Mehdi
>> > 
>> > On 23 June 2011 18:36, Tomasz Judycki <[email protected]> wrote:
>> >>
>> >> Hi Mehdi,
>> >>
>> >> Have you looked at pdf_pl.pdf attached to my first post? This is proof
>> >> that
>> >> it's possible to do what I want. The size of this file is < 12kb,
>> >> definitely
>> >> no embedded fonts but all Polish characters are properly printed. I
>> guess
>> >> you can't read Polish but compare PDF with JPG and if they look the
>> same
>> >> you
>> >> can't say that there's no way to do that.
>> >>
>> >> I just don't know how to use the same method using FOP.
>> >>
>> >> Regards,
>> >>
>> >> Tomasz
>> >>
>> >>
>> >>
>> >> mehdi houshmand wrote:
>> >>>
>> >>> Hi Tomasz,
>> >>>
>> >>> I could be wrong here, since I haven't tested this myself, but I'm
>> >>> pretty sure that currently there's no way to do what you're wanting
>> >>> without embedding the font. The Base14Fonts only look like they
>> >>> support WinAnsi encoding (with the obvious exception of ZapfDingbats
>> >>> and Symbol).
>> >>>
>> >>> Hope that helps,
>> >>>
>> >>> Mehdi
>> >>>
>> >>> On 23 June 2011 13:45, Tomasz Judycki <[email protected]> wrote:
>> >>>>
>> >>>> Hi!
>> >>>>
>> >>>> People say that it's not possible to generate a PDF file with
>> Central
>> >>>> European characters using only Base14 fonts and that embedding true
>> >>>> type
>> >>>> fonts is necessary to achieve that. However I managed to do so,
>> using
>> >>>> another technology, several years ago. Look at the example
>> >>>> http://old.nabble.com/file/p31910912/pdf_pl.pdf pdf_pl.pdf  (it
>> should
>> >>>> looks
>> >>>> like  http://old.nabble.com/file/p31910912/pdf_pl.jpg pdf_pl.jpg ).
>> >>>> This
>> >>>> PDF
>> >>>> file contains:
>> >>>>
>> >>>> 4 0 obj
>> >>>> <<
>> >>>> /Type /Encoding
>> >>>> /BaseEncoding /WinAnsiEncoding
>> >>>> /Differences [
>> >>>> 143 /Zacute
>> >>>> 159 /zacute
>> >>>> 140 /Sacute
>> >>>> 156 /sacute
>> >>>> 202 /Eogonek
>> >>>> 234 /eogonek
>> >>>> 198 /Cacute
>> >>>> 230 /cacute
>> >>>> 209 /Nacute
>> >>>> 241 /nacute
>> >>>> 211 /Oacute
>> >>>> 243 /oacute
>> >>>> 163 /Lslash
>> >>>> 179 /lslash
>> >>>> 165 /Aogonek
>> >>>> 185 /aogonek
>> >>>> 175 /Zdotaccent
>> >>>> 191 /zdotaccent
>> >>>> ]
>> >>>>>>
>> >>>> endobj
>> >>>>
>> >>>> The problem was described several times, e.g.:
>> >>>>
>> http://old.nabble.com/Using-Central-European-characters-td3739791.html
>> >>>> https://issues.apache.org/bugzilla/show_bug.cgi?id=17828
>> >>>>
>> >>>> It seems that FOP 1.0 implements Central European encoding, for
>> example
>> >>>> in
>> >>>> src/codegen/fonts/encodings.xml there is definition of CE_ENCODING.
>> >>>>
>> >>>> The question is: how could I generate PDF from
>> >>>> http://old.nabble.com/file/p31910912/pltext.fo pltext.fo  (effect
>> >>>> should
>> >>>> looks like  http://old.nabble.com/file/p31910912/pltext.jpg
>> pltext.jpg
>> >>>> )
>> >>>> using just Base14 fonts?
>> >>>>
>> >>>> I would like to avoid embedding true type fonts to simplify the
>> >>>> solution
>> >>>> and
>> >>>> to keep PDF small. Embedded font means +300kb.
>> >>>>
>> >>>> Regards,
>> >>>>
>> >>>> Tomasz Judycki
>> >>>>
>> >>>> --
>> >>>> View this message in context:
>> >>>>
>> http://old.nabble.com/Central-European-characters-in-PDF-with-Base14-fonts-tp31910912p31910912.html
>> >>>> Sent from the FOP - Users mailing list archive at Nabble.com.
>> >>>>
>> >>>>
>> >>>>
>> ---------------------------------------------------------------------
>> >>>> To unsubscribe, e-mail: [email protected]
>> >>>> For additional commands, e-mail:
>> [email protected]
>> >>>>
>> >>>>
>> >>>
>> >>> ---------------------------------------------------------------------
>> >>> To unsubscribe, e-mail: [email protected]
>> >>> For additional commands, e-mail:
>> [email protected]
>> >>>
>> >>>
>> >>>
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://old.nabble.com/Central-European-characters-in-PDF-with-Base14-fonts-tp31910912p31911981.html
>> >> Sent from the FOP - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: [email protected]
>> >> For additional commands, e-mail: [email protected]
>> >>
>> >>
>> > 
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [email protected]
>> > For additional commands, e-mail: [email protected]
>> > 
>> > 
>> > 
>> 
>> -- 
>> View this message in context:
>> http://old.nabble.com/Central-European-characters-in-PDF-with-Base14-fonts-tp31910912p31915041.html
>> Sent from the FOP - Users mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>> 
> 
> 
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Central-European-characters-in-PDF-with-Base14-fonts-tp31910912p31919423.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to