[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2018-03-04 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on PDFBOX-3457:
-

Commit 1825832 from [~tilman] in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1825832 ]

PDFBOX-3457: don't stretch glyphs if they are standard 14 or if they don't have 
an explicit width, by John Hewson

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 3.0.0 PDFBox
>Reporter: Tilman Hausherr
>Priority: Major
> Attachments: PDFBOX-2642-HACK.pdf, PDFBOX_3457.patch, 
> PDFBOX_3457_v2.patch, PDFJS-5550.pdf, PDFJS-7523.pdf, bug864847.pdf, 
> gs-bugzilla693663-p9-stretchdisabled.png, gs-bugzilla693663-p9.pdf, 
> gs-bugzilla693663-p91_part.png, osx.png, overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2018-03-04 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on PDFBOX-3457:
-

Commit 1825833 from [~tilman] in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1825833 ]

PDFBOX-3457: don't stretch glyphs if they are standard 14 or if they don't have 
an explicit width, by John Hewson

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 3.0.0 PDFBox
>Reporter: Tilman Hausherr
>Priority: Major
> Attachments: PDFBOX-2642-HACK.pdf, PDFBOX_3457.patch, 
> PDFBOX_3457_v2.patch, PDFJS-5550.pdf, PDFJS-7523.pdf, bug864847.pdf, 
> gs-bugzilla693663-p9-stretchdisabled.png, gs-bugzilla693663-p9.pdf, 
> gs-bugzilla693663-p91_part.png, osx.png, overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2018-03-04 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on PDFBOX-3457:
-

Commit 1825831 from [~tilman] in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1825831 ]

PDFBOX-3457: add methods to find out whether there is an explicit font width, 
by John Hewson

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 3.0.0 PDFBox
>Reporter: Tilman Hausherr
>Priority: Major
> Attachments: PDFBOX-2642-HACK.pdf, PDFBOX_3457.patch, 
> PDFBOX_3457_v2.patch, PDFJS-5550.pdf, PDFJS-7523.pdf, bug864847.pdf, 
> gs-bugzilla693663-p9-stretchdisabled.png, gs-bugzilla693663-p9.pdf, 
> gs-bugzilla693663-p91_part.png, osx.png, overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2018-03-04 Thread Tilman Hausherr (JIRA)

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

Tilman Hausherr commented on PDFBOX-3457:
-

I did a few tests with John's patch, the {{isStandard14()}} call fixes a part 
of the problems, the rest goes away with {{font.hasExplicitWidth(code)}} with a 
modification, disgard the default width and just ask whether the width is the 
table or not. This works for all the files except 
PDFBOX-3937-7CSTFGJFWQDXKXNURT3VV3MSVSKTZG47-p4.pdf, but that one never renders 
in Adobe Reader so we can't know what would be the right thing to do. Many 
files have tiny differences; those that were big enough to be seen with the 
human eye show an improvement. I'll rerun the tests and do a more careful 
review of the differences and will commit after that.

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 3.0.0 PDFBox
>Reporter: Tilman Hausherr
>Priority: Major
> Attachments: PDFBOX-2642-HACK.pdf, PDFBOX_3457.patch, 
> PDFBOX_3457_v2.patch, PDFJS-5550.pdf, PDFJS-7523.pdf, bug864847.pdf, 
> gs-bugzilla693663-p9-stretchdisabled.png, gs-bugzilla693663-p9.pdf, 
> gs-bugzilla693663-p91_part.png, osx.png, overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2018-03-04 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on PDFBOX-3457:
-

Commit 1825805 from [~tilman] in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1825805 ]

PDFBOX-3457: add more standard 14 font names

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 3.0.0 PDFBox
>Reporter: Tilman Hausherr
>Priority: Major
> Attachments: PDFBOX-2642-HACK.pdf, PDFBOX_3457.patch, 
> PDFBOX_3457_v2.patch, PDFJS-5550.pdf, PDFJS-7523.pdf, bug864847.pdf, 
> gs-bugzilla693663-p9-stretchdisabled.png, gs-bugzilla693663-p9.pdf, 
> gs-bugzilla693663-p91_part.png, osx.png, overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2018-03-04 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on PDFBOX-3457:
-

Commit 1825806 from [~tilman] in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1825806 ]

PDFBOX-3457: add more standard 14 font names

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 3.0.0 PDFBox
>Reporter: Tilman Hausherr
>Priority: Major
> Attachments: PDFBOX-2642-HACK.pdf, PDFBOX_3457.patch, 
> PDFBOX_3457_v2.patch, PDFJS-5550.pdf, PDFJS-7523.pdf, bug864847.pdf, 
> gs-bugzilla693663-p9-stretchdisabled.png, gs-bugzilla693663-p9.pdf, 
> gs-bugzilla693663-p91_part.png, osx.png, overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2018-03-04 Thread Tilman Hausherr (JIRA)

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

Tilman Hausherr commented on PDFBOX-3457:
-

PDFBOX-4130-1-reduced.pdf:
- Type0
- MSMincho
- /W missing
- /DW missing
- Font missing
- Actual font: MS-Mincho, type0

PDFBOX-4130-2-reduced.pdf:
- Type0
- MSMincho
- /W missing
- /DW present
- Font missing
- Actual font: MS-Mincho, type0

bug864847.pdf:
- TrueType
- Arial-ItalicMT
- /Widths present, but only 1 element
- /MissingWidth: 750
- Font missing
- Actual font: ???

gs-bugzilla693663-p9.pdf:
- Type0
- KSpecial1
- /W present (character missing)
- /DW missing
- Font missing
- Actual font: ArialUnicodeMS, type2 (why?)

PDFBOX-122:
- Type0
- Name ???
- /W present (character missing, codes 8220, 8221, 8226)
- /DW present
- Font missing
- Actual font: ArialUnicodeMS, type2

PDFBOX-2950.pdf:
- Type0
- Name ??? (unclear which one)
- /W ???
- /DW ???
- Font missing
- Actual font: ArialUnicodeMS, type2

PDFBOX-3937-7CSTFGJFWQDXKXNURT3VV3MSVSKTZG47-p4:
- F6 / F8
- Type0
- Name: ABCDEE+Arial and ABCDEE+Arial,Bold
- /DW present
- /W null
- Font missing
- Actual font: LiberationSans, type2

PDFBOX-3964-p1-reduced:
- Type0
- Name: ABCDEE+Calibri
- /DW present
- /W null
- Font present
- Actual font: Calibri, type2

PDFJS-5550-p1:
- TrueType
- Name: TimesNewRoman
- /Widths present and full
- /MissingWidth: 2568
- Font missing

PDFJS-7523: same


> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 3.0.0 PDFBox
>Reporter: Tilman Hausherr
>Priority: Major
> Attachments: PDFBOX-2642-HACK.pdf, PDFBOX_3457.patch, 
> PDFBOX_3457_v2.patch, PDFJS-5550.pdf, PDFJS-7523.pdf, bug864847.pdf, 
> gs-bugzilla693663-p9-stretchdisabled.png, gs-bugzilla693663-p9.pdf, 
> gs-bugzilla693663-p91_part.png, osx.png, overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2016-10-20 Thread Tilman Hausherr (JIRA)

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

Tilman Hausherr commented on PDFBOX-3457:
-

For PDFBOX-122: 
{code}
 Warning  [COSParser] Object (12:0) at offset 506 does not end with 'endobj' 
but with '13'
 Warning  [COSParser] Object (13:0) at offset 732 does not end with 'endobj' 
but with '14'
 Warning  [PDCIDFontType2] Using fallback font ArialUnicodeMS for CID-keyed 
TrueType font ‚l‚r–¾’©
{code}
For PDFBOX-2950:
{code}
 Warning  [PDCIDFontType2] Using fallback font ArialUnicodeMS for CID-keyed 
TrueType font FZLTXIHK_SBJT--GBK1-0
 Warning  [PDCIDFontType2] Using fallback font ArialUnicodeMS for CID-keyed 
TrueType font FZLTHK_SBJT--GBK1-0
 Warning  [PDCIDFontType2] Using fallback font ArialUnicodeMS for CID-keyed 
TrueType font FZHTK--GBK1-0
 Warning  [PDCIDFontType2] Using fallback font ArialUnicodeMS for CID-keyed 
TrueType font FZLTDHK_SBJT--GBK1-0
 Warning  [PDCIDFontType2] Using fallback font ArialUnicodeMS for CID-keyed 
TrueType font FZDHTK--GBK1-0
 Warning  [PDCIDFontType2] Using fallback font ArialUnicodeMS for CID-keyed 
TrueType font FZLTTHK_SBJT--GBK1-0
 Warning  [PDCIDFontType2] Using fallback font ArialUnicodeMS for CID-keyed 
TrueType font FZLTZHK_SBJT--GBK1-0
 Warning  [PDCIDFontType2] Using fallback font ArialUnicodeMS for CID-keyed 
TrueType font FZTYSK_SBJT--GBK1-0
 Warning  [PDCIDFontType2] Using fallback font ArialUnicodeMS for CID-keyed 
TrueType font FZBYSK_SBJT--GBK1-0
{code}


> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 2.1.0
>Reporter: Tilman Hausherr
> Attachments: PDFBOX-2642-HACK.pdf, PDFBOX_3457.patch, 
> PDFBOX_3457_v2.patch, PDFJS-5550.pdf, PDFJS-7523.pdf, bug864847.pdf, 
> gs-bugzilla693663-p9-stretchdisabled.png, gs-bugzilla693663-p9.pdf, 
> gs-bugzilla693663-p91_part.png, osx.png, overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2016-10-20 Thread John Hewson (JIRA)

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

John Hewson commented on PDFBOX-3457:
-

These both render correctly on my system - are you seeing any warnings?

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 2.1.0
>Reporter: Tilman Hausherr
> Attachments: PDFBOX-2642-HACK.pdf, PDFBOX_3457.patch, 
> PDFBOX_3457_v2.patch, PDFJS-5550.pdf, PDFJS-7523.pdf, bug864847.pdf, 
> gs-bugzilla693663-p9-stretchdisabled.png, gs-bugzilla693663-p9.pdf, 
> gs-bugzilla693663-p91_part.png, osx.png, overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2016-10-20 Thread Tilman Hausherr (JIRA)

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

Tilman Hausherr commented on PDFBOX-3457:
-

No regressions, but the two improvements from yesterday
{quote}
PDFBOX-2950.pdf (lower left ")
PDFBOX-122.pdf (the !)
{quote}
are lost. 

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 2.1.0
>Reporter: Tilman Hausherr
> Attachments: PDFBOX-2642-HACK.pdf, PDFBOX_3457.patch, 
> PDFBOX_3457_v2.patch, PDFJS-5550.pdf, PDFJS-7523.pdf, bug864847.pdf, 
> gs-bugzilla693663-p9-stretchdisabled.png, gs-bugzilla693663-p9.pdf, 
> gs-bugzilla693663-p91_part.png, osx.png, overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2016-10-19 Thread John Hewson (JIRA)

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

John Hewson commented on PDFBOX-3457:
-

Great, thanks.

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 2.1.0
>Reporter: Tilman Hausherr
> Attachments: PDFBOX-2642-HACK.pdf, PDFBOX_3457.patch, 
> PDFBOX_3457_v2.patch, PDFJS-5550.pdf, PDFJS-7523.pdf, bug864847.pdf, 
> gs-bugzilla693663-p9-stretchdisabled.png, gs-bugzilla693663-p9.pdf, 
> gs-bugzilla693663-p91_part.png, osx.png, overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2016-10-19 Thread Tilman Hausherr (JIRA)

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

Tilman Hausherr commented on PDFBOX-3457:
-

Same with me.

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 2.1.0
>Reporter: Tilman Hausherr
> Attachments: PDFBOX-2642-HACK.pdf, PDFBOX_3457.patch, PDFJS-5550.pdf, 
> PDFJS-7523.pdf, gs-bugzilla693663-p9-stretchdisabled.png, 
> gs-bugzilla693663-p9.pdf, gs-bugzilla693663-p91_part.png, osx.png, 
> overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2016-10-19 Thread John Hewson (JIRA)

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

John Hewson commented on PDFBOX-3457:
-

Can you post a screenshot of how Acrobat renders PDFBOX-2642-277053-p3.pdf on 
your system? I have Optima installed, so it all looks fine. (Though I can 
reproduce the PDFBox issue by hardcoding ArialUnicodeMS).

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 2.1.0
>Reporter: Tilman Hausherr
> Attachments: PDFBOX_3457.patch, PDFJS-5550.pdf, PDFJS-7523.pdf, 
> gs-bugzilla693663-p9-stretchdisabled.png, gs-bugzilla693663-p9.pdf, 
> gs-bugzilla693663-p91_part.png, osx.png, overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2016-10-19 Thread Tilman Hausherr (JIRA)

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

Tilman Hausherr commented on PDFBOX-3457:
-

Quality loss in PDFBOX-2642-277053-p3.pdf

log msg:
 Warning  [PDCIDFontType0] Found PFB but expected embedded CFF font 
LMRTNK+Optima-Bold
 Warning  [PDCIDFontType0] Using fallback LiberationSans for CID-keyed font 
LMRTNK+Optima-Bold

Quality loss in PDFBOX-2563.pdf (fallback fonts: Batang and ArialUnicodeMS)

Improvement in
PDFBOX-2950.pdf (lower left ")
PDFBOX-122.pdf (the !)


> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 2.1.0
>Reporter: Tilman Hausherr
> Attachments: PDFBOX_3457.patch, PDFJS-5550.pdf, PDFJS-7523.pdf, 
> gs-bugzilla693663-p9-stretchdisabled.png, gs-bugzilla693663-p9.pdf, 
> gs-bugzilla693663-p91_part.png, osx.png, overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2016-10-18 Thread John Hewson (JIRA)

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

John Hewson commented on PDFBOX-3457:
-

Figured it out, see below for patch.

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 2.1.0
>Reporter: Tilman Hausherr
> Attachments: PDFBOX_3457.patch, PDFJS-5550.pdf, PDFJS-7523.pdf, 
> gs-bugzilla693663-p9-stretchdisabled.png, gs-bugzilla693663-p9.pdf, 
> gs-bugzilla693663-p91_part.png, osx.png, overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2016-10-18 Thread John Hewson (JIRA)

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

John Hewson commented on PDFBOX-3457:
-

Ok, if I modify my local build to use ArialUnicodeMS, then I get the same 
broken rendering with stretching. Will investigate further.

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 2.1.0
>Reporter: Tilman Hausherr
> Attachments: PDFJS-5550.pdf, PDFJS-7523.pdf, 
> gs-bugzilla693663-p9-stretchdisabled.png, gs-bugzilla693663-p9.pdf, 
> gs-bugzilla693663-p91_part.png, osx.png, overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2016-10-18 Thread JIRA

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

Andreas Lehmkühler commented on PDFBOX-3457:


mine is Ondine and without stretching everything looks good

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 2.1.0
>Reporter: Tilman Hausherr
> Attachments: PDFJS-5550.pdf, PDFJS-7523.pdf, 
> gs-bugzilla693663-p9-stretchdisabled.png, gs-bugzilla693663-p9.pdf, 
> gs-bugzilla693663-p91_part.png, osx.png, overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2016-10-18 Thread Tilman Hausherr (JIRA)

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

Tilman Hausherr commented on PDFBOX-3457:
-

WARN  PDCIDFontType2:166 - Using fallback font ArialUnicodeMS for CID-keyed 
TrueType font KSpecial1

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 2.1.0
>Reporter: Tilman Hausherr
> Attachments: PDFJS-5550.pdf, PDFJS-7523.pdf, 
> gs-bugzilla693663-p9.pdf, gs-bugzilla693663-p91_part.png, osx.png, 
> overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2016-10-18 Thread John Hewson (JIRA)

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

John Hewson commented on PDFBOX-3457:
-

What's your fallback font? Mine is "AdobeGothicStd-Bold".

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 2.1.0
>Reporter: Tilman Hausherr
> Attachments: PDFJS-5550.pdf, PDFJS-7523.pdf, 
> gs-bugzilla693663-p9.pdf, gs-bugzilla693663-p91_part.png, osx.png, 
> overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2016-10-18 Thread John Hewson (JIRA)

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

John Hewson commented on PDFBOX-3457:
-

Here's what I get on OS X:

!osx.png!

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 2.1.0
>Reporter: Tilman Hausherr
> Attachments: PDFJS-5550.pdf, PDFJS-7523.pdf, 
> gs-bugzilla693663-p9.pdf, gs-bugzilla693663-p91_part.png, osx.png, 
> overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2016-10-18 Thread JIRA

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

Andreas Lehmkühler commented on PDFBOX-3457:


Doesn't work for me. Looks like it depends on the font to be used as 
replacement.

!gs-bugzilla693663-p91_part.png!

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 2.1.0
>Reporter: Tilman Hausherr
> Attachments: PDFJS-5550.pdf, PDFJS-7523.pdf, 
> gs-bugzilla693663-p9.pdf, gs-bugzilla693663-p91_part.jpg, overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2016-10-18 Thread Tilman Hausherr (JIRA)

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

Tilman Hausherr commented on PDFBOX-3457:
-

That is what I also get.

I tried disabling the font stretching, then the file is shown properly.

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 2.1.0
>Reporter: Tilman Hausherr
> Attachments: PDFJS-5550.pdf, PDFJS-7523.pdf, 
> gs-bugzilla693663-p9.pdf, gs-bugzilla693663-p91_part.png, overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2016-10-18 Thread Tilman Hausherr (JIRA)

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

Tilman Hausherr commented on PDFBOX-3457:
-

It works. Differences are either almost invisible or correct.

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 2.1.0
>Reporter: Tilman Hausherr
> Attachments: PDFJS-5550.pdf, PDFJS-7523.pdf, 
> gs-bugzilla693663-p9.pdf, overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2016-10-18 Thread Tilman Hausherr (JIRA)

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

Tilman Hausherr commented on PDFBOX-3457:
-

I'll do it tonight.

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 2.1.0
>Reporter: Tilman Hausherr
> Attachments: PDFJS-5550.pdf, PDFJS-7523.pdf, 
> gs-bugzilla693663-p9.pdf, overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2016-10-18 Thread John Hewson (JIRA)

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

John Hewson commented on PDFBOX-3457:
-

Ok, so having eliminated the gs-bugzilla693663-p9.pdf file, we're left with two 
PDFs, PDFJS-7523.pdf and PDFJS-5550-2.pdf. I see something in common between 
them: the problematic fonts are both standard 14.

Looking back at PDFBOX-870 and the files which Tilman linked to above, none of 
the fonts which we stretch are standard 14. Which makes me thing that the 
solution to this issue is to not stretch a font if it is standard 14. This 
change in PageDrawer brings the desired effect:

{code}
// stretch non-embedded glyph if it does not match the width contained in the 
PDF
if (!font.isEmbedded() && !font.isStandard14())
{
   ...
{code}

I'll let Tilman try it out on his test suite.

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 2.1.0
>Reporter: Tilman Hausherr
> Attachments: PDFJS-5550.pdf, PDFJS-7523.pdf, 
> gs-bugzilla693663-p9.pdf, overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2016-10-18 Thread John Hewson (JIRA)

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

John Hewson commented on PDFBOX-3457:
-

The gs-bugzilla693663-p9.pdf file does not appear to be affected by the font 
stretching code mentioned. The problematic quote characters are not subject to 
stretching.

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 2.1.0
>Reporter: Tilman Hausherr
> Attachments: PDFJS-5550.pdf, PDFJS-7523.pdf, 
> gs-bugzilla693663-p9.pdf, overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2016-10-17 Thread John Hewson (JIRA)

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

John Hewson commented on PDFBOX-3457:
-

{quote}
If every character is rendered separately the width of the font dictionary 
doesn't matter as every character comes with its own position, so that there is 
no need to compensate any width difference.
{quote}

I don't think that's right, because while the glyphs would be in the correct 
position, they would look like this:

!overlapping.png!

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 2.1.0
>Reporter: Tilman Hausherr
> Attachments: PDFJS-5550.pdf, PDFJS-7523.pdf, 
> gs-bugzilla693663-p9.pdf, overlapping.png
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2016-10-15 Thread JIRA

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

Andreas Lehmkühler commented on PDFBOX-3457:


I guess I've found the reason for the different needs of a stretching.

Stretching is need only if the text comes in chunks of more than one character. 
In those cases we are using the width from the font dictionary to calculate the 
position of a following character within a chunk. If the font has to be 
replaced or isn't embedded we may have to stretch the glyph to compensate a 
possible width difference (width from font dictionary vs. width from used font).
If every character is rendered separately the width of the font dictionary 
doesn't matter as every character comes with its own position, so that there is 
no need to compensate any width difference.

But I didn't found a way to distinguish those cases in PageDrawer without any 
additional information to be passed from PDFStreamEngine.


> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 2.1.0
>Reporter: Tilman Hausherr
> Attachments: PDFJS-5550.pdf, PDFJS-7523.pdf, gs-bugzilla693663-p9.pdf
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2016-10-14 Thread Tilman Hausherr (JIRA)

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

Tilman Hausherr commented on PDFBOX-3457:
-

There are many where there is a difference, but here are some where one can see 
that the stretching is needed.

166292-fi-ligature.pdf (PDFBOX-2894)
PDFBOX-1679.pdf ("Shea")
PDFJS-6353-Wingdings.pdf (PDFBOX-3412)
PDFJS-215-missing-glyf.pdf (PDFBOX-3488)


> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 2.1.0
>Reporter: Tilman Hausherr
> Attachments: PDFJS-5550.pdf, PDFJS-7523.pdf, gs-bugzilla693663-p9.pdf
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-3457) Glyphs rendered in wrong width

2016-10-14 Thread JIRA

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

Andreas Lehmkühler commented on PDFBOX-3457:


[~tilman] Do you have a pdf which needs that stretching?

> Glyphs rendered in wrong width
> --
>
> Key: PDFBOX-3457
> URL: https://issues.apache.org/jira/browse/PDFBOX-3457
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.2, 2.0.3, 2.1.0
>Reporter: Tilman Hausherr
> Attachments: PDFJS-5550.pdf, PDFJS-7523.pdf, gs-bugzilla693663-p9.pdf
>
>
> Fonts rendered in wrong size. The cause is related to wrong values in the 
> /WIDTHS table and this code in PageDrawer:
> {code}
> // stretch non-embedded glyph if it does not match the width 
> contained in the PDF
> if (!font.isEmbedded())
> {
> float fontWidth = font.getWidthFromFont(code);
> if (fontWidth > 0 && // ignore spaces
> Math.abs(fontWidth - displacement.getX() * 1000) > 
> 0.0001)
> {
> float pdfWidth = displacement.getX() * 1000;
> at.scale(pdfWidth / fontWidth, 1);
> }
> }
> {code}
> I suspect that there must be another condition to skip the stretching, but I 
> didn't find out which one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org