Guest User

Untitled

a guest
Nov 12th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. GLYPH DATA
  2. ==========
  3.  
  4. - Glyph flag
  5. - Metric data
  6. - Outline data
  7. - Extra data segments
  8.  
  9. OUTLINE DATA
  10. ============
  11.  
  12. Outline data of a glyph is recorded in this manner:
  13.  
  14. - Length of items (points and inclusions)
  15. - Number of VF tuples
  16. - Item flags
  17. - Static dX
  18. - Static dY
  19. - Variable deltas
  20. - Contour mask (optional, decided by glyph flag)
  21.  
  22. Item flag list: One byte for each glyph item (point OR inclusion)
  23.  
  24. - Points : 0 . . . . . . .
  25. - --- --- ---
  26. S ZT XT YT
  27. - S : Start of a contour;
  28. - ZT : Point type
  29. - 00 : On knot
  30. - 01 : Quadratic off knot
  31. - 10 : Leading cubic off-knot
  32. - 11 : Trailing cubic off-knot
  33. - XT & YT : Coordinate type of static outline
  34. - 00 : Zero
  35. - 01 : Short integer
  36. - 10 : Positive byte or Fraction
  37. - 11 : Negative byte or Fraction
  38. - Includes : 1 . . . . . . .
  39. - --- --- ---
  40. G R XT YT
  41. - G : Include a glyph rather than a fragment
  42. - R : Reserved (for rounding and hinting?)
  43.  
  44. Including a glyph or a fragment into the font. Inclusion simply
  45. copies outline data of the part being included, with an extra X
  46. and Y shift being added into it. The X and Y shift could be
  47. polymorphic, and they are added to all the touched points in the
  48. included component.
  49.  
  50. Static dX and dY coordinate:
  51. - For points, depending on the XT or YT:
  52. - For XT/YT = 00, the data is not needed.
  53. - For XT/YT = 01, the data is two bytes long and represents a big-endian
  54. signed short.
  55. - For XT/YT = 10 or 11, the data is interpreted as this:
  56. Let c be the result of read one byte.
  57. if c != 0 then
  58. return (XT/YT == 10) ? c : -c
  59. else
  60. let f = read four bytes and decode it as a unsigned Q16.16
  61. return (XT/YT == 10) ? f : -f
  62. - For inclusion, there would always two bytes for dX, representing the ID of
  63. the componet being included; There could be an extra shift value, and its
  64. form is defined by the XT/YT.
  65.  
  66. Variable X and Y deltas:
  67. - Use the current GVAR mechanism. For each tuple, untouched points are
  68. interpolated with an IUP.
  69.  
  70. Contour Mask:
  71. - A bit field to describe whether a contour would be disabled during
  72. rasterization. Useful for color glyphs.
Add Comment
Please, Sign In to add comment