[ 
https://issues.apache.org/jira/browse/PDFBOX-954?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13171623#comment-13171623
 ] 

David Villace edited comment on PDFBOX-954 at 12/17/11 6:07 PM:
----------------------------------------------------------------

Hello.

I think I found a temporal workaround.

Finally I see on PDF specification the meaning of "widths" array. As I said on 
my first post, the problem with the contents of the array seems to be that the 
contents is the widths of all characters defined on the selected font. My 
opinion is the correct contents must be the widths of the all characters 
between the first character and the last character
detected at them moment you want, by example, write a string.

I attach a variant of the program I attach on my previous post. The result is a 
PDF file with 3 strings, each one with it's own font and font descriptor but 
all three share the value of the attribute "FontFile2". The result is a PDF 
file without the message about error and it has embedded Arial font only one 
time. Previous tests had created a PDF file with the font embedded three 
times... a really big file.

The files I attach are:

           - MainVer2.java
           - outVer2.pdf

I see the previous attached files (Main.java) has not treated the character 
"ñ", I erase it and the spanish pseudo-character "ll" too.

Good afternoon
                
      was (Author: vilherda):
    Hello.

I think I found a temporal workaround.

Finally I see on PDF specification the meaning of "widths" array. As I said on 
my first post, the problem with the contents of the array seems to be that the 
contents is the widths of all characters defined on the selected font. My 
opinion is the correct contents must be the widths of the all characters 
between the first character and the last character
detected at them moment you want, by example, write a string.

I attach a variant of the program I attach on my previous post. The result is a 
PDF file with 3 strings, each one with it's own font and font descriptor but 
all three share the value of the attribute "FontFile2". The result is a PDF 
file without the message about error and it has embedded Arial font only one 
time. Previous tests had created a PDF file with the font embedded three 
times... a really big file.

Good afternoon
                  
> Embedded font: value for /Widths faulty (worked in PDFBox 1.3.0!)
> -----------------------------------------------------------------
>
>                 Key: PDFBOX-954
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-954
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox
>    Affects Versions: 1.4.0
>         Environment: JDK1.6.0_23, Windows XP
>            Reporter: MH
>            Assignee: Andreas Lehmkühler
>         Attachments: Imagen 1.png, Imagen 2.png, Imagen 3.png, Main.java, 
> MainVer2.java, hello_ttf_1.1.0.pdf, hello_ttf_1.4.0.pdf, out.pdf, outVer2.pdf
>
>
> We have a problem with the font 'LucidiaSansUnicode (l_10646.ttf). It is 
> embedded in a PDF and when viewing this PDF (with Acrobat Reader 9), an error
>    In der Schrift "LucidaSansUnicode" ist der Wert für /Widths fehlerhaft.
> occurs (roughly translated: "In font "LucidaSansUNicode" the value for 
> /Widths is faulty."). I noticed that this error only occurs when the first 
> page is displayed that has text added by PDFBox! The same font is also used 
> for all other text (used by Apache FOP to generate). When I look at the 
> dialog window of Acrobat 3. tab "Fonts", I notice lots of entries
>     LucidaSansUnicode (Eingebettete Untergruppe)
>         Typ: TrueType (CID)
>         Kodierung: Identity-H
> but only 1 entry at the very top that looks different:
>     LucidaSansUnicode (Eingebettet)
>          Typ: TrueType
>         Kodierung: Ansi
> I guess one is from Apache FOP (generation of PDF) and one is from PDFBox 
> (adding additional text to the PDF). However, both use the same source file 
> "l_10646.ttf"!
> Using PDFBox 1.3.0-snapshot (or iText 2.1.7), this problem does NOT occur!
> This only occurs with this "LucidaSansUnicode" font - all our other custom 
> fonts don't cause this problem.
> The difference I notice in Acrobat Reader Fonts tab is the first font entry:
> PDFBox 1.4.0:
>     LucidaSansUnicode (Eingebettet)
>         Typ: TrueType
>         Kodierung: Ansi
> PDFBox 1.3.0 or iText 2.1.7:
>     LucidaSansUnicode (Eingebettete Untergruppe)
>         Typ: TrueType
>         Kodierung: Ansi
> So, PDFBox 1.4.0 only shows "embedded" ("Eingebettet") but PDFBox 1.3.0/iText 
> version shows "embedded subgroup" ("Eingebettete Untergruppe")! Perhaps this 
> is the problem?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to