You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
typesetting/pitfall/fontkit/script.rkt

23 lines
589 B
Racket

#lang pitfall/racket
(provide (all-defined-out))
;; approximates
;; https://github.com/devongovett/fontkit/blob/master/src/layout/Script.js
(define/contract (script-for-string str)
(string? . -> . symbol?)
;; infers unicode script from string.
;; todo: everything
'latn)
(define/contract (script-for-codepoints codepoints)
((listof integer?) . -> . symbol?)
;; infers unicode script from string.
;; todo: everything
(error 'script-for-codepoints-unimplemented))
(define/contract (script-direction script)
((or/c symbol? #f) . -> . symbol?)
'ltr) ; todo everything