You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by John Gentilin <ge...@eyecatching.com> on 2002/10/22 09:19:01 UTC

Including Fonts in 20.4

I want to include windows fonts in my PDF, but not embed them.
I converted the ttf font to XML, added it to my config file then I
made the change below to FontInfo.java to prevent the exception
that occurred where the embedFile is cast to a File object.

FOP seemed to run just fine and produced the PDF but when I go
to display the PDF, I get an error "110" problem with the document.
I tried to create a similar document with Acrobat and the major
difference
in the PDF is that there is font width information in the in the Font
declaration
section. I also noticed that the XML font file that I produce is much
different
that the XML font file that are part of the FOP source distribution ??

Is the XML File being produced correctly ?

Did I miss something ??

TIA
John G


Changes to FontInfo.java.

  */
 public String getEmbedFile() throws FOPException {
    if (embedFile == null) return null;



--
--------------------------------------
John Gentilin
Eye Catching Solutions Inc.
18314 Carlwyn Drive
Castro Valley CA 94546

    Contact Info
gentijo@eyecatching.com
Ca Office 1-510-881-4821
NJ Office 1-732-422-4917




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Including Fonts in 20.4

Posted by "J.Pietschmann" <j3...@yahoo.de>.
John Gentilin wrote:
> Found it, for some reason if I am not embedding fonts I need
> to encode the xml file with option "-enc ansi" once I did that it
> worked fine.
> 
> For this next version of FOP, can we make the change to FontInfo.java ??

Its on the list.

J.Pietschmann



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Including Fonts in 20.4

Posted by John Gentilin <ge...@eyecatching.com>.
Found it, for some reason if I am not embedding fonts I need
to encode the xml file with option "-enc ansi" once I did that it
worked fine.

For this next version of FOP, can we make the change to FontInfo.java ??

Regards
John G

John Gentilin wrote:

> Oleg,
>
> In short yes but... when you pull out that tag it causes the variable embedFile
> to become null. This is fine since  FontReader.java code states that you need
> to supply a null if you don't want to embed the font info. Presumably since the
> BasrDir  feature was implemented, the FontInfo.java code tries to apply a test
> to determine if the embedFile is absolute and if it isn't it prepends basedir,
> this
> test causes an NPE to occur which results in the message "Failed to read font
> metrics file : null "
>
> As I stated in my previous email, I added code to fix the NPE and it produced
> the PDF without complaint. I just can't read it with Acrobat Reader. I also tried
> to generate a similar file using Acrobat so I could compare differences. The main
> difference is that the Font declaration in the PDF is missing a section named
> "Widths"
>
> This cause me to look at the XML Font files in the FOP source which is where I
> discovered that the XML Font Files I generated with TTFReader were very
> different.
>
> Regards
> John G
>
> Oleg Tkachenko wrote:
>
> > John Gentilin wrote:
> >
> > > I want to include windows fonts in my PDF, but not embed them.
> >
> > Ahem, what is the difference? Have you tried this way?
> > "If you do not want the font embedded in the PDF then remove the "embed-file"
> > attribute. The PDF will then contain text using the font with the font metrics
> > and to view it properly the font will need to be installed where it is being
> > viewed." (http://xml.apache.org/fop/fonts.html)
> >
> > --
> > Oleg Tkachenko
> > eXperanto team
> > Multiconn Technologies, Israel
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> > For additional commands, email: fop-dev-help@xml.apache.org
>
> --
> --------------------------------------
> John Gentilin
> Eye Catching Solutions Inc.
> 18314 Carlwyn Drive
> Castro Valley CA 94546
>
>     Contact Info
> gentijo@eyecatching.com
> Ca Office 1-510-881-4821
> NJ Office 1-732-422-4917
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org

--
--------------------------------------
John Gentilin
Eye Catching Solutions Inc.
18314 Carlwyn Drive
Castro Valley CA 94546

    Contact Info
gentijo@eyecatching.com
Ca Office 1-510-881-4821
NJ Office 1-732-422-4917




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Including Fonts in 20.4

Posted by John Gentilin <ge...@eyecatching.com>.
Oleg,

In short yes but... when you pull out that tag it causes the variable embedFile
to become null. This is fine since  FontReader.java code states that you need
to supply a null if you don't want to embed the font info. Presumably since the
BasrDir  feature was implemented, the FontInfo.java code tries to apply a test
to determine if the embedFile is absolute and if it isn't it prepends basedir,
this
test causes an NPE to occur which results in the message "Failed to read font
metrics file : null "

As I stated in my previous email, I added code to fix the NPE and it produced
the PDF without complaint. I just can't read it with Acrobat Reader. I also tried
to generate a similar file using Acrobat so I could compare differences. The main
difference is that the Font declaration in the PDF is missing a section named
"Widths"

This cause me to look at the XML Font files in the FOP source which is where I
discovered that the XML Font Files I generated with TTFReader were very
different.

Regards
John G

Oleg Tkachenko wrote:

> John Gentilin wrote:
>
> > I want to include windows fonts in my PDF, but not embed them.
>
> Ahem, what is the difference? Have you tried this way?
> "If you do not want the font embedded in the PDF then remove the "embed-file"
> attribute. The PDF will then contain text using the font with the font metrics
> and to view it properly the font will need to be installed where it is being
> viewed." (http://xml.apache.org/fop/fonts.html)
>
> --
> Oleg Tkachenko
> eXperanto team
> Multiconn Technologies, Israel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org

--
--------------------------------------
John Gentilin
Eye Catching Solutions Inc.
18314 Carlwyn Drive
Castro Valley CA 94546

    Contact Info
gentijo@eyecatching.com
Ca Office 1-510-881-4821
NJ Office 1-732-422-4917




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Including Fonts in 20.4

Posted by Oleg Tkachenko <ol...@multiconn.com>.
John Gentilin wrote:

> I want to include windows fonts in my PDF, but not embed them.

Ahem, what is the difference? Have you tried this way?
"If you do not want the font embedded in the PDF then remove the "embed-file" 
attribute. The PDF will then contain text using the font with the font metrics 
and to view it properly the font will need to be installed where it is being 
viewed." (http://xml.apache.org/fop/fonts.html)

-- 
Oleg Tkachenko
eXperanto team
Multiconn Technologies, Israel


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org