shithub: fnt

Download patch

ref: 3e799de72f01ff3c4b17417da080f4a6901fc59f
parent: 1d934b9aa4a47121e0cc8f624b5fe5b981f507e4
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Thu Jun 13 22:22:58 EDT 2024

add a FIXME on maxp table to read different versions

--- a/otf.rkt
+++ b/otf.rkt
@@ -343,16 +343,20 @@
                    {int16 glyphDataFormat unused (= 0)})
          #:tag "head")
 
-(define record-fields
-  (list (cons 'field
-              (list (~a "void *parsed;") (~a "void (*fprint)(int f, int indent, void *parsed);")))
-        (cons 'fprint
-              (list (~a "if(v->fprint != nil && v->parsed != nil)")
-                    (~a "\tv->fprint(f, indent+indentΔ, v->parsed);")))))
+(mkcmplx TableMaxp
+         (mkfields {Version16Dot16 version hex (= #x05000 #x10000)}
+                   {uint16 numGlyphs} ; FIXME there are more fields here, depending on the version
+                   )
+         #:tag "maxp")
 
 (mkcmplx TableRecord
          (mkfields {Tag tableTag} {uint32 checksum hex} {Offset32 offset} {uint32 length})
-         #:extra record-fields)
+         #:extra (list (cons 'field
+                             (list (~a "void *parsed;")
+                                   (~a "void (*fprint)(int f, int indent, void *parsed);")))
+                       (cons 'fprint
+                             (list (~a "if(v->fprint != nil && v->parsed != nil)")
+                                   (~a "\tv->fprint(f, indent+indentΔ, v->parsed);")))))
 
 (define c-friendly-name identity)