shithub: fnt

Download patch

ref: 63f6a9277db89582f0a247e55e781f8c64871ed0
parent: 604208afc7b6996bbd76a254859ab384319aa1b6
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Thu Jun 20 16:03:44 EDT 2024

clean up the macro mess

--- a/otf.rkt
+++ b/otf.rkt
@@ -356,28 +356,31 @@
       (~a (if (> sh 24) cast "") b "[" index off "]" tail))
     (f index bits)))
 
+(define-for-syntax typenames '())
+
 (define-syntax (mktype stx)
   (syntax-parse stx
-    [(_ typ:id bits c:id verb:string)
-     #'(begin
-         (define parse (autoparse bits `c))
-         (mktype typ bits c verb parse))]
+    [(_ typ:id bits c:id verb:string) #'(mktype typ bits c verb (autoparse bits `c))]
     [(_ typ:id bits c:id verb:string parse:expr)
      #:declare bits (expr/c #'size-in-bits/c #:name "size in bits")
-     #'(begin
-         (define typ (make-type `typ bits.c `c verb parse))
-         (set! types (append types (list typ))))]))
+     (begin
+       (set! typenames (cons (syntax-e #`typ) typenames))
+       #'(begin
+           (define typ (make-type `typ bits.c `c verb parse))
+           (set! types (append types (list typ)))))]))
 
 (define-syntax (mkcmplx stx)
   (syntax-parse stx
-    [(_ typ:id fields:expr (~optional (~seq #:tag tag)) (~optional (~seq #:extra extra:expr)))
+    [(_ typ:id fields:expr ...+ (~optional (~seq #:tag tag)) (~optional (~seq #:extra extra:expr)))
      #:declare tag (expr/c #'tag/c #:name "table tag")
-     #'(begin
-         (define tag- (~? (~@ tag.c) #f))
-         (define typ (make-cmplx `typ fields tag- (~? (~@ extra) empty)))
-         (set! cmplxs (append cmplxs (list typ)))
-         (when tag-
-           (set! tagged (append tagged (list typ)))))]))
+     (begin
+       (set! typenames (cons (syntax-e #`typ) typenames))
+       #'(begin
+           (define tag- (~? (~@ tag.c) #f))
+           (define typ (make-cmplx `typ (mkfields [~@ fields] ...) tag- (~? (~@ extra) empty)))
+           (set! cmplxs (append cmplxs (list typ)))
+           (when tag-
+             (set! tagged (append tagged (list typ))))))]))
 
 (mktype uint8 8 u8int "%ud")
 (mktype int8 8 s8int "%d")
@@ -425,61 +428,62 @@
 (define-for-syntax fields '())
 
 (define-syntax (mkattr stx)
+  (define-syntax-class compop
+    #:description "comparison operator"
+    (pattern op:id
+      #:when (member (syntax-e #'op) '(== != < > <= >=))))
+
+  (define-syntax-class arithop
+    #:description "arithmetical operator"
+    (pattern op:id
+      #:when (member (syntax-e #'op) '(+ - / *))))
+
+  (define-syntax-class ref
+    #:description "field reference"
+    (pattern ref:id
+      #:fail-when (not (assoc (syntax-e #'ref) fields)) "no such field"
+      #:with type (cadr (assoc (syntax-e #'ref) fields))))
+
   (syntax-parse stx
-    [(_ _ ({~literal at} ref:id))
-     (let ([rf (assoc (syntax->datum #`ref) fields)])
-       (begin
-         (when (not rf)
-           (raise-syntax-error #f "no such field" stx #'ref))
-         (when (not (type-offset? (cadr rf)))
-           (raise-syntax-error #f (~a (cadr rf) " can't be used as an offset") stx #'ref))
-         #''(at ref)))]
-    [(_ _ (n:number)) #''(count n)]
+    [(_ _ ({~literal at} ref:ref))
+     #:fail-when (not (type-offset? (syntax-e #'ref.type))) "can't be used as an offset"
+     #''(at ref)]
     [(_ type {~literal hex})
-     (begin
-       (when (not (type-number? (syntax->datum #`type)))
-         (raise-syntax-error #f "not a number type" stx #'type))
-       #''(verb "%#ux"))]
-    [(_ type (p:expr vs:number ...+))
-     (begin
-       (when (not (type-comparable? (syntax->datum #`type)))
-         (raise-syntax-error #f "type can't be used in a comparison" stx #'type))
-       #''(test p vs ...))]
-    [(_ _ (p:expr ref:id vs:number ...+))
-     (begin
-       (when (not (assoc (syntax->datum #`ref) fields))
-         (raise-syntax-error #f "no such field" stx #'ref))
-       #''(cond
-            p
-            ref
-            vs ...))]
-    [(_ _ ({~literal count} n:id))
-     (begin
-       (define counter (assoc (syntax->datum #`n) fields))
-       (cond
-         [(pair? counter)
-          (if (type-index? (cadr counter))
-              #''(count n)
-              (raise-syntax-error #f
-                                  (~a "type " (cadr counter) " can't be used as index to the array")
-                                  stx
-                                  #'n))]
-         [else (raise-syntax-error #f "no such field" stx #'n)]))]
-    [(_ _ ({~literal count} e:expr)) #''(count e)] ; FIXME - check fields and ops/numbers
-    [(_ _ {~literal unused}) #''(unused #t)]))
+     #:fail-when (not (type-number? (syntax-e #'type))) "not a number type"
+     #''(verb "%#ux")]
+    [(_ type (p:compop vs:number ...+))
+     #:fail-when (not (type-comparable? (syntax-e #'type))) "type can't be used in a comparison"
+     #''(test p vs ...)]
+    [(_ _ (p:compop ref:ref vs:number ...+))
+     #''(cond
+          p
+          ref
+          vs ...)]
+    [(_ _ {~literal unused}) #''(unused #t)]
+    [(_ _ (ref:ref))
+     #:fail-when (not (type-index? (syntax-e #'ref.type))) "can't be used as index to an array"
+     #''(count ref)]
+    [(_ _ (n:number)) #''(count n)]
+    [(_ _ (p:arithop e:expr ...+)) #''(count (p e ...))])) ; FIXME - check fields and ops/numbers
 
 (define-syntax (mkfield stx)
+  (define-syntax-class name
+    #:description "field name"
+    (pattern name:id
+      #:fail-when (assoc (syntax-e #'name) fields) "duplicate field name"))
+
+  (define-syntax-class type
+    #:description "field type"
+    (pattern type:id
+      #:fail-when (not (member (syntax-e #'type) typenames)) "unknown field type"))
+
   (syntax-parse stx
-    [(_ type:id name:id attrs ...)
+    [(_ type:type name:name attrs ...)
      (begin
-       (let ([f #'(field type
-                         `name
-                         (list (mkattr type [~@ attrs]) ...))])
-         (begin
-           (when (assoc (syntax->datum #`name) fields)
-             (raise-syntax-error #f "duplicate field" stx #'name))
-           (set! fields (cons (syntax->datum #'(name type)) fields))
-           f)))]))
+       (set! fields (cons (syntax->datum #'(name type)) fields))
+       #'(field type
+                `name
+                (list (mkattr type [~@ attrs]) ...)))]))
 
 (define-syntax (mkfields stx)
   (syntax-parse stx
@@ -488,590 +492,580 @@
        (set! fields '())
        #'(list (mkfield [~@ . x]) ...))]))
 
-(mkcmplx SubHeader
-         (mkfields {uint16 firstCode} {uint16 entryCode} {int16 idDelta} {uint16 idRangeOffset}))
+(mkcmplx SubHeader {uint16 firstCode} {uint16 entryCode} {int16 idDelta} {uint16 idRangeOffset})
 
 ; same type for Sequential and Constant
-(mkcmplx MapGroup (mkfields {uint32 startCharCode} {uint32 endCharCode} {uint32 startGlyphID}))
+(mkcmplx MapGroup {uint32 startCharCode} {uint32 endCharCode} {uint32 startGlyphID})
 
-(mkcmplx SubtableCmap0 (mkfields {uint16 length} {uint16 language} {uint8 glyphIdArray [256]}))
+(mkcmplx SubtableCmap0 {uint16 length} {uint16 language} {uint8 glyphIdArray [256]})
 
 ; FIXME
-(mkcmplx SubtableCmap2 (mkfields {uint16 length} {uint16 language} {uint16 subHeaderKeys [256]}))
-#|                     {SubHeader subHeaders (count ?)}
-                       {uint16 glyphIdArray (count ?)}))|#
+(mkcmplx SubtableCmap2 {uint16 length} {uint16 language} {uint16 subHeaderKeys [256]})
+#|                     {SubHeader subHeaders[?]}
+                       {uint16 glyphIdArray[?]}))|#
 
 ; FIXME
 (mkcmplx SubtableCmap4
-         (mkfields {uint16 length}
-                   {uint16 language}
-                   {uint16 segCountX2}
-                   {uint16 searchRange}
-                   {uint16 entrySelector}
-                   {uint16 rangeShift}
-                   {uint16 endCode (count (/ segCountX2 2))}
-                   {uint16 reservedPad unused}
-                   {uint16 startCode (count (/ segCountX2 2))}
-                   {int16 idDelta (count (/ segCountX2 2))}
-                   {int16 idRangeOffset (count (/ segCountX2 2))}
-                   #;{uint16 glyphIdArray (count ?)}))
+         {uint16 length}
+         {uint16 language}
+         {uint16 segCountX2}
+         {uint16 searchRange}
+         {uint16 entrySelector}
+         {uint16 rangeShift}
+         {uint16 endCode [/ segCountX2 2]}
+         {uint16 reservedPad unused}
+         {uint16 startCode [/ segCountX2 2]}
+         {int16 idDelta [/ segCountX2 2]}
+         {int16 idRangeOffset [/ segCountX2 2]}
+         #;{uint16 glyphIdArray [?]})
 
 (mkcmplx SubtableCmap6
-         (mkfields {uint16 length}
-                   {uint16 language}
-                   {uint16 firstCode}
-                   {uint16 entryCount}
-                   {uint16 glyphIdArray (count entryCount)}))
+         {uint16 length}
+         {uint16 language}
+         {uint16 firstCode}
+         {uint16 entryCount}
+         {uint16 glyphIdArray [entryCount]})
 
 (mkcmplx SubtableCmap8
-         (mkfields {uint16 length}
-                   {uint16 language}
-                   {uint8 is32 [8192]}
-                   {uint32 numGroups}
-                   {MapGroup groups (count numGroups)}))
+         {uint16 length}
+         {uint16 language}
+         {uint8 is32 [8192]}
+         {uint32 numGroups}
+         {MapGroup groups [numGroups]})
 
 ; FIXME
 (mkcmplx SubtableCmap10
-         (mkfields {uint16 reserved}
-                   {uint32 length}
-                   {uint32 language}
-                   {uint32 startCharCode}
-                   {uint32 numChars}
-                   #;{uint16 glyphIdArray (count ?)}))
+         {uint16 reserved}
+         {uint32 length}
+         {uint32 language}
+         {uint32 startCharCode}
+         {uint32 numChars}
+         #;{uint16 glyphIdArray [?]})
 
 (mkcmplx SubtableCmap12or13
-         (mkfields {uint16 reserved}
-                   {uint32 length}
-                   {uint32 language}
-                   {uint32 numGroups}
-                   {MapGroup groups (count numGroups)}))
+         {uint16 reserved}
+         {uint32 length}
+         {uint32 language}
+         {uint32 numGroups}
+         {MapGroup groups [numGroups]})
 
-(mkcmplx UnicodeRange (mkfields {uint24 startUnicodeValue} {uint8 additionalCount}))
+(mkcmplx UnicodeRange {uint24 startUnicodeValue} {uint8 additionalCount})
 
-(mkcmplx DefaultUVS
-         (mkfields {uint32 numUnicodeValueRanges}
-                   {UnicodeRange ranges (count numUnicodeValueRanges)}))
+(mkcmplx DefaultUVS {uint32 numUnicodeValueRanges} {UnicodeRange ranges [numUnicodeValueRanges]})
 
-(mkcmplx UVSMapping (mkfields {uint24 unicodeValue} {uint16 glyphID}))
+(mkcmplx UVSMapping {uint24 unicodeValue} {uint16 glyphID})
 
-(mkcmplx NonDefaultUVS
-         (mkfields {uint32 numUVSMappings} {UVSMapping uvsMappings (count numUVSMappings)}))
+(mkcmplx NonDefaultUVS {uint32 numUVSMappings} {UVSMapping uvsMappings [numUVSMappings]})
 
 (mkcmplx VariationSelector
-         (mkfields {uint24 varSelector}
-                   {Offset32 defaultUVSOffset}
-                   {Offset32 nonDefaultUVSOffset}
-                   {DefaultUVS defaultUVS (at defaultUVSOffset)}
-                   {NonDefaultUVS nonDefaultUVS (at nonDefaultUVSOffset)}))
+         {uint24 varSelector}
+         {Offset32 defaultUVSOffset}
+         {Offset32 nonDefaultUVSOffset}
+         {DefaultUVS defaultUVS (at defaultUVSOffset)}
+         {NonDefaultUVS nonDefaultUVS (at nonDefaultUVSOffset)})
 
 (mkcmplx SubtableCmap14
-         (mkfields {uint32 length}
-                   {uint32 numVarSelectorRecords}
-                   {VariationSelector varSelector (count numVarSelectorRecords)}))
+         {uint32 length}
+         {uint32 numVarSelectorRecords}
+         {VariationSelector varSelector [numVarSelectorRecords]})
 
 (mkcmplx SubtableCmap
-         (mkfields {uint16 format (== 0 2 4 6 8 10 12 13 14)}
-                   ; FIXME these fields should be put into a union automatically
-                   {SubtableCmap0 sub0 (== format 0)}
-                   {SubtableCmap2 sub2 (== format 2)}
-                   {SubtableCmap4 sub4 (== format 4)}
-                   {SubtableCmap6 sub6 (== format 6)}
-                   {SubtableCmap8 sub8 (== format 8)}
-                   {SubtableCmap10 sub10 (== format 10)}
-                   {SubtableCmap12or13 sub12or13 (== format 12 13)}
-                   {SubtableCmap14 sub14 (== format 14)}))
+         {uint16 format (== 0 2 4 6 8 10 12 13 14)}
+         ; FIXME these fields should be put into a union automatically
+         {SubtableCmap0 sub0 (== format 0)}
+         {SubtableCmap2 sub2 (== format 2)}
+         {SubtableCmap4 sub4 (== format 4)}
+         {SubtableCmap6 sub6 (== format 6)}
+         {SubtableCmap8 sub8 (== format 8)}
+         {SubtableCmap10 sub10 (== format 10)}
+         {SubtableCmap12or13 sub12or13 (== format 12 13)}
+         {SubtableCmap14 sub14 (== format 14)})
 
 (mkcmplx EncodingRecord
-         (mkfields {uint16 platformID (<= 4)}
-                   {uint16 encodingID}
-                   {Offset32 subtableOffset}
-                   {SubtableCmap subtable (at subtableOffset)}))
+         {uint16 platformID (<= 4)}
+         {uint16 encodingID}
+         {Offset32 subtableOffset}
+         {SubtableCmap subtable (at subtableOffset)})
 
 (mkcmplx TableCmap
-         (mkfields {uint16 version unused (== 0)}
-                   {uint16 numTables}
-                   {EncodingRecord encodingRecords (count numTables)})
+         {uint16 version unused (== 0)}
+         {uint16 numTables}
+         {EncodingRecord encodingRecords [numTables]}
          #:tag "cmap")
 
 (mkcmplx TableHead
-         (mkfields {uint16 majorVersion unused (== 1)}
-                   {uint16 minorVersion unused (== 0)}
-                   {Fixed fontRevision unused}
-                   {uint32 checksumAdjustment unused}
-                   {uint32 magicNumber unused (== #x5f0f3cf5)}
-                   {uint16 flags}
-                   {uint16 unitsPerEm (>= 16) (<= 16384)}
-                   {LONGDATETIME created}
-                   {LONGDATETIME modified}
-                   {int16 xMin}
-                   {int16 yMin}
-                   {int16 xMax}
-                   {int16 yMax}
-                   {uint16 macStyle}
-                   {uint16 lowestRecPPEM}
-                   {int16 fontDirectionHint unused (>= -2) (<= 2)}
-                   {int16 indexToLocFormat (<= 1)}
-                   {int16 glyphDataFormat unused (== 0)})
+         {uint16 majorVersion unused (== 1)}
+         {uint16 minorVersion unused (== 0)}
+         {Fixed fontRevision unused}
+         {uint32 checksumAdjustment unused}
+         {uint32 magicNumber unused (== #x5f0f3cf5)}
+         {uint16 flags}
+         {uint16 unitsPerEm (>= 16) (<= 16384)}
+         {LONGDATETIME created}
+         {LONGDATETIME modified}
+         {int16 xMin}
+         {int16 yMin}
+         {int16 xMax}
+         {int16 yMax}
+         {uint16 macStyle}
+         {uint16 lowestRecPPEM}
+         {int16 fontDirectionHint unused (>= -2) (<= 2)}
+         {int16 indexToLocFormat (<= 1)}
+         {int16 glyphDataFormat unused (== 0)}
          #:tag "head")
 
 (mkcmplx TableHhea
-         (mkfields {uint16 majorVersion (== 1)}
-                   {uint16 minorVersion (== 0)}
-                   {FWORD ascender}
-                   {FWORD descender}
-                   {FWORD lineGap}
-                   {UFWORD advanceWidthMax}
-                   {FWORD minLeftSideBearing}
-                   {FWORD minRightSideBearing}
-                   {FWORD xMaxExtent}
-                   {int16 caretSlopeRise}
-                   {int16 caretSlopeRun}
-                   {int16 caretOffset}
-                   {int16 reserved [4] unused}
-                   {int16 metricDataFormat (== 0)}
-                   {uint16 numberOfHMetrics})
+         {uint16 majorVersion (== 1)}
+         {uint16 minorVersion (== 0)}
+         {FWORD ascender}
+         {FWORD descender}
+         {FWORD lineGap}
+         {UFWORD advanceWidthMax}
+         {FWORD minLeftSideBearing}
+         {FWORD minRightSideBearing}
+         {FWORD xMaxExtent}
+         {int16 caretSlopeRise}
+         {int16 caretSlopeRun}
+         {int16 caretOffset}
+         {int16 reserved [4] unused}
+         {int16 metricDataFormat (== 0)}
+         {uint16 numberOfHMetrics}
          #:tag "hhea")
 
-(mkcmplx LongHorMetric (mkfields {UFWORD advanceWidth} {FWORD lsb}))
+(mkcmplx LongHorMetric {UFWORD advanceWidth} {FWORD lsb})
 
 #|
 FIXME what. WHAT.
 (mkcmplx TableHmtx
-         (mkfields {LongHorMetric hMetrics (count (TableHhea numberOfHMetrics))}
-                   {FWORD leftSideBearings (count (- (TableMaxp numGlyphs) (TableHhea numberOfHMetrics)))}))
+         {LongHorMetric hMetrics[TableHhea numberOfHMetrics]}
+                   {FWORD leftSideBearings[- (TableMaxp numGlyphs) (TableHhea numberOfHMetrics)]})
 |#
 
 (mkcmplx TableMaxp
-         (mkfields {Version16Dot16 version (== #x05000 #x10000) unused}
-                   {uint16 numGlyphs}
-                   ; a bunch of fields ignored here
-                   )
+         {Version16Dot16 version (== #x05000 #x10000) unused}
+         {uint16 numGlyphs}
+         ; a bunch of fields ignored here
          #:tag "maxp")
 
 (mkcmplx TablePost
-         (mkfields {Version16Dot16 version (== #x10000 #x20000 #x25000 #x30000) unused}
-                   {Fixed italicAngle}
-                   {FWORD underlinePosition}
-                   {FWORD underlineThickness}
-                   {uint32 isFixedPitch}
-                   ; a bunch of fields ignored here
-                   )
+         {Version16Dot16 version (== #x10000 #x20000 #x25000 #x30000) unused}
+         {Fixed italicAngle}
+         {FWORD underlinePosition}
+         {FWORD underlineThickness}
+         {uint32 isFixedPitch}
+         ; a bunch of fields ignored here
          #:tag "post")
 
 (mkcmplx NameRecord
-         (mkfields {uint16 platformID}
-                   {uint16 encodingID}
-                   {uint16 languageID}
-                   {uint16 nameID}
-                   {uint16 length}
-                   {Offset16 stringOffset}))
+         {uint16 platformID}
+         {uint16 encodingID}
+         {uint16 languageID}
+         {uint16 nameID}
+         {uint16 length}
+         {Offset16 stringOffset})
 
-(mkcmplx LangTagRecord (mkfields {uint16 length} {Offset16 langTagOffset}))
+(mkcmplx LangTagRecord {uint16 length} {Offset16 langTagOffset})
 
 (mkcmplx TableName
-         (mkfields {uint16 version (== 0 1)}
-                   {uint16 count}
-                   {Offset16 storageOffset}
-                   {NameRecord nameRecord (count count)}
-                   {uint16 langTagCount (>= version 1)}
-                   {LangTagRecord langTagRecord (count langTagCount) (>= version 1)})
+         {uint16 version (== 0 1)}
+         {uint16 count}
+         {Offset16 storageOffset}
+         {NameRecord nameRecord [count]}
+         {uint16 langTagCount (>= version 1)}
+         {LangTagRecord langTagRecord [langTagCount] (>= version 1)}
          #:tag "name")
 
 (mkcmplx BigGlyphMetrics
-         (mkfields {uint8 height}
-                   {uint8 width}
-                   {int8 horiBearingX}
-                   {int8 horiBearingY}
-                   {uint8 horiAdvance}
-                   {int8 vertBearingX}
-                   {int8 vertBearingY}
-                   {uint8 vertAdvance}))
+         {uint8 height}
+         {uint8 width}
+         {int8 horiBearingX}
+         {int8 horiBearingY}
+         {uint8 horiAdvance}
+         {int8 vertBearingX}
+         {int8 vertBearingY}
+         {uint8 vertAdvance})
 
 (mkcmplx SmallGlyphMetrics
-         (mkfields {uint8 height} {uint8 width} {int8 bearingX} {int8 bearingY} {uint8 advance}))
+         {uint8 height}
+         {uint8 width}
+         {int8 bearingX}
+         {int8 bearingY}
+         {uint8 advance})
 
 (mkcmplx SbitLineMetrics
-         (mkfields {int8 ascender}
-                   {int8 descender}
-                   {uint8 widthMax}
-                   {int8 caretSlopeNumerator}
-                   {int8 caretSlopeDenumerator}
-                   {int8 caretOffset}
-                   {int8 minOriginSB}
-                   {int8 minAdvanceSB}
-                   {int8 maxBeforeBL}
-                   {int8 minAfterBL}
-                   {int8 pad [2] unused}))
+         {int8 ascender}
+         {int8 descender}
+         {uint8 widthMax}
+         {int8 caretSlopeNumerator}
+         {int8 caretSlopeDenumerator}
+         {int8 caretOffset}
+         {int8 minOriginSB}
+         {int8 minAdvanceSB}
+         {int8 maxBeforeBL}
+         {int8 minAfterBL}
+         {int8 pad [2] unused})
 
-(mkcmplx IndexSubtable1
-         (mkfields {Offset32 sbitOffsets} #;(count (+ (- lastGlyphIndex firstGlyphIndex) 2))))
+(mkcmplx IndexSubtable1 {Offset32 sbitOffsets} #;[+ (- lastGlyphIndex firstGlyphIndex) 2])
 
-(mkcmplx IndexSubtable2 (mkfields {uint32 imageSize} {BigGlyphMetrics bigMetrics}))
+(mkcmplx IndexSubtable2 {uint32 imageSize} {BigGlyphMetrics bigMetrics})
 
 ; FIXME
-(mkcmplx IndexSubtable3
-         (mkfields {Offset16 sbitOffsets} #;(count (+ (- lastGlyphIndex firstGlyphIndex) 2))))
+(mkcmplx IndexSubtable3 {Offset16 sbitOffsets} #;[+ (- lastGlyphIndex firstGlyphIndex) 2])
 
-(mkcmplx GlyphIdOffsetPair (mkfields {uint16 glyphID} {Offset16 sbitOffset}))
+(mkcmplx GlyphIdOffsetPair {uint16 glyphID} {Offset16 sbitOffset})
 
-(mkcmplx IndexSubtable4
-         (mkfields {uint32 numGlyphs} {GlyphIdOffsetPair glyphArray (count (+ numGlyphs 1))}))
+(mkcmplx IndexSubtable4 {uint32 numGlyphs} {GlyphIdOffsetPair glyphArray [+ numGlyphs 1]})
 
 (mkcmplx IndexSubtable5
-         (mkfields {uint32 imageSize}
-                   {BigGlyphMetrics bigMetrics}
-                   {uint32 numGlyphs}
-                   {uint16 glyphIdArray (count numGlyphs)}))
+         {uint32 imageSize}
+         {BigGlyphMetrics bigMetrics}
+         {uint32 numGlyphs}
+         {uint16 glyphIdArray [numGlyphs]})
 
 (mkcmplx IndexSubtable
-         (mkfields {uint16 indexFormat (>= 1) (<= 5)}
-                   {uint16 imageFormat}
-                   {Offset32 imageDataOffset}
-                   {IndexSubtable1 sub1 (== indexFormat 1)}
-                   {IndexSubtable2 sub2 (== indexFormat 2)}
-                   {IndexSubtable3 sub3 (== indexFormat 3)}
-                   {IndexSubtable4 sub4 (== indexFormat 4)}
-                   {IndexSubtable5 sub5 (== indexFormat 5)}))
+         {uint16 indexFormat (>= 1) (<= 5)}
+         {uint16 imageFormat}
+         {Offset32 imageDataOffset}
+         {IndexSubtable1 sub1 (== indexFormat 1)}
+         {IndexSubtable2 sub2 (== indexFormat 2)}
+         {IndexSubtable3 sub3 (== indexFormat 3)}
+         {IndexSubtable4 sub4 (== indexFormat 4)}
+         {IndexSubtable5 sub5 (== indexFormat 5)})
 
 (mkcmplx IndexSubtableRecord
-         (mkfields {uint16 firstGlyphIndex}
-                   {uint16 lastGlyphIndex}
-                   {Offset32 indexSubtableOffset}
-                   {IndexSubtable indexSubtable (at indexSubtableOffset)}))
+         {uint16 firstGlyphIndex}
+         {uint16 lastGlyphIndex}
+         {Offset32 indexSubtableOffset}
+         {IndexSubtable indexSubtable (at indexSubtableOffset)})
 
-(mkcmplx BitmapSize
-         (mkfields {Offset32 indexSubtableListOffset}
-                   {uint32 indexSubtableListSize}
-                   {uint32 numberOfIndexSubtables}
-                   {uint32 colorRef unused}
-                   {SbitLineMetrics hori}
-                   {SbitLineMetrics vert}
-                   {uint16 startGlyphIndex}
-                   {uint16 endGlyphIndex}
-                   {uint8 ppemX}
-                   {uint8 ppemY}
-                   {uint8 bitDepth}
-                   {int8 flags}
-                   {IndexSubtableRecord
-                    indexSubtableList
-                    (count numberOfIndexSubtables)
-                    (at indexSubtableListOffset)}))
+(mkcmplx
+ BitmapSize
+ {Offset32 indexSubtableListOffset}
+ {uint32 indexSubtableListSize}
+ {uint32 numberOfIndexSubtables}
+ {uint32 colorRef unused}
+ {SbitLineMetrics hori}
+ {SbitLineMetrics vert}
+ {uint16 startGlyphIndex}
+ {uint16 endGlyphIndex}
+ {uint8 ppemX}
+ {uint8 ppemY}
+ {uint8 bitDepth}
+ {int8 flags}
+ {IndexSubtableRecord indexSubtableList [numberOfIndexSubtables] (at indexSubtableListOffset)})
 
-(mkcmplx TableEBDT
-         (mkfields {uint16 majorVersion (== 2)} {uint16 minorVersion (== 0) unused})
-         #:tag "EBDT")
+(mkcmplx TableEBDT {uint16 majorVersion (== 2)} {uint16 minorVersion (== 0) unused} #:tag "EBDT")
 
 (mkcmplx TableEBLC
-         (mkfields {uint16 majorVersion (== 2) unused}
-                   {uint16 minorVersion (== 0) unused}
-                   {uint32 numSizes}
-                   {BitmapSize bitmapSizes (count numSizes)})
+         {uint16 majorVersion (== 2) unused}
+         {uint16 minorVersion (== 0) unused}
+         {uint32 numSizes}
+         {BitmapSize bitmapSizes [numSizes]}
          #:tag "EBLC")
 
 (mkcmplx AttachList
-         (mkfields {Offset16 coverageOffset}
-                   {uint16 glyphCount}
-                   {Offset16 attachPointOffsets (count glyphCount)}))
+         {Offset16 coverageOffset}
+         {uint16 glyphCount}
+         {Offset16 attachPointOffsets [glyphCount]})
 
-(mkcmplx AttachPoint (mkfields {uint16 pointCount} {uint16 pointIndices (count pointCount)}))
+(mkcmplx AttachPoint {uint16 pointCount} {uint16 pointIndices [pointCount]})
 
 (mkcmplx LigCaretList
-         (mkfields {Offset16 coverageOffset}
-                   {uint16 ligGlyphCount}
-                   {Offset16 ligGlyphOffsets (count ligGlyphCount)}))
+         {Offset16 coverageOffset}
+         {uint16 ligGlyphCount}
+         {Offset16 ligGlyphOffsets [ligGlyphCount]})
 
-(mkcmplx LigGlyph (mkfields {uint16 caretCount} {Offset16 caretValueOffsets (count caretCount)}))
+(mkcmplx LigGlyph {uint16 caretCount} {Offset16 caretValueOffsets [caretCount]})
 
 (mkcmplx CaretValue
-         (mkfields {uint16 format (>= 1) (<= 3)}
-                   {int16 coordinate (== format 1 3)}
-                   {uint16 caretValuePointIndex (== format 2)}
-                   {Offset16 deviceOffset (== format 3)}))
+         {uint16 format (>= 1) (<= 3)}
+         {int16 coordinate (== format 1 3)}
+         {uint16 caretValuePointIndex (== format 2)}
+         {Offset16 deviceOffset (== format 3)})
 
 (mkcmplx ValueRecord
-         (mkfields {int16 xPlacement}
-                   {int16 yPlacement}
-                   {int16 xAdvance}
-                   {int16 yAdvance}
-                   {Offset16 xPlaDeviceOffset}
-                   {Offset16 yPlaDeviceOffset}
-                   {Offset16 xAdvDeviceOffset}
-                   {Offset16 yAdvDeviceOffset}))
+         {int16 xPlacement}
+         {int16 yPlacement}
+         {int16 xAdvance}
+         {int16 yAdvance}
+         {Offset16 xPlaDeviceOffset}
+         {Offset16 yPlaDeviceOffset}
+         {Offset16 xAdvDeviceOffset}
+         {Offset16 yAdvDeviceOffset})
 
 (mkcmplx SinglePos
-         (mkfields {uint16 format (== 1 2)}
-                   {Offset16 coverageOffset}
-                   {uint16 valueFormat}
-                   {ValueRecord valueRecord (== format 1)}
-                   {uint16 valueCount (== format 2)}
-                   {ValueRecord valueRecords (== format 2) (count valueCount)}))
+         {uint16 format (== 1 2)}
+         {Offset16 coverageOffset}
+         {uint16 valueFormat}
+         {ValueRecord valueRecord (== format 1)}
+         {uint16 valueCount (== format 2)}
+         {ValueRecord valueRecords [valueCount] (== format 2)})
 
 (mkcmplx TableGDEF
-         (mkfields {uint16 majorVersion (== 1) unused}
-                   {uint16 minorVersion (== 0 2 3)}
-                   {Offset16 glyphClassDefOffset}
-                   {Offset16 attachListOffset}
-                   {Offset16 ligCaretListOffset}
-                   {Offset16 markAttachClassDefOffset}
-                   {Offset16 markGlyphSetsDefOffset (>= minorVersion 2)}
-                   {Offset32 itemVarStoreOffset (>= minorVersion 3)})
+         {uint16 majorVersion (== 1) unused}
+         {uint16 minorVersion (== 0 2 3)}
+         {Offset16 glyphClassDefOffset}
+         {Offset16 attachListOffset}
+         {Offset16 ligCaretListOffset}
+         {Offset16 markAttachClassDefOffset}
+         {Offset16 markGlyphSetsDefOffset (>= minorVersion 2)}
+         {Offset32 itemVarStoreOffset (>= minorVersion 3)}
          #:tag "GDEF")
 
 (mkcmplx LangSys
-         (mkfields {Offset16 lookupOrderOffset unused}
-                   {uint16 requiredFeatureIndex}
-                   {uint16 featureIndexCount}
-                   {uint16 featureIndices (count featureIndexCount)}))
+         {Offset16 lookupOrderOffset unused}
+         {uint16 requiredFeatureIndex}
+         {uint16 featureIndexCount}
+         {uint16 featureIndices [featureIndexCount]})
 
-(mkcmplx LangSysRecord
-         (mkfields {Tag langSysTag} {Offset16 langSysOffset} {LangSys langSys (at langSysOffset)}))
+(mkcmplx LangSysRecord {Tag langSysTag} {Offset16 langSysOffset} {LangSys langSys (at langSysOffset)})
 
 (mkcmplx Script
-         (mkfields {Offset16 defaultLangSysOffset}
-                   {uint16 langSysCount}
-                   {LangSysRecord langSysRecords (count langSysCount)}
-                   {LangSys defaultLangSys (at defaultLangSysOffset)}))
+         {Offset16 defaultLangSysOffset}
+         {uint16 langSysCount}
+         {LangSysRecord langSysRecords [langSysCount]}
+         {LangSys defaultLangSys (at defaultLangSysOffset)})
 
-(mkcmplx ScriptRecord
-         (mkfields {Tag scriptTag} {Offset16 scriptOffset} {Script script (at scriptOffset)}))
+(mkcmplx ScriptRecord {Tag scriptTag} {Offset16 scriptOffset} {Script script (at scriptOffset)})
 
-(mkcmplx ScriptList (mkfields {uint16 scriptCount} {ScriptRecord scriptRecords (count scriptCount)}))
+(mkcmplx ScriptList {uint16 scriptCount} {ScriptRecord scriptRecords [scriptCount]})
 
 (mkcmplx Feature
-         (mkfields {Offset16 featureParamsOffset}
-                   {uint16 lookupIndexCount}
-                   {uint16 lookupListIndices (count lookupIndexCount)}))
+         {Offset16 featureParamsOffset}
+         {uint16 lookupIndexCount}
+         {uint16 lookupListIndices [lookupIndexCount]})
 
-(mkcmplx FeatureRecord
-         (mkfields {Tag featureTag} {Offset16 featureOffset} {Feature feature (at featureOffset)}))
+(mkcmplx FeatureRecord {Tag featureTag} {Offset16 featureOffset} {Feature feature (at featureOffset)})
 
-(mkcmplx FeatureList
-         (mkfields {uint16 featureCount} {FeatureRecord featureRecords (count featureCount)}))
+(mkcmplx FeatureList {uint16 featureCount} {FeatureRecord featureRecords [featureCount]})
 
 (mkcmplx Lookup
-         (mkfields {uint16 lookupType}
-                   {uint16 lookupFlag}
-                   {uint16 subTableCount}
-                   {Offset16 subtableOffsets (count subTableCount)}
-                   {uint16 markFilteringSet}))
+         {uint16 lookupType}
+         {uint16 lookupFlag}
+         {uint16 subTableCount}
+         {Offset16 subtableOffsets [subTableCount]}
+         {uint16 markFilteringSet})
 
-(mkcmplx LookupList (mkfields {uint16 lookupCount} {Offset16 lookupOffsets (count lookupCount)}))
+(mkcmplx LookupList {uint16 lookupCount} {Offset16 lookupOffsets [lookupCount]})
 
 (mkcmplx TableGPOS
-         (mkfields {uint16 majorVersion (== 1) unused}
-                   {uint16 minorVersion (<= 1)}
-                   {Offset16 scriptListOffset}
-                   {Offset16 featureListOffset}
-                   {Offset16 lookupListOffset}
-                   {Offset32 featureVariationsOffset (== minorVersion 1)}
-                   {ScriptList scriptList (at scriptListOffset)}
-                   {FeatureList featureList (at featureListOffset)}
-                   {LookupList lookupList (at lookupListOffset)})
+         {uint16 majorVersion (== 1) unused}
+         {uint16 minorVersion (<= 1)}
+         {Offset16 scriptListOffset}
+         {Offset16 featureListOffset}
+         {Offset16 lookupListOffset}
+         {Offset32 featureVariationsOffset (== minorVersion 1)}
+         {ScriptList scriptList (at scriptListOffset)}
+         {FeatureList featureList (at featureListOffset)}
+         {LookupList lookupList (at lookupListOffset)}
          #:tag "GPOS")
 
 (mkcmplx TableGSUB
-         (mkfields {uint16 majorVersion (== 1) unused}
-                   {uint16 minorVersion (<= 1)}
-                   {Offset16 scriptListOffset}
-                   {Offset16 featureListOffset}
-                   {Offset16 lookupListOffset}
-                   {Offset32 featureVariationsOffset (== minorVersion 1)}
-                   {ScriptList scriptList (at scriptListOffset)}
-                   {FeatureList featureList (at featureListOffset)})
+         {uint16 majorVersion (== 1) unused}
+         {uint16 minorVersion (<= 1)}
+         {Offset16 scriptListOffset}
+         {Offset16 featureListOffset}
+         {Offset16 lookupListOffset}
+         {Offset32 featureVariationsOffset (== minorVersion 1)}
+         {ScriptList scriptList (at scriptListOffset)}
+         {FeatureList featureList (at featureListOffset)}
          #:tag "GSUB")
 
-(mkcmplx MathValueRecord (mkfields {FWORD value} {Offset16 deviceOffset}))
+(mkcmplx MathValueRecord {FWORD value} {Offset16 deviceOffset})
 
 (mkcmplx MathConstants
-         (mkfields {int16 scriptPercentScaleDown}
-                   {int16 scriptScriptPercentScaleDown}
-                   {UFWORD delimitedSubFormulaMinHeight}
-                   {UFWORD displayOperatorMinHeight}
-                   {MathValueRecord mathLeading}
-                   {MathValueRecord axisHeight}
-                   {MathValueRecord accentBaseHeight}
-                   {MathValueRecord flattenedAccentBaseHeight}
-                   {MathValueRecord subscriptShiftDown}
-                   {MathValueRecord subscriptTopMax}
-                   {MathValueRecord subscriptBaselineDropMin}
-                   {MathValueRecord superscriptShiftUp}
-                   {MathValueRecord superscriptShiftUpCramped}
-                   {MathValueRecord superscriptBottomMin}
-                   {MathValueRecord superscriptBaselineDropMax}
-                   {MathValueRecord subSuperscriptGapMin}
-                   {MathValueRecord superscriptBottomMaxWithSubscript}
-                   {MathValueRecord spaceAfterScript}
-                   {MathValueRecord upperLimitGapMin}
-                   {MathValueRecord upperLimitBaselineRiseMin}
-                   {MathValueRecord lowerLimitGapMin}
-                   {MathValueRecord lowerLimitBaselineDropMin}
-                   {MathValueRecord stackTopShiftUp}
-                   {MathValueRecord stackTopDisplayStyleShiftUp}
-                   {MathValueRecord stackBottomShiftDown}
-                   {MathValueRecord stackBottomDisplayStyleShiftDown}
-                   {MathValueRecord stackGapMin}
-                   {MathValueRecord stackDisplayStyleGapMin}
-                   {MathValueRecord stretchStackTopShiftUp}
-                   {MathValueRecord stretchStackBottomShiftDown}
-                   {MathValueRecord stretchStackGapAboveMin}
-                   {MathValueRecord stretchStackGapBelowMin}
-                   {MathValueRecord fractionNumeratorShiftUp}
-                   {MathValueRecord fractionNumeratorDisplayStyleShiftUp}
-                   {MathValueRecord fractionDenominatorShiftDown}
-                   {MathValueRecord fractionDenominatorDisplayStyleShiftDown}
-                   {MathValueRecord fractionNumeratorGapMin}
-                   {MathValueRecord fractionNumDisplayStyleGapMin}
-                   {MathValueRecord fractionRuleThickness}
-                   {MathValueRecord fractionDenominatorGapMin}
-                   {MathValueRecord fractionDenomDisplayStyleGapMin}
-                   {MathValueRecord skewedFractionHorizontalGap}
-                   {MathValueRecord skewedFractionVerticalGap}
-                   {MathValueRecord overbarVerticalGap}
-                   {MathValueRecord overbarRuleThickness}
-                   {MathValueRecord overbarExtraAscender}
-                   {MathValueRecord underbarVerticalGap}
-                   {MathValueRecord underbarRuleThickness}
-                   {MathValueRecord underbarExtraDescender}
-                   {MathValueRecord radicalVerticalGap}
-                   {MathValueRecord radicalDisplayStyleVerticalGap}
-                   {MathValueRecord radicalRuleThickness}
-                   {MathValueRecord radicalExtraAscender}
-                   {MathValueRecord radicalKernBeforeDegree}
-                   {MathValueRecord radicalKernAfterDegree}
-                   {int16 radicalDegreeBottomRaisePercent}))
+         {int16 scriptPercentScaleDown}
+         {int16 scriptScriptPercentScaleDown}
+         {UFWORD delimitedSubFormulaMinHeight}
+         {UFWORD displayOperatorMinHeight}
+         {MathValueRecord mathLeading}
+         {MathValueRecord axisHeight}
+         {MathValueRecord accentBaseHeight}
+         {MathValueRecord flattenedAccentBaseHeight}
+         {MathValueRecord subscriptShiftDown}
+         {MathValueRecord subscriptTopMax}
+         {MathValueRecord subscriptBaselineDropMin}
+         {MathValueRecord superscriptShiftUp}
+         {MathValueRecord superscriptShiftUpCramped}
+         {MathValueRecord superscriptBottomMin}
+         {MathValueRecord superscriptBaselineDropMax}
+         {MathValueRecord subSuperscriptGapMin}
+         {MathValueRecord superscriptBottomMaxWithSubscript}
+         {MathValueRecord spaceAfterScript}
+         {MathValueRecord upperLimitGapMin}
+         {MathValueRecord upperLimitBaselineRiseMin}
+         {MathValueRecord lowerLimitGapMin}
+         {MathValueRecord lowerLimitBaselineDropMin}
+         {MathValueRecord stackTopShiftUp}
+         {MathValueRecord stackTopDisplayStyleShiftUp}
+         {MathValueRecord stackBottomShiftDown}
+         {MathValueRecord stackBottomDisplayStyleShiftDown}
+         {MathValueRecord stackGapMin}
+         {MathValueRecord stackDisplayStyleGapMin}
+         {MathValueRecord stretchStackTopShiftUp}
+         {MathValueRecord stretchStackBottomShiftDown}
+         {MathValueRecord stretchStackGapAboveMin}
+         {MathValueRecord stretchStackGapBelowMin}
+         {MathValueRecord fractionNumeratorShiftUp}
+         {MathValueRecord fractionNumeratorDisplayStyleShiftUp}
+         {MathValueRecord fractionDenominatorShiftDown}
+         {MathValueRecord fractionDenominatorDisplayStyleShiftDown}
+         {MathValueRecord fractionNumeratorGapMin}
+         {MathValueRecord fractionNumDisplayStyleGapMin}
+         {MathValueRecord fractionRuleThickness}
+         {MathValueRecord fractionDenominatorGapMin}
+         {MathValueRecord fractionDenomDisplayStyleGapMin}
+         {MathValueRecord skewedFractionHorizontalGap}
+         {MathValueRecord skewedFractionVerticalGap}
+         {MathValueRecord overbarVerticalGap}
+         {MathValueRecord overbarRuleThickness}
+         {MathValueRecord overbarExtraAscender}
+         {MathValueRecord underbarVerticalGap}
+         {MathValueRecord underbarRuleThickness}
+         {MathValueRecord underbarExtraDescender}
+         {MathValueRecord radicalVerticalGap}
+         {MathValueRecord radicalDisplayStyleVerticalGap}
+         {MathValueRecord radicalRuleThickness}
+         {MathValueRecord radicalExtraAscender}
+         {MathValueRecord radicalKernBeforeDegree}
+         {MathValueRecord radicalKernAfterDegree}
+         {int16 radicalDegreeBottomRaisePercent})
 
 (mkcmplx MathItalicsCorrectionInfo
-         (mkfields {Offset16 italicsCorrectionCoverageOffset}
-                   {uint16 italicsCorrectionCount}
-                   {MathValueRecord italicsCorrection (count italicsCorrectionCount)}))
+         {Offset16 italicsCorrectionCoverageOffset}
+         {uint16 italicsCorrectionCount}
+         {MathValueRecord italicsCorrection [italicsCorrectionCount]})
 
 (mkcmplx MathTopAccentAttachment
-         (mkfields {Offset16 topAccentCoverageOffset}
-                   {uint16 topAccentAttachmentCount}
-                   {MathValueRecord topAccentAttachment (count topAccentAttachmentCount)}))
+         {Offset16 topAccentCoverageOffset}
+         {uint16 topAccentAttachmentCount}
+         {MathValueRecord topAccentAttachment [topAccentAttachmentCount]})
 
 (mkcmplx MathKernInfoRecord
-         (mkfields {Offset16 topRightMathKernOffset}
-                   {Offset16 topLeftMathKernOffset}
-                   {Offset16 bottomRightMathKernOffset}
-                   {Offset16 bottomLeftMathKernOffset}))
+         {Offset16 topRightMathKernOffset}
+         {Offset16 topLeftMathKernOffset}
+         {Offset16 bottomRightMathKernOffset}
+         {Offset16 bottomLeftMathKernOffset})
 
 (mkcmplx MathKernInfo
-         (mkfields {Offset16 mathKernCoverageOffset}
-                   {uint16 mathKernCount}
-                   {MathKernInfoRecord mathKernInfoRecords (count mathKernCount)}))
+         {Offset16 mathKernCoverageOffset}
+         {uint16 mathKernCount}
+         {MathKernInfoRecord mathKernInfoRecords [mathKernCount]})
 
 (mkcmplx MathKern
-         (mkfields {uint16 heightCount}
-                   {MathValueRecord correctionHeight (count heightCount)}
-                   {MathValueRecord kernValues (count heightCount)}))
+         {uint16 heightCount}
+         {MathValueRecord correctionHeight [heightCount]}
+         {MathValueRecord kernValues [heightCount]})
 
-(mkcmplx Coverage1 (mkfields {uint16 glyphCount} {uint16 glyphArray (count glyphCount)}))
+(mkcmplx Coverage1 {uint16 glyphCount} {uint16 glyphArray [glyphCount]})
 
-(mkcmplx RangeRecord (mkfields {uint16 startGlyphID} {uint16 endGlyphID} {uint16 startCoverageIndex}))
+(mkcmplx RangeRecord {uint16 startGlyphID} {uint16 endGlyphID} {uint16 startCoverageIndex})
 
-(mkcmplx Coverage2 (mkfields {uint16 rangeCount} {RangeRecord rangeRecords (count rangeCount)}))
+(mkcmplx Coverage2 {uint16 rangeCount} {RangeRecord rangeRecords [rangeCount]})
 
-(mkcmplx
- Coverage
- (mkfields {uint16 format (== 1 2)} {Coverage1 cov1 (== format 1)} {Coverage2 cov2 (== format 2)}))
+(mkcmplx Coverage
+         {uint16 format (== 1 2)}
+         {Coverage1 cov1 (== format 1)}
+         {Coverage2 cov2 (== format 2)})
 
 (mkcmplx MathVariants
-         (mkfields {UFWORD minConnectorOverlap}
-                   {Offset16 vertGlyphCoverageOffset}
-                   {Offset16 horizGlyphCoverageOffset}
-                   {uint16 vertGlyphCount}
-                   {uint16 horizGlyphCount}
-                   {Offset16 vertGlyphConstructionOffsets (count vertGlyphCount)}
-                   {Offset16 horizGlyphConstructionOffsets (count horizGlyphCount)}
-                   {Coverage vertGlyphCoverage (at vertGlyphCoverageOffset)}
-                   {Coverage horizGlyphCoverage (at horizGlyphCoverageOffset)}))
+         {UFWORD minConnectorOverlap}
+         {Offset16 vertGlyphCoverageOffset}
+         {Offset16 horizGlyphCoverageOffset}
+         {uint16 vertGlyphCount}
+         {uint16 horizGlyphCount}
+         {Offset16 vertGlyphConstructionOffsets [vertGlyphCount]}
+         {Offset16 horizGlyphConstructionOffsets [horizGlyphCount]}
+         {Coverage vertGlyphCoverage (at vertGlyphCoverageOffset)}
+         {Coverage horizGlyphCoverage (at horizGlyphCoverageOffset)})
 
 (mkcmplx MathGlyphInfo
-         (mkfields
-          {Offset16 mathItalicsCorrectionInfoOffset}
-          {Offset16 mathTopAccentAttachmentOffset}
-          {Offset16 extendedShapeCoverageOffset} ; FIXME WHERE is this shit defined???
-          {Offset16 mathKernInfoOffset}
-          {MathItalicsCorrectionInfo mathItalicsCorrectionInfo (at mathItalicsCorrectionInfoOffset)}
-          {MathTopAccentAttachment mathTopAccentAttachment (at mathTopAccentAttachmentOffset)}
-          {MathKernInfo mathKernInfo (at mathKernInfoOffset)}))
+         {Offset16 mathItalicsCorrectionInfoOffset}
+         {Offset16 mathTopAccentAttachmentOffset}
+         {Offset16 extendedShapeCoverageOffset} ; FIXME WHERE is this shit defined???
+         {Offset16 mathKernInfoOffset}
+         {MathItalicsCorrectionInfo mathItalicsCorrectionInfo (at mathItalicsCorrectionInfoOffset)}
+         {MathTopAccentAttachment mathTopAccentAttachment (at mathTopAccentAttachmentOffset)}
+         {MathKernInfo mathKernInfo (at mathKernInfoOffset)})
 
-(mkcmplx MathGlyphVariantRecord (mkfields {uint16 variantGlyph} {UFWORD advanceMeasurement}))
+(mkcmplx MathGlyphVariantRecord {uint16 variantGlyph} {UFWORD advanceMeasurement})
 
 (mkcmplx GlyphPart
-         (mkfields {uint16 glyphID}
-                   {UFWORD startConnectorLength}
-                   {UFWORD endConnectorLength}
-                   {UFWORD fullAdvance}
-                   {uint16 partFlags}))
+         {uint16 glyphID}
+         {UFWORD startConnectorLength}
+         {UFWORD endConnectorLength}
+         {UFWORD fullAdvance}
+         {uint16 partFlags})
 
 (mkcmplx GlyphAssembly
-         (mkfields {MathValueRecord italicsCorrection}
-                   {uint16 partCount}
-                   {GlyphPart partRecords (count partCount)}))
+         {MathValueRecord italicsCorrection}
+         {uint16 partCount}
+         {GlyphPart partRecords [partCount]})
 
 (mkcmplx MathGlyphConstruction
-         (mkfields {Offset16 glyphAssemblyOffset}
-                   {uint16 variantCount}
-                   {MathGlyphVariantRecord mathGlyphVariantRecords (count variantCount)}
-                   {GlyphAssembly glyphAssembly (at glyphAssemblyOffset)}))
+         {Offset16 glyphAssemblyOffset}
+         {uint16 variantCount}
+         {MathGlyphVariantRecord mathGlyphVariantRecords [variantCount]}
+         {GlyphAssembly glyphAssembly (at glyphAssemblyOffset)})
 
 (mkcmplx TableMATH
-         (mkfields {uint16 majorVersion (== 1) unused}
-                   {uint16 minorVersion (== 0) unused}
-                   {Offset16 mathConstantsOffset}
-                   {Offset16 mathGlyphInfoOffset}
-                   {Offset16 mathVariantsOffset}
-                   {MathConstants mathConstants (at mathConstantsOffset)}
-                   {MathGlyphInfo mathGlyphInfo (at mathGlyphInfoOffset)}
-                   {MathVariants mathVariants (at mathVariantsOffset)})
+         {uint16 majorVersion (== 1) unused}
+         {uint16 minorVersion (== 0) unused}
+         {Offset16 mathConstantsOffset}
+         {Offset16 mathGlyphInfoOffset}
+         {Offset16 mathVariantsOffset}
+         {MathConstants mathConstants (at mathConstantsOffset)}
+         {MathGlyphInfo mathGlyphInfo (at mathGlyphInfoOffset)}
+         {MathVariants mathVariants (at mathVariantsOffset)}
          #:tag "MATH")
 
 (mkcmplx TableOS∕2
-         (mkfields {uint16 version (<= 5)}
-                   {FWORD xAvgCharWidth}
-                   {uint16 usWeightClass}
-                   {uint16 usWidthClass}
-                   {uint16 fsType}
-                   {FWORD ySubscriptXSize}
-                   {FWORD ySubscriptYSize}
-                   {FWORD ySubscriptXOffset}
-                   {FWORD ySubscriptYOffset}
-                   {FWORD ySuperscriptXSize}
-                   {FWORD ySuperscriptYSize}
-                   {FWORD ySuperscriptXOffset}
-                   {FWORD ySuperscriptYOffset}
-                   {FWORD yStrikeoutSize}
-                   {FWORD yStrikeoutPosition}
-                   {int16 sFamilyClass}
-                   {uint8 panose [10]}
-                   {uint32 ulUnicodeRange1 hex}
-                   {uint32 ulUnicodeRange2 hex}
-                   {uint32 ulUnicodeRange3 hex}
-                   {uint32 ulUnicodeRange4 hex}
-                   {Tag achVendID}
-                   {uint16 fsSelection}
-                   {uint16 usFirstCharIndex}
-                   {uint16 usLastCharIndex}
-                   {FWORD sTypoAscender}
-                   {FWORD sTypoDescender}
-                   {FWORD sTypoLineGap}
-                   {UFWORD usWinAscent}
-                   {UFWORD usWinDescent}
-                   {uint32 ulCodePageRange1 (>= version 1) hex}
-                   {uint32 ulCodePageRange2 (>= version 1) hex}
-                   {FWORD sxHeight (>= version 2)}
-                   {FWORD sCapHeight (>= version 2)}
-                   {uint16 usDefaultChar (>= version 2) hex}
-                   {uint16 usBreakChar (>= version 2) hex}
-                   {uint16 usMaxContext (>= version 2)}
-                   {uint16 usLowerOpticalPointSize (>= version 5)}
-                   {uint16 usUpperOpticalPointSize (>= version 5)})
+         {uint16 version (<= 5)}
+         {FWORD xAvgCharWidth}
+         {uint16 usWeightClass}
+         {uint16 usWidthClass}
+         {uint16 fsType}
+         {FWORD ySubscriptXSize}
+         {FWORD ySubscriptYSize}
+         {FWORD ySubscriptXOffset}
+         {FWORD ySubscriptYOffset}
+         {FWORD ySuperscriptXSize}
+         {FWORD ySuperscriptYSize}
+         {FWORD ySuperscriptXOffset}
+         {FWORD ySuperscriptYOffset}
+         {FWORD yStrikeoutSize}
+         {FWORD yStrikeoutPosition}
+         {int16 sFamilyClass}
+         {uint8 panose [10]}
+         {uint32 ulUnicodeRange1 hex}
+         {uint32 ulUnicodeRange2 hex}
+         {uint32 ulUnicodeRange3 hex}
+         {uint32 ulUnicodeRange4 hex}
+         {Tag achVendID}
+         {uint16 fsSelection}
+         {uint16 usFirstCharIndex}
+         {uint16 usLastCharIndex}
+         {FWORD sTypoAscender}
+         {FWORD sTypoDescender}
+         {FWORD sTypoLineGap}
+         {UFWORD usWinAscent}
+         {UFWORD usWinDescent}
+         {uint32 ulCodePageRange1 (>= version 1) hex}
+         {uint32 ulCodePageRange2 (>= version 1) hex}
+         {FWORD sxHeight (>= version 2)}
+         {FWORD sCapHeight (>= version 2)}
+         {uint16 usDefaultChar (>= version 2) hex}
+         {uint16 usBreakChar (>= version 2) hex}
+         {uint16 usMaxContext (>= version 2)}
+         {uint16 usLowerOpticalPointSize (>= version 5)}
+         {uint16 usUpperOpticalPointSize (>= version 5)}
          #:tag "OS/2")
 
 (mkcmplx TableRecord
-         (mkfields {Tag tableTag} {uint32 checksum unused hex} {Offset32 offset} {uint32 length})
+         {Tag tableTag}
+         {uint32 checksum unused hex}
+         {Offset32 offset}
+         {uint32 length}
          #:extra (list (cons 'field
                              (list (~a "void *parsed;")
                                    (~a "void (*print)(Biobuf *f, int indent, void *parsed);")))
@@ -1115,12 +1109,12 @@
                     (~a "}")))))
 
 (mkcmplx TableDirectory
-         (mkfields {uint32 sfntVersion (== #x00010000 #x4f54544f) hex}
-                   {uint16 numTables}
-                   {uint16 searchRange}
-                   {uint16 entrySelector}
-                   {uint16 rangeShift}
-                   {TableRecord tableRecords (count numTables)})
+         {uint32 sfntVersion (== #x00010000 #x4f54544f) hex}
+         {uint16 numTables}
+         {uint16 searchRange}
+         {uint16 entrySelector}
+         {uint16 rangeShift}
+         {TableRecord tableRecords [numTables]}
          #:extra (tagged-tables-fields tagged))
 
 (define (out path f)