Skip navigation
Currently Being Moderated

Type1 font missing glyph width from /Widths array

Jun 21, 2012 5:08 AM

Tags: #font #pdf #array #parsing #width #type1

Hi everyone

 

I am trying to calculate character width in order to show highlighted search results in a PDF document. The problem I have faced is that the /Widths array I am depending on has a portion of its values equal to 0. The values substituted with zeros are the ones that are used in the text. This is probably related to embedded font subsets, but I am not sure at the moment. What are the actions that should be taken in such a situation? See the structure of the mentioned PDF in a screenshot below:

 

widths_array.png

Thank you in advance for your time.

 
Replies
  • Currently Being Moderated
    Jun 21, 2012 5:22 AM   in reply to Crypozza

    Yes, writing a 0 into the width for a character that has been removed from a subset is a somewhat-common operation.

     

    I am surprised that you are finding glyphs that are actually being used in the content stream with 0 widths.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 21, 2012 5:45 AM   in reply to Crypozza

    Sure – you can load the font program itself (aka the TTF/CFF font data) and read the embedded information.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points