Skip to content

[Cosmetic] not all values need t be written in floating-point precision #50

@terefang

Description

@terefang

for example the dict below

326 0 obj
<<
  /Type /FontDescriptor
  /FontName /YLDPGG+OpenSans-CondensedItalic
  /Flags 131140
  /FontBBox [-599.1211 -389.16016 2527.3438 1064.9414]
  /ItalicAngle -12
  /Ascent 1068.8477
  /Descent -292.96875
  /CapHeight 713.8672
  /StemV 95.4
  /FontFile2 328 0 R
>>
endobj

the following keys can be written with integer values because the context is already in 1/1000 of a point:

  • FontBBox
  • Ascent
  • Descent
  • CapHeight
  • StemV

similarly the dict below

325 0 obj
<<
  /Type /Font
  /Subtype /CIDFontType2
  /BaseFont /YLDPGG+OpenSans-CondensedItalic
  /CIDSystemInfo <<
    /Registry (Adobe)
    /Ordering (Identity)
    /Supplement 0
  >>
  /FontDescriptor 326 0 R
  /DW 0
  /CIDToGIDMap /Identity
  /W [0 0 548.8281 1 1 380.85938 2 2 185.54688 3 3 401.85547 4 4 231.44531 5 5 405.27344 6 6 333.0078 7 7 187.98828 8 8 381.34766 9 9 169.92188 10 10 395.5078 11 11 270.9961 12 12 605.46875 13 13 640.625 14 14 375.97656 15 15 416.9922 16 16 407.22656 17 17 478.02734 18 18 417.96875 19 19 328.61328 20 20 334.96094 21 21 372.0703]
>>
endobj

the /W glyph-width array also is in 1/1000 of a point so can also be written as integer for compactness

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions