From 0ea63c0144627ee287a31780d977fcf429ef43e6 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Fri, 30 Nov 2018 12:47:44 -0800 Subject: [PATCH] reorg tables --- fontland/fontland/subset.rkt | 2 +- fontland/fontland/{ => table}/CFF_.rkt | 2 +- fontland/fontland/{ => table}/OS2.rkt | 2 +- fontland/fontland/{ => table}/cvt_.rkt | 2 +- fontland/fontland/{ => table}/fpgm.rkt | 6 +++--- fontland/fontland/{ => table}/glyf.rkt | 2 +- fontland/fontland/{ => table}/head.rkt | 2 +- fontland/fontland/{ => table}/hhea.rkt | 2 +- fontland/fontland/{ => table}/hmtx.rkt | 2 +- fontland/fontland/{ => table}/loca.rkt | 2 +- fontland/fontland/{ => table}/maxp.rkt | 2 +- fontland/fontland/{ => table}/post.rkt | 2 +- fontland/fontland/{ => table}/prep.rkt | 2 +- fontland/fontland/tables.rkt | 3 ++- 14 files changed, 17 insertions(+), 16 deletions(-) rename fontland/fontland/{ => table}/CFF_.rkt (91%) rename fontland/fontland/{ => table}/OS2.rkt (99%) rename fontland/fontland/{ => table}/cvt_.rkt (97%) rename fontland/fontland/{ => table}/fpgm.rkt (95%) rename fontland/fontland/{ => table}/glyf.rkt (95%) rename fontland/fontland/{ => table}/head.rkt (97%) rename fontland/fontland/{ => table}/hhea.rkt (98%) rename fontland/fontland/{ => table}/hmtx.rkt (98%) rename fontland/fontland/{ => table}/loca.rkt (99%) rename fontland/fontland/{ => table}/maxp.rkt (96%) rename fontland/fontland/{ => table}/post.rkt (98%) rename fontland/fontland/{ => table}/prep.rkt (97%) diff --git a/fontland/fontland/subset.rkt b/fontland/fontland/subset.rkt index 76bbe2f4..8021ae7f 100644 --- a/fontland/fontland/subset.rkt +++ b/fontland/fontland/subset.rkt @@ -1,6 +1,6 @@ #lang debug racket/base (require "racket.rkt") -(require racket/serialize "ttfglyphencoder.rkt" "loca.rkt" "directory.rkt" xenomorph) +(require racket/serialize "ttfglyphencoder.rkt" "table/loca.rkt" "directory.rkt" xenomorph) (provide Subset CFFSubset TTFSubset) #| diff --git a/fontland/fontland/CFF_.rkt b/fontland/fontland/table/CFF_.rkt similarity index 91% rename from fontland/fontland/CFF_.rkt rename to fontland/fontland/table/CFF_.rkt index 09197b5c..d0a9e453 100644 --- a/fontland/fontland/CFF_.rkt +++ b/fontland/fontland/table/CFF_.rkt @@ -1,5 +1,5 @@ #lang racket/base -(require "racket.rkt") +(require "../racket.rkt") (require xenomorph) (provide CFF_) diff --git a/fontland/fontland/OS2.rkt b/fontland/fontland/table/OS2.rkt similarity index 99% rename from fontland/fontland/OS2.rkt rename to fontland/fontland/table/OS2.rkt index 15d50252..3a467c74 100644 --- a/fontland/fontland/OS2.rkt +++ b/fontland/fontland/table/OS2.rkt @@ -1,5 +1,5 @@ #lang racket/base -(require "racket.rkt") +(require "../racket.rkt") (require xenomorph) (provide (all-defined-out)) diff --git a/fontland/fontland/cvt_.rkt b/fontland/fontland/table/cvt_.rkt similarity index 97% rename from fontland/fontland/cvt_.rkt rename to fontland/fontland/table/cvt_.rkt index d76630d9..65b92240 100644 --- a/fontland/fontland/cvt_.rkt +++ b/fontland/fontland/table/cvt_.rkt @@ -1,5 +1,5 @@ #lang racket/base -(require "racket.rkt") +(require "../racket.rkt") (require xenomorph) (provide (all-defined-out)) diff --git a/fontland/fontland/fpgm.rkt b/fontland/fontland/table/fpgm.rkt similarity index 95% rename from fontland/fontland/fpgm.rkt rename to fontland/fontland/table/fpgm.rkt index ae090670..a99c878f 100644 --- a/fontland/fontland/fpgm.rkt +++ b/fontland/fontland/table/fpgm.rkt @@ -1,5 +1,5 @@ #lang racket/base -(require "racket.rkt") +(require "../racket.rkt") (require xenomorph) (provide (all-defined-out)) @@ -13,9 +13,9 @@ https://github.com/mbutterick/fontkit/blob/master/src/tables/fpgm.js ;; is for the definition of functions that are used in many different glyph programs. -(define-subclass Struct (fpgm%)) +(define-subclass Struct (Rfpgm)) -(define fpgm (make-object fpgm% +(define fpgm (make-object Rfpgm (dictify 'instructions (make-object Array uint8)))) diff --git a/fontland/fontland/glyf.rkt b/fontland/fontland/table/glyf.rkt similarity index 95% rename from fontland/fontland/glyf.rkt rename to fontland/fontland/table/glyf.rkt index 3b5a1ea4..5055ff75 100644 --- a/fontland/fontland/glyf.rkt +++ b/fontland/fontland/table/glyf.rkt @@ -1,5 +1,5 @@ #lang racket/base -(require "racket.rkt") +(require "../racket.rkt") (require xenomorph) (provide (all-defined-out)) diff --git a/fontland/fontland/head.rkt b/fontland/fontland/table/head.rkt similarity index 97% rename from fontland/fontland/head.rkt rename to fontland/fontland/table/head.rkt index f714161b..ee5609a8 100644 --- a/fontland/fontland/head.rkt +++ b/fontland/fontland/table/head.rkt @@ -1,5 +1,5 @@ #lang racket/base -(require "racket.rkt") +(require "../racket.rkt") (require xenomorph) (provide (all-defined-out)) diff --git a/fontland/fontland/hhea.rkt b/fontland/fontland/table/hhea.rkt similarity index 98% rename from fontland/fontland/hhea.rkt rename to fontland/fontland/table/hhea.rkt index 9f91da13..b0037e09 100644 --- a/fontland/fontland/hhea.rkt +++ b/fontland/fontland/table/hhea.rkt @@ -1,5 +1,5 @@ #lang racket/base -(require "racket.rkt") +(require "../racket.rkt") (require xenomorph) (provide (all-defined-out)) diff --git a/fontland/fontland/hmtx.rkt b/fontland/fontland/table/hmtx.rkt similarity index 98% rename from fontland/fontland/hmtx.rkt rename to fontland/fontland/table/hmtx.rkt index 057d27c9..cd85dd11 100644 --- a/fontland/fontland/hmtx.rkt +++ b/fontland/fontland/table/hmtx.rkt @@ -1,5 +1,5 @@ #lang racket/base -(require "racket.rkt") +(require "../racket.rkt") (require xenomorph) (provide (all-defined-out)) diff --git a/fontland/fontland/loca.rkt b/fontland/fontland/table/loca.rkt similarity index 99% rename from fontland/fontland/loca.rkt rename to fontland/fontland/table/loca.rkt index 3b24ab4a..c2ca1f17 100644 --- a/fontland/fontland/loca.rkt +++ b/fontland/fontland/table/loca.rkt @@ -1,5 +1,5 @@ #lang racket/base -(require "racket.rkt") +(require "../racket.rkt") (require xenomorph) (provide (all-defined-out)) diff --git a/fontland/fontland/maxp.rkt b/fontland/fontland/table/maxp.rkt similarity index 96% rename from fontland/fontland/maxp.rkt rename to fontland/fontland/table/maxp.rkt index d8abab86..77ef9e95 100644 --- a/fontland/fontland/maxp.rkt +++ b/fontland/fontland/table/maxp.rkt @@ -1,5 +1,5 @@ #lang racket/base -(require "racket.rkt") +(require "../racket.rkt") (require xenomorph) (provide (all-defined-out)) diff --git a/fontland/fontland/post.rkt b/fontland/fontland/table/post.rkt similarity index 98% rename from fontland/fontland/post.rkt rename to fontland/fontland/table/post.rkt index 4ee760d9..897aade4 100644 --- a/fontland/fontland/post.rkt +++ b/fontland/fontland/table/post.rkt @@ -1,5 +1,5 @@ #lang racket/base -(require "racket.rkt") +(require "../racket.rkt") (require xenomorph) (provide (all-defined-out)) diff --git a/fontland/fontland/prep.rkt b/fontland/fontland/table/prep.rkt similarity index 97% rename from fontland/fontland/prep.rkt rename to fontland/fontland/table/prep.rkt index 3a3d5c77..3e9477e9 100644 --- a/fontland/fontland/prep.rkt +++ b/fontland/fontland/table/prep.rkt @@ -1,5 +1,5 @@ #lang racket/base -(require "racket.rkt") +(require "../racket.rkt") (require xenomorph) (provide (all-defined-out)) diff --git a/fontland/fontland/tables.rkt b/fontland/fontland/tables.rkt index 7de62692..f3145eff 100644 --- a/fontland/fontland/tables.rkt +++ b/fontland/fontland/tables.rkt @@ -11,7 +11,8 @@ https://github.com/mbutterick/fontkit/blob/master/src/tables/index.js (define-macro (define-table-codecs ID TABLE-ID ...) (with-pattern ([(TABLE-ID-STRING ...) (pattern-case-filter #'(TABLE-ID ...) - [STX (datum->syntax caller-stx (string-replace (format "~a.rkt" (syntax->datum #'STX)) "/" ""))])]) + [STX (datum->syntax caller-stx + (string-append "table/" (string-replace (format "~a.rkt" (syntax->datum #'STX)) "/" "")))])]) #'(begin (r+p TABLE-ID-STRING ...) (test-module (require (submod TABLE-ID-STRING test) ...))