[ 
https://issues.apache.org/jira/browse/PDFBOX-1408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Juraj Lonc updated PDFBOX-1408:
-------------------------------

    Description: 
PDFStreamEngine calculates width of space (line 357):

spaceWidthText = (font.getFontWidth( SPACE_BYTES, 0, 1 
)*glyphSpaceToTextSpaceFactor);

In some cases the result is 0.
Problem is that getFontWidth requires code number of " ".

If there is "ToUnicode" mapping for that font that it is necessary to lookup 
CMap for code number and NOT to use 0x20 (space) as it is in souce code.

  was:
PDFStreamEngine calculates width of space (line 357):

spaceWidthText = (font.getFontWidth( SPACE_BYTES, 0, 1 
)*glyphSpaceToTextSpaceFactor);

In some cases it the result is 0.
Problem is that getFontWidth requires code number of " ".

If there is "ToUnicode" mapping for that font that it is necessary to lookup 
CMap for code number and NOT to use 0x20 (space) as it is in souce code.

    
> Width of space character is calculated wrong
> --------------------------------------------
>
>                 Key: PDFBOX-1408
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1408
>             Project: PDFBox
>          Issue Type: Bug
>            Reporter: Juraj Lonc
>
> PDFStreamEngine calculates width of space (line 357):
> spaceWidthText = (font.getFontWidth( SPACE_BYTES, 0, 1 
> )*glyphSpaceToTextSpaceFactor);
> In some cases the result is 0.
> Problem is that getFontWidth requires code number of " ".
> If there is "ToUnicode" mapping for that font that it is necessary to lookup 
> CMap for code number and NOT to use 0x20 (space) as it is in souce code.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to