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 Mike Ferrando <mi...@yahoo.com> on 2003/04/25 00:23:33 UTC
FOP character mapping problems
Friends,
I am converting documents from XML using XSL into FO files then
using FOP to convert these into PDF.
The problem I am having is that some of my NCR are not transforming
(Numeric Character Reference). My FO file is correct. The
Character NCR is retained "&# 299;" (space added so that you can see
what the NCR is without the space it could appear correctly or
incorrectly) in the FO file.
Unicode "012B" in Latin Extended A (0100--017F)
http://www.eki.ee/letter/chardata.cgi?ucode=012B
I succefully created metric xml files for my userconfig.xml file.
Using only the font-family "Arial" (arial.xml), all characters are
displayed correctly when the -c userconfig.xml is given as an option
in the command line.
fop -c conf\userconfig.xml -fo file.fo -pdf file.pdf
When the document is open in Acrobat 5, I try to search words that
appear in the Arial font. I get no results. Nothing is found by the
Acrobat search tool. However, if I transform all text in the Base
font (Times), and only the one character (&# 299;) in the "Arial"
font, I can find the whole word up to that character.
I have even looked through the cid-fonts.fo file as well. Basically
all characters that are not in the Base 14 font sets are
unsearchable. The Apache site even confirms this being the result of
using metric fonts for these characters. (quote)
When embedding TrueType fonts, a new font, containing only the glyphs
used, is created from the original font and embedded in the pdf.
Currently, this embedded font contains only the minimum data needed
to be embedded in a pdf document, and does not contain any codepage
information. The PDF document contains indexes to the glyphs in the
font instead of to encoded characters. While the document will be
displayed correctly, the net effect of this is that searching,
indexing, and cut-and-paste will not work properly.
http://xml.apache.org/fop/fonts.html#embedding
I thought that this paragraph was directed to ttf files only. So I
tried the ttc files. But the results were still the same. Any
characters that are not part of the Base 14 fonts (transformed from
embedded fonts) will not be able to be searched in the pdf output
file.
I know my XML XSL transformation is no problem, since I regularly
transform XML into HTML or SGML. So, I am trying to fix the problem
that occurs between the FO file and the PDF output file.
I am using Windows 2000.
Any suggestions?
Sincerely,
Mike Ferrando
Washington, DC
XML:
<element>Solov&# 299;</element> (space added)
--------
S & R '&#' with '& amp;#_'
--------
FO:
<fo:inline>Solov& amp;#_299;</fo:inline> (space added)
--------
S & R '& amp;#_' with '&#'
--------
PDF:
Solov#
__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Re: FOP character mapping problems
Posted by Jeremias Maerki <de...@greenmail.ch>.
On 25.04.2003 01:15:46 J.Pietschmann wrote:
> Clay Leeds wrote:
> > FMI: Is that like "regular", Bold, Italic, and Bold Italic?
>
> I've seen TTCs mainly for providing several writing styles, sort of,
> for e.g. chinese. The concept is not unlikely the concept of
> character slant in western scripts; it covers for example variations
> in line caps, line width changes along lines, gaps and bends. In such
> cases the fonts in the TTC have related but different names.
> Occasionally I've seen completely unrelated fonts in one TTC. I don't
> really know whether TTCs are just concatenations of TTFs with a common
> header or whether the fonts may share structures like code tables or
> glyph definitions. Jeremias will tell you.
Huh. I can't. I'm not yet that up-to-speed with TrueType fonts.
Here's a summary from the OpenType specification:
| A TrueType Collection (TTC) is a means of delivering multiple OpenType
| fonts in a single file structure. TrueType Collections are most useful
| when the fonts to be delivered together share many glyphs in common. By
| allowing multiple fonts to share glyph sets, TTCs can result in a
| significant saving of file space.
|
| For example, a group of Japanese fonts may each have their own designs
| for the kana glyphs, but share identical designs for the kanji. With
| ordinary OpenType font files, the only way to include the common kanji
| glyphs is to copy their glyph data into each font. Since the kanji
| represent much more data than the kana, this results in a great deal of
| wasteful duplication of glyph data. TTCs were defined to solve this
| problem.
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Re: FOP character mapping problems
Posted by "J.Pietschmann" <j3...@yahoo.de>.
Clay Leeds wrote:
> FMI: Is that like "regular", Bold, Italic, and Bold Italic?
I've seen TTCs mainly for providing several writing styles, sort of,
for e.g. chinese. The concept is not unlikely the concept of
character slant in western scripts; it covers for example variations
in line caps, line width changes along lines, gaps and bends. In such
cases the fonts in the TTC have related but different names.
Occasionally I've seen completely unrelated fonts in one TTC. I don't
really know whether TTCs are just concatenations of TTFs with a common
header or whether the fonts may share structures like code tables or
glyph definitions. Jeremias will tell you.
J.Pietschmann
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Re: FOP character mapping problems
Posted by Clay Leeds <cl...@medata.com>.
FMI: Is that like "regular", Bold, Italic, and Bold Italic?
(FMI = For My Information ;-p)
J.Pietschmann wrote:
> TTC files are basically a bunch of TTF fonts lumped together in one
> file.
>
> J.Pietschmann
--
Clay Leeds - cleeds@medata.com
Web Developer - Medata, Inc. - http://www.medata.com
PGP Public Key: https://mail.medata.com/pgp/cleeds.asc
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
RE: FOP character mapping problems
Posted by Victor Mote <vi...@outfitr.com>.
J.Pietschmann wrote:
> TTC files are basically a bunch of TTF fonts lumped together in one
> file.
I just committed a note to this effect to the font embedding section in the
documentation to clarify this for future users.
Victor Mote
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Re: FOP character mapping problems
Posted by "J.Pietschmann" <j3...@yahoo.de>.
Mike Ferrando wrote:
> I thought that this paragraph was directed to ttf files only. So I
> tried the ttc files.
TTC files are basically a bunch of TTF fonts lumped together in one
file.
J.Pietschmann
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Re: FOP character mapping problems
Posted by Jeremias Maerki <de...@greenmail.ch>.
I may have caused a misunderstanding: There's no need to change anything
about Adobe Acrobat Reader. It's a matter of implementing the missing
functionality in FOP so FOP supports/creates the ToUnicode CMaps in PDF.
These ToUnicode CMaps enable the Acrobat Reader to properly extract text
using characters beyond Latin1/PDFDocEncoding (8-bit).
Working around the problem using special Type 1 fonts (PFM/PFB) may be a
solution though a rather hacky and complicated one.
Please contact me off-list if you're interested in funding the
implementation.
On 01.05.2003 16:22:38 Mike Ferrando wrote:
> Jeremias,
> Thanks for your reply.
>
> I have read alot of these technical note pdf files. I have some
> questions.
>
> 1. If I do change my Adobe Reader so that it will be able to process
> the ttf into Unicode, will this mean that others who use the download
> version of Adobe Reader be able to see my characters correctly? (I
> presume not.) At present I can read, cut and paste, extended
> character sets from pdf documents at the RenderX site without doing
> anything to my Adobe Reader. (see: charents.pdf)
> http://www.renderx.com/testcases.html
>
> 2. I would be very interested in using this method (ToUnicode) to
> enable embedding the font into my document if the character encoding
> would also be embeded not just the glyphs. However, the instructions
> were not clear as to what files where to be "changed" and where these
> files were to be placed in the Adobe program folders. Further it was
> not clear what the result of making this change would be, local only
> or otherwise (see 1 above).
>
> 3. I would be very interested in a walk through or talk through if I
> could be sure that I would have embedded character encodings as a
> result of running FOP. I would even pay for a class on doing this if
> someone gave one. The literature is hardly clear to a user like me.
>
> 4. At present I am only able to use pfm/pfb fonts to embed character
> encodings into my pdf documents using FOP. (Yes, ttf fonts do appear
> correctly when extended characters are needed, but thier is no
> encoding just glyphs.) Now I am on the look out for pfm/pfb fonts
> that include characters beyond Latin 1. I can transform my XML using
> XSL and create an array of NCRs. This will become a merge document
> for my xsl-fo stylesheet to call up the particular fonts and place
> each character into an <fo:inline font-family="not-latin-1">&#
> 299;</fo:inline>. So calling up the correct fonts will only be a
> matter of writing a XSL stylesheet to pull and create the
> userconfig.xml for my conversions from the fo document. IOW I can get
> around the problem of having a need for many different fonts so that
> all my extended characters will have encodings embeded into the
> rendered PDF document. If there is an easier way, I would like to
> know of it (hence, ToUnicode).
>
> All this is basically summed up in the need to be able to embed
> encoding into the PDF document not just the glyphs. I have little
> interest in changing my Reader locally so that I can see ttf fonts.
>
> Any suggestions?
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Re: FOP character mapping problems
Posted by Mike Ferrando <mi...@yahoo.com>.
Jeremias,
Thanks for your reply.
I have read alot of these technical note pdf files. I have some
questions.
1. If I do change my Adobe Reader so that it will be able to process
the ttf into Unicode, will this mean that others who use the download
version of Adobe Reader be able to see my characters correctly? (I
presume not.) At present I can read, cut and paste, extended
character sets from pdf documents at the RenderX site without doing
anything to my Adobe Reader. (see: charents.pdf)
http://www.renderx.com/testcases.html
2. I would be very interested in using this method (ToUnicode) to
enable embedding the font into my document if the character encoding
would also be embeded not just the glyphs. However, the instructions
were not clear as to what files where to be "changed" and where these
files were to be placed in the Adobe program folders. Further it was
not clear what the result of making this change would be, local only
or otherwise (see 1 above).
3. I would be very interested in a walk through or talk through if I
could be sure that I would have embedded character encodings as a
result of running FOP. I would even pay for a class on doing this if
someone gave one. The literature is hardly clear to a user like me.
4. At present I am only able to use pfm/pfb fonts to embed character
encodings into my pdf documents using FOP. (Yes, ttf fonts do appear
correctly when extended characters are needed, but thier is no
encoding just glyphs.) Now I am on the look out for pfm/pfb fonts
that include characters beyond Latin 1. I can transform my XML using
XSL and create an array of NCRs. This will become a merge document
for my xsl-fo stylesheet to call up the particular fonts and place
each character into an <fo:inline font-family="not-latin-1">&#
299;</fo:inline>. So calling up the correct fonts will only be a
matter of writing a XSL stylesheet to pull and create the
userconfig.xml for my conversions from the fo document. IOW I can get
around the problem of having a need for many different fonts so that
all my extended characters will have encodings embeded into the
rendered PDF document. If there is an easier way, I would like to
know of it (hence, ToUnicode).
All this is basically summed up in the need to be able to embed
encoding into the PDF document not just the glyphs. I have little
interest in changing my Reader locally so that I can see ttf fonts.
Any suggestions?
Mike Ferrando
Washington, DC
--- Jeremias Maerki <de...@greenmail.ch> wrote:
> I think this is the same problem as the one of Mark Dudley. It's
> simply
> the missing ToUnicode feature in FOP. So therefore I have no good
> suggestion right now other than encouraging interested parties to
> see to
> implementing ToUnicode tables.
>
> On 25.04.2003 00:23:33 Mike Ferrando wrote:
> <snip/>
> > When the document is open in Acrobat 5, I try to search words
> that
> > appear in the Arial font. I get no results. Nothing is found by
> the
> > Acrobat search tool. However, if I transform all text in the Base
> > font (Times), and only the one character (&# 299;) in the "Arial"
> > font, I can find the whole word up to that character.
>
> <snip/>
>
> > Any suggestions?
>
>
> Jeremias Maerki
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
>
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Re: FOP character mapping problems
Posted by Jeremias Maerki <de...@greenmail.ch>.
I think this is the same problem as the one of Mark Dudley. It's simply
the missing ToUnicode feature in FOP. So therefore I have no good
suggestion right now other than encouraging interested parties to see to
implementing ToUnicode tables.
On 25.04.2003 00:23:33 Mike Ferrando wrote:
<snip/>
> When the document is open in Acrobat 5, I try to search words that
> appear in the Arial font. I get no results. Nothing is found by the
> Acrobat search tool. However, if I transform all text in the Base
> font (Times), and only the one character (&# 299;) in the "Arial"
> font, I can find the whole word up to that character.
<snip/>
> Any suggestions?
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org