change clustering behavior

main
Matthew Butterick 5 years ago
parent 73341a8310
commit 23421dd831

@ -7,164 +7,169 @@
(define hb-direction-values
'(HB_DIRECTION_INVALID = 0
HB_DIRECTION_LTR = 4
HB_DIRECTION_RTL = 5
HB_DIRECTION_TTB = 6
HB_DIRECTION_BTT = 7))
HB_DIRECTION_LTR = 4
HB_DIRECTION_RTL = 5
HB_DIRECTION_TTB = 6
HB_DIRECTION_BTT = 7))
(define hb-cluster-levels
'(HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES = 0
HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS = 1
HB_BUFFER_CLUSTER_LEVEL_CHARACTERS = 2))
(define (->tag bstr)
(integer-bytes->integer bstr #f #;(= unsigned) 'big-endian))
(define hb-script-values
`(HB_SCRIPT_COMMON = ,(->tag #"Zyyy")
HB_SCRIPT_INHERITED = ,(->tag #"Zinh")
HB_SCRIPT_UNKNOWN = ,(->tag #"Zzzz")
HB_SCRIPT_ARABIC = ,(->tag #"Arab")
HB_SCRIPT_ARMENIAN
HB_SCRIPT_BENGALI
HB_SCRIPT_CYRILLIC
HB_SCRIPT_DEVANAGARI
HB_SCRIPT_GEORGIAN
HB_SCRIPT_GREEK
HB_SCRIPT_GUJARATI
HB_SCRIPT_GURMUKHI
HB_SCRIPT_HANGUL
HB_SCRIPT_HAN
HB_SCRIPT_HEBREW
HB_SCRIPT_HIRAGANA
HB_SCRIPT_KANNADA
HB_SCRIPT_KATAKANA
HB_SCRIPT_LAO
HB_SCRIPT_LATIN = ,(->tag #"Latn")
HB_SCRIPT_MALAYALAM
HB_SCRIPT_ORIYA
HB_SCRIPT_TAMIL
HB_SCRIPT_TELUGU
HB_SCRIPT_THAI
HB_SCRIPT_TIBETAN
HB_SCRIPT_BOPOMOFO
HB_SCRIPT_BRAILLE
HB_SCRIPT_CANADIAN_SYLLABICS
HB_SCRIPT_CHEROKEE
HB_SCRIPT_ETHIOPIC
HB_SCRIPT_KHMER
HB_SC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6 +33,7 @@
(define (default-buffer-setup buf)
(hb_buffer_set_direction buf 'HB_DIRECTION_LTR)
(hb_buffer_set_script buf 'HB_SCRIPT_LATIN)
(hb_buffer_set_cluster_level buf 'HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS)
(hb_buffer_set_language buf (hb_language_from_string #"en"))
buf)
@ -55,6 +56,10 @@
(_int = text-length)
-> _void))
(define _hb_cluster_t (_enum hb-cluster-levels))
(define-harfbuzz hb_buffer_set_cluster_level (_fun _hb_buffer_t _hb_cluster_t -> _void))
(define-harfbuzz hb_buffer_get_cluster_level (_fun _hb_buffer_t -> _hb_cluster_t))
(define _hb_direction_t (_enum hb-direction-values))
(define-harfbuzz hb_buffer_set_direction (_fun _hb_buffer_t _hb_direction_t -> _void))
(define-harfbuzz hb_buffer_get_direction (_fun _hb_buffer_t -> _hb_direction_t))

Loading…
Cancel
Save