|
superclass: object% |
changing the font family
changing the font face
changing the font size to a new value
enlarging the font by an additive amount
enlarging the font by a multiplicative amount, etc.
changing the font style (normal, italic, or slant)
toggling the font style
changing the font to italic if it is currently slant, etc.
changing the font weight, etc.
changing the underline, etc.
changing the vertical alignment, etc.
changing the foreground color
dimming or brightening the foreground color, etc.
changing the background color, etc.
changing text backing transparency
The set-delta method is convenient for most style delta settings; it takes a high-level delta specification and sets the internal delta information.
To take full advantage of a style delta, it is necessary to understand the internal on/off settings that can be manipulated through methods such as set-weight-on. For example, the font weight change is specified through the weight-on and weight-off internal settings. Roughly, weight-on turns on a weight setting when it is not present and weight-off turns off a weight setting when it is present. These two interact precisely in the following way:
If both weight-on and weight-off are set to 'base, then the font weight is not changed.
If weight-on is not 'base, then the weight is set to weight-on.
If weight-off is not 'base, then the weight will be set back to 'normal when the base style has the weight weight-off.
If both weight-on and weight-off are set to the same value, then the weight is toggled with respect to that value: if the base style has the weight weight-on, then weight is changed to 'normal; if the base style has a different weight, it is changed to weight-on.
If both weight-on and weight-off are set, but to different values, then the weight is changed to weight-on only when the base style has the weight weight-off.
Font styles, smoothing, underlining, and alignment work in an analogous manner.
#f (acts like 'base)
#t
#f (acts like 'base)
#t
#f (acts like 'base)
#t
The family and face settings in a style delta are interdependent:
When a delta’s face is #f and its family is 'base, then neither the face nor family are modified by the delta.
When a delta’s face is a string and its family is 'base, then only face is modified by the delta.
When a delta’s family is not 'base, then both the face and family are modified by the delta. If the delta’s face is #f, then applying the delta sets a style’s face to #f, so that the family setting prevails in choosing a font.
constructor
(make-object style-delta% [change-command])
→ (is-a?/c style-delta%)
change-command :
(or/c 'change-nothing 'change-normal 'change-toggle-underline 'change-toggle-size-in-pixels 'change-normal-color 'change-bold) = 'change-nothing (make-object style-delta% change-command v) → (is-a?/c style-delta%)
change-command :
(or/c 'change-family 'change-style 'change-toggle-style 'change-weight 'change-toggle-weight 'change-smoothing 'change-toggle-smoothing 'change-alignment) v : symbol (make-object style-delta% change-command v) → (is-a?/c style-delta%)
change-command :
(or/c 'change-size 'change-bigger 'change-smaller) v : byte? (make-object style-delta% change-command v) → (is-a?/c style-delta%)
change-command :
(or/c 'change-underline 'change-size-in-pixels) v : any/c
method
delta : (is-a?/c style-delta%)
method
delta : (is-a?/c style-delta%)
method
delta : (is-a?/c style-delta%)
method
(send a-style-delta get-alignment-off)
→ (or/c 'base 'top 'center 'bottom)
method
(send a-style-delta get-alignment-on)
→ (or/c 'base 'top 'center 'bottom)
method
(send a-style-delta get-background-add)
→ (is-a?/c add-color<%>)
method
(send a-style-delta get-background-mult)
→ (is-a?/c mult-color<%>)
See also get-family.
method
(send a-style-delta get-family)
→
(or/c 'base 'default 'decorative 'roman 'script 'swiss 'modern 'symbol 'system)
See also get-face.
method
(send a-style-delta get-foreground-add)
→ (is-a?/c add-color<%>)
method
(send a-style-delta get-foreground-mult)
→ (is-a?/c mult-color<%>)
method
(send a-style-delta get-size-add) → byte?
method
(send a-style-delta get-size-in-pixels-off) → boolean?
method
(send a-style-delta get-size-in-pixels-on) → boolean?
method
(send a-style-delta get-size-mult) → real?
method
(send a-style-delta get-smoothing-off)
→ (or/c 'base 'default 'partly-smoothed 'smoothed 'unsmoothed)
method
(send a-style-delta get-smoothing-on)
→ (or/c 'base 'default 'partly-smoothed 'smoothed 'unsmoothed)
method
(send a-style-delta get-style-off)
→ (or/c 'base 'normal 'italic 'slant)
method
(send a-style-delta get-style-on)
→ (or/c 'base 'normal 'italic 'slant)
method
(send a-style-delta get-transparent-text-backing-off)
→ boolean?
method
(send a-style-delta get-transparent-text-backing-on)
→ boolean?
method
(send a-style-delta get-underlined-off) → boolean?
method
(send a-style-delta get-underlined-on) → boolean?
method
(send a-style-delta get-weight-off)
→ (or/c 'base 'normal 'bold 'light)
method
(send a-style-delta get-weight-on)
→ (or/c 'base 'normal 'bold 'light)
method
(send a-style-delta set-alignment-off v) → void?
v : (or/c 'base 'top 'center 'bottom)
method
(send a-style-delta set-alignment-on v) → void?
v : (or/c 'base 'top 'center 'bottom)
method
→ (is-a?/c style-delta%)
change-command :
(or/c 'change-nothing 'change-normal 'change-toggle-underline 'change-toggle-size-in-pixels 'change-normal-color 'change-bold) = 'change-nothing
(send a-style-delta set-delta change-command param) → (is-a?/c style-delta%)
change-command :
(or/c 'change-family 'change-style 'change-toggle-style 'change-weight 'change-toggle-weight 'change-smoothing 'change-toggle-smoothing 'change-alignment) param : symbol?
(send a-style-delta set-delta change-command param) → (is-a?/c style-delta%)
change-command :
(or/c 'change-size 'change-bigger 'change-smaller) param : byte?
(send a-style-delta set-delta change-command on?) → (is-a?/c style-delta%)
change-command :
(or/c 'change-underline 'change-size-in-pixels) on? : any/c
Except for 'change-nothing and 'change-normal, the command only changes part of the delta. Thus, applying 'change-bold and then 'change-italic sets the delta for both the style and weight change.
'change-nothing —
reset all changes 'change-normal —
turn off all styles and resizings 'change-toggle-underline —
underline regions that are currently not underlined, and vice versa 'change-toggle-size-in-pixels —
interpret sizes in pixels for regions that are currently interpreted in points, and vice versa 'change-normal-color —
change the foreground and background to black and white, respectively 'change-italic —
change the style of the font to italic 'change-bold —
change the weight of the font to bold 'change-family —
change the font family (param is a family; see font%); see also get-family 'change-style —
change the style of the font (param is a style; see font%) 'change-toggle-style —
toggle the style of the font (param is a style; see font%) 'change-weight —
change the weight of the font (param is a weight; see font%) 'change-toggle-weight —
toggle the weight of the font (param is a weight; see font%) 'change-smoothing —
change the smoothing of the font (param is a smoothing; see font%) 'change-toggle-smoothing —
toggle the smoothing of the font (param is a smoothing; see font%) 'change-alignment —
change the alignment (param is an alignment; see style-delta%) 'change-size —
change the size to an absolute value (param is a size) 'change-bigger —
make the text larger (param is an additive amount) 'change-smaller —
make the text smaller (param is an additive amount) 'change-underline —
set the underline status to either underlined or plain 'change-size-in-pixels —
set the size interpretation to pixels or points
method
(send a-style-delta set-delta-background name)
→ (is-a?/c style-delta%) name : string? (send a-style-delta set-delta-background color) → (is-a?/c style-delta%) color : (is-a?/c color%)
For the case that a string color name is supplied, see color-database<%>.
method
(send a-style-delta set-delta-face name [ family]) → (is-a?/c style-delta%) name : string?
family :
(or/c 'base 'default 'decorative 'roman 'script 'swiss 'modern 'symbol 'system) = 'default
The return value is a-style-delta.
method
(send a-style-delta set-delta-foreground name)
→ (is-a?/c style-delta%) name : string? (send a-style-delta set-delta-foreground color) → (is-a?/c style-delta%) color : (is-a?/c color%)
For the case that a string color name is supplied, see color-database<%>.
method
(send a-style-delta set-family v) → void?
v :
(or/c 'base 'default 'decorative 'roman 'script 'swiss 'modern 'symbol 'system)
method
(send a-style-delta set-size-add v) → void?
v : byte?
method
(send a-style-delta set-size-in-pixels-off v) → void?
v : any/c
method
(send a-style-delta set-size-in-pixels-on v) → void?
v : any/c
method
(send a-style-delta set-size-mult v) → void?
v : real?
method
(send a-style-delta set-smoothing-off v) → void?
v :
(or/c 'base 'default 'partly-smoothed 'smoothed 'unsmoothed)
method
(send a-style-delta set-smoothing-on v) → void?
v :
(or/c 'base 'default 'partly-smoothed 'smoothed 'unsmoothed)
method
(send a-style-delta set-style-off v) → void?
v : (or/c 'base 'normal 'italic 'slant)
method
(send a-style-delta set-style-on v) → void?
v : (or/c 'base 'normal 'italic 'slant)
method
(send a-style-delta set-transparent-text-backing-off v) → void?
v : any/c
method
(send a-style-delta set-transparent-text-backing-on v) → void?
v : any/c
method
(send a-style-delta set-underlined-off v) → void?
v : any/c
method
(send a-style-delta set-underlined-on v) → void?
v : any/c
method
(send a-style-delta set-weight-off v) → void?
v : (or/c 'base 'normal 'bold 'light)
method
(send a-style-delta set-weight-on v) → void?
v : (or/c 'base 'normal 'bold 'light)