add font-underline attribute (fixes #57)

main
Matthew Butterick 4 years ago
parent 29902c3ee3
commit c41b2e1b2d

@ -679,6 +679,10 @@ Whether the quad has bold styling applied. Activated only when value is @racket[
Whether the quad has italic styling applied. Activated only when value is @racket["true"].
}
@defthing[#:kind "attribute" font-underline symbol?]{
Whether the quad has an underline applied. Activated only when value is @racket["true"].
}
@defthing[#:kind "attribute" font-features symbol?]{
Sets OpenType layout features. @racket[font-features] takes a @deftech{feature string}, which is an alternating list of OT feature tags and values, separated by white space. For instance, @racket{liga 0 smcp 1} would deactivate the ligature feature and activate the small-cap feature. If the feature string is prefixed with @racket["+"], rather than replacing the current feature settings, it amends the features that would otherwise apply.

@ -75,6 +75,7 @@ Naming guidelines
font-features-adjust
font-italic
font-bold
font-underline
font-tracking
font-baseline-shift
font-case

@ -76,6 +76,7 @@
;; whereas PDF drawing only puts tracking between the glyphs.
(text doc str (+ x (/ tracking 2.0)) (- y (quad-ref q :font-baseline-shift 0))
#:tracking tracking
#:underline (quad-ref q :font-underline)
#:bg (quad-ref q :bg)
#:features (quad-ref q :font-features default-font-features)
#:link (quad-ref q :link))]))

Loading…
Cancel
Save