shithub: fnt

Download patch

ref: d1b0478470d6cffc5c89a457ae357adab199b37c
parent: df052be4b98c368684f1c26b206a5a80c67eaf03
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Sun Jun 16 21:48:56 EDT 2024

add more types

--- a/otf.rkt
+++ b/otf.rkt
@@ -13,7 +13,7 @@
 (define tagged '()) ; complex types set that also have a defined tag
 
 ; types allowed to be used as index
-(define-for-syntax (type-index? type) (member type '(uint16)))
+(define-for-syntax (type-index? type) (member type '(uint16 uint32)))
 
 (define size-in-bits/c
   (make-contract #:name 'size-in-bits/c #:first-order (λ (x) (member x '(8 16 24 32 40 48 64)))))
@@ -429,7 +429,7 @@
          #:tag "hhea")
 
 (mkcmplx TableMaxp
-         (mkfields {Version16Dot16 version (= #x05000 #x10000)}
+         (mkfields {Version16Dot16 version (= #x05000 #x10000) unused}
                    {uint16 numGlyphs}
                    ; a bunch of fields ignored here
                    )
@@ -436,7 +436,7 @@
          #:tag "maxp")
 
 (mkcmplx TablePost
-         (mkfields {Version16Dot16 version (= #x10000 #x20000 #x25000 #x30000)}
+         (mkfields {Version16Dot16 version (= #x10000 #x20000 #x25000 #x30000) unused}
                    {Fixed italicAngle}
                    {FWORD underlinePosition}
                    {FWORD underlineThickness}
@@ -444,6 +444,53 @@
                    ; a bunch of fields ignored here
                    )
          #:tag "post")
+
+(mkcmplx BigGlyphMetrics
+         (mkfields {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}))
+
+(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}))
+
+(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}))
+
+(mkcmplx TableEBLC
+         (mkfields {uint16 majorVersion (= 2) unused}
+                   {uint16 minorVersion (= 0) unused}
+                   {uint32 numSizes}
+                   {BitmapSize bitmapSizes (count numSizes)})
+         #:tag "EBLC")
 
 (mkcmplx TableOS∕2
          (mkfields {uint16 version (<= 5)}