Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Notation
- +----+ +=========+
- | | One Byte | | Multiple bytes
- +----+ +=========+
- 0 1
- +--------+--------+
- |00001000|00000010|
- +--------+--------+
- ^ ^
- | |
- | + less significant byte = 2
- + more significant byte = 8 × 256
- +--.--.--.--.--.--.--.--+
- | : : : : : : : | Bits in one byte
- +--'--'--'--'--'--'--'--+
- Contour Layer
- +---+---+=========+===========+===========+======================+
- |nPoints| Flags | XData | YData | Poly Data |
- +---+---+=========+===========+===========+======================+
- Flags array
- Array of flags for each point in the outline. See below for details
- regarding the number of flag array elements.
- +--.--.--.--.--.--.--.--+ - - - - - - - - - - - - +
- |SC:RP: XT : YT : ZT | Repeat Number (RP = 1) |
- +--'--'--'--'--'--'--'--+ - - - - - - - - - - - - +
- + ZT : The type of this point. The valid numbers are:
- - 00 : On-curve point
- - 01 : Quadratic off-curve point
- - 10 : Cubic beginning off-curve point
- - 11 : Cubic ending off-curve point
- + XT and YT : The type of dX and dY data. The valid numbers are:
- - 00 : The dX or dY is zero. No bytes needed.
- - 01 : The dX or dY is encoded with two bytes, as a signed short.
- - 10 : The dX or dY is encoded with one byte, as a byte, and the sign of
- this entry is positive.
- - 11 : The dX or dY is encoded with one byte, as a byte, and the sign of
- this entry is negative.
- + SC : This point is a beginning point of a contour. Only points with
- ZT = 00 or ZT = 01 could set this flag to on.
- + RP : Repeat this flag for N additional points, while N is provided in the
- next byte.
- XData and YData
- Contour point X and Y coordinates. See below for details regarding the
- number of coordinate array elements. Coordinate for the first point is
- relative to (0,0); others are relative to previous point.
- Poly Data
- +----+----+===========+==================================+
- | Header | Masters | Packed per-master variation data |
- +----+----+===========+==================================+
- + Header : A packed field with:
- +---.-.-.-.-.-.-.-+-.-.-.-.-.-.-.-+
- |LMN: Number of masters |
- +---'-'-'-'-'-'-'-+-'-'-'-'-'-'-'-+
- - LMN : Whether the master indeces in the "Masters" segment being uint32s.
- - Number of masters : A 15-bit unsigned integer indicating the number of
- masters for this layer.
- + Masters : An array of uint16 or uint32s (determined by the LMN field in
- the Header), representing master IDs
- + Shared points : Optional (determined by SPZ). When present, a PointList is
- placed here to indicate the points being affected by variations.
- + Packed per-master variation data:
- +===============+==============+==============+==============+
- | Point numbers | X delta data | Y delta data | Link data |
- +===============+==============+==============+==============+
- For "Point numbers", "X delta data" and "Y delta data", See the current
- definition in GVAR, however the "Point number" list now indicates the
- points that its "whether touch" flag being flipped in this master.
- The "Link data" is used to represent "early" linking/IPs.
- +----+----+=======================+
- | nTerms | Link/IP Reclord list |
- +----+----+=======================+
- Link/IP Reclord
- +-.-.-.-.-.-.-.-+----+----+------+------+...
- |0:Y: nFollow-1 | refPtid | followPtId ... (Linking)
- +-'-'-'-'-'-'-'-+----+----+------+------+...
- ^
- |
- }-- Link/Interpolate X coordinate (0) or Y coordinate (1)
- |
- v
- +-.-.-.-.-.-.-.-+----+----+----+----+------+------+...
- |1:Y: nFollow-1 | rupPtid | rdnPtid | followPtId ... (Interpolate)
- +-'-'-'-'-'-'-'-+----+----+----+----+------+------+...
- An IUP is performed after reading each tuple.
- Reference Layer
- |<-- Optional -->|
- +----+----+-------+--+--+--+--+--+--+--+--+--+--+--+--+===============+
- | GID | Flags | X | Y | a | b | c | d | Ref Poly data |
- +----+----+-------+--+--+--+--+--+--+--+--+--+--+--+--+===============+
- + GID : The index of reference
- + Flags :
- +---.---.---.---.---.---.---.---+
- | RESERVED :TFM:RND|
- +---'---'---'---'---'---'---'---+
- - TFM : Whether the transformation terms (a, b, c, d) are provided.
- - RND : Whether round this reference to grid.
- - Ref Poly data : Identical to contour poly data, excluding:
- - IUP mechanism.
- - The point numbers entries are useless, since we are always modifying
- the point attaches this reference.
Add Comment
Please, Sign In to add comment