ICEpdf
  1. ICEpdf
  2. PDF-579

Negative character spacing causing layout issues.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 5.0.3
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      any

      Description

      The separation of glyphs can be tweaked with the the operand Tc which which when specified is added to the offset of the glyph width given the effect of characters that are further apart.

      In this particular PDF the Tc= -1.44. If we follow the layout rules of the spec the glyphs will be painted more or less on top of each other.

      What I think might be happening here is related to an old note in the specification. The note says that starting x of the next glyph can't be less then the previous glyph. So in the following example:

      [<0027003d>90<0003>] TJ

      <0003> even after the 90 shift, it can't be painted before <.. 3d>. However in the PDF in question we are apply the negative character space for each character. My best guess is that we should have similar logic for the the character spacing. If the character advance with space is less then the previous advance then we should just use the previous advance.

      Any change to the core of the next layout algorithm is pretty high risk for regressions.

        Issue Links

          Activity

          Hide
          Patrick Corless added a comment -

          Still having difficulty fixing this issue for all the test cases. It would appear that the font size > 1 and a negative Tc value is the root of the problem. My current path fixes the layout for the attache document but there are still some problems with it for other documents.

          Show
          Patrick Corless added a comment - Still having difficulty fixing this issue for all the test cases. It would appear that the font size > 1 and a negative Tc value is the root of the problem. My current path fixes the layout for the attache document but there are still some problems with it for other documents.

            People

            • Assignee:
              Patrick Corless
              Reporter:
              Patrick Corless
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: