Refactor documentation of pen%, font%, brush%

This commit is contained in:
Asumu Takikawa 2013-02-14 18:18:20 -05:00
parent bf4e69fea9
commit 471a1e1ee6
3 changed files with 27 additions and 67 deletions

View File

@ -92,12 +92,7 @@ See also @racket[make-brush].
@defconstructor[([color (or/c string? (is-a?/c color%)) "black"] @defconstructor[([color (or/c string? (is-a?/c color%)) "black"]
[style (or/c 'transparent 'solid 'opaque [style brush-style/c 'solid]
'xor 'hilite 'panel
'bdiagonal-hatch 'crossdiag-hatch
'fdiagonal-hatch 'cross-hatch
'horizontal-hatch 'vertical-hatch)
'solid]
[stipple (or/c #f (is-a?/c bitmap%)) [stipple (or/c #f (is-a?/c bitmap%))
#f] #f]
[gradient (or/c #f [gradient (or/c #f
@ -144,11 +139,7 @@ Gets the @tech{brush stipple} bitmap, or @racket[#f] if the brush has no stipple
@defmethod[(get-style) @defmethod[(get-style)
(or/c 'transparent 'solid 'opaque brush-style/c]{
'xor 'hilite 'panel
'bdiagonal-hatch 'crossdiag-hatch
'fdiagonal-hatch 'cross-hatch
'horizontal-hatch 'vertical-hatch)]{
Returns the @tech{brush style}. See @racket[brush%] for information about Returns the @tech{brush style}. See @racket[brush%] for information about
brush styles.} brush styles.}
@ -208,11 +199,7 @@ If @racket[bitmap] is modified while is associated with a brush, the
} }
@defmethod[(set-style [style (or/c 'transparent 'solid 'opaque @defmethod[(set-style [style brush-style/c])
'xor 'hilite 'panel
'bdiagonal-hatch 'crossdiag-hatch
'fdiagonal-hatch 'cross-hatch
'horizontal-hatch 'vertical-hatch)])
void?]{ void?]{
Sets the @tech{brush style}. See Sets the @tech{brush style}. See

View File

@ -98,28 +98,22 @@ See also
@defconstructor*/make[(() @defconstructor*/make[(()
([size (integer-in 1 1024)] ([size (integer-in 1 1024)]
[family (or/c 'default 'decorative 'roman 'script [family font-family/c]
'swiss 'modern 'symbol 'system)] [style font-style/c 'normal]
[style (or/c 'normal 'italic 'slant) 'normal] [weight font-weight/c 'normal]
[weight (or/c 'normal 'bold 'light) 'normal]
[underline? any/c #f] [underline? any/c #f]
[smoothing (or/c 'default 'partly-smoothed [smoothing font-smoothing/c 'default]
'smoothed 'unsmoothed)
'default]
[size-in-pixels? any/c #f] [size-in-pixels? any/c #f]
[hinting (or/c 'aligned 'unaligned) 'aligned]) [hinting font-hinting/c 'aligned])
([size (integer-in 1 1024)] ([size (integer-in 1 1024)]
[face string?] [face string?]
[family (or/c 'default 'decorative 'roman 'script [family font-family/c]
'swiss 'modern 'symbol 'system)] [style font-style/c 'normal]
[style (or/c 'normal 'italic 'slant) 'normal] [weight font-weight/c 'normal]
[weight (or/c 'normal 'bold 'light) 'normal]
[underline? any/c #f] [underline? any/c #f]
[smoothing (or/c 'default 'partly-smoothed [smoothing font-smoothing/c 'default]
'smoothed 'unsmoothed)
'default]
[size-in-pixels? any/c #f] [size-in-pixels? any/c #f]
[hinting (or/c 'aligned 'unaligned) 'aligned]))]{ [hinting font-hinting/c 'aligned]))]{
When no arguments are provided, creates an instance of the default When no arguments are provided, creates an instance of the default
font. If no face name is provided, the font is created without a face font. If no face name is provided, the font is created without a face
@ -141,9 +135,7 @@ Gets the font's face name, or @racket[#f] if none is specified.
} }
@defmethod[(get-family) @defmethod[(get-family) font-family/c]{
(or/c 'default 'decorative 'roman 'script
'swiss 'modern 'symbol 'system)]{
Gets the font's family. See @racket[font%] for information about Gets the font's family. See @racket[font%] for information about
families. families.
@ -159,8 +151,7 @@ face and family specifications, only.
} }
@defmethod[(get-hinting) @defmethod[(get-hinting) font-hinting/c]{
(or/c 'aligned 'unaligned)]{
Gets the font's hinting. See @racket[font%] for information about Gets the font's hinting. See @racket[font%] for information about
hinting. hinting.
@ -191,16 +182,14 @@ For a size in points and a screen or bitmap drawing context, the
} }
@defmethod[(get-smoothing) @defmethod[(get-smoothing) font-smoothing/c]{
(or/c 'default 'partly-smoothed 'smoothed 'unsmoothed)]{
Gets the font's anti-alias smoothing mode. See @racket[font%] for Gets the font's anti-alias smoothing mode. See @racket[font%] for
information about smoothing. information about smoothing.
} }
@defmethod[(get-style) @defmethod[(get-style) font-style/c]{
(or/c 'normal 'italic 'slant)]{
Gets the font's slant style. See @racket[font%] for information about Gets the font's slant style. See @racket[font%] for information about
styles. styles.
@ -215,8 +204,7 @@ otherwise.
} }
@defmethod[(get-weight) @defmethod[(get-weight) font-weight/c]{
(or/c 'normal 'bold 'light)]{
Gets the font's weight. See @racket[font%] for information about Gets the font's weight. See @racket[font%] for information about
weights. weights.

View File

@ -70,15 +70,9 @@ See also @racket[make-pen].
@defconstructor[([color (or/c string? (is-a?/c color%)) "black"] @defconstructor[([color (or/c string? (is-a?/c color%)) "black"]
[width (real-in 0 255) 0] [width (real-in 0 255) 0]
[style (or/c 'transparent 'solid 'xor 'hilite [style pen-style/c 'solid]
'dot 'long-dash 'short-dash 'dot-dash [cap pen-cap-style/c 'round]
'xor-dot 'xor-long-dash 'xor-short-dash [join pen-join-style/c 'round]
'xor-dot-dash)
'solid]
[cap (or/c 'round 'projecting 'butt)
'round]
[join (or/c 'round 'bevel 'miter)
'round]
[stipple (or/c #f (is-a?/c bitmap%)) [stipple (or/c #f (is-a?/c bitmap%))
#f])]{ #f])]{
@ -89,8 +83,7 @@ Creates a pen with the given color, width, @tech{pen style}, @tech{cap style}, @
} }
@defmethod[(get-cap) @defmethod[(get-cap) pen-cap-style/c]{
(or/c 'round 'projecting 'butt)]{
Returns the pen @deftech{cap style}, which determines the shape of a line at Returns the pen @deftech{cap style}, which determines the shape of a line at
each of its ending points when drawn by @method[dc<%> draw-line] or at the each of its ending points when drawn by @method[dc<%> draw-line] or at the
@ -139,8 +132,7 @@ Returns the pen's color object.
} }
@defmethod[(get-join) @defmethod[(get-join) pen-join-style/c]{
(or/c 'round 'bevel 'miter)]{
Returns the pen @deftech{join style} that is used between multiple lines Returns the pen @deftech{join style} that is used between multiple lines
connected through @method[dc<%> draw-lines], @method[dc<%> connected through @method[dc<%> draw-lines], @method[dc<%>
@ -204,11 +196,7 @@ Gets the current @tech{pen stipple} bitmap, or returns @racket[#f] if no stipple
} }
@defmethod[(get-style) @defmethod[(get-style) pen-style/c]{
(or/c 'transparent 'solid 'xor 'hilite
'dot 'long-dash 'short-dash 'dot-dash
'xor-dot 'xor-long-dash 'xor-short-dash
'xor-dot-dash)]{
Returns the @tech{pen style}. See @racket[pen%] for information about Returns the @tech{pen style}. See @racket[pen%] for information about
possible styles. possible styles.
@ -229,7 +217,7 @@ Returns @racket[#t] if the pen object is immutable.
} }
@defmethod[(set-cap [cap-style (or/c 'round 'projecting 'butt)]) @defmethod[(set-cap [cap-style pen-cap-style/c])
void?]{ void?]{
Sets the pen @tech{cap style}. See @method[pen% get-cap] for information about cap Sets the pen @tech{cap style}. See @method[pen% get-cap] for information about cap
@ -254,7 +242,7 @@ A pen cannot be modified if it was obtained from a
} }
@defmethod[(set-join [join-style (or/c 'round 'bevel 'miter)]) @defmethod[(set-join [join-style pen-join-style/c])
void?]{ void?]{
Sets the pen @tech{join style}. See @method[pen% get-join] for information about join Sets the pen @tech{join style}. See @method[pen% get-join] for information about join
@ -277,10 +265,7 @@ If @racket[bitmap] is modified while is associated with a pen, the
} }
@defmethod[(set-style [style (or/c 'transparent 'solid 'xor 'hilite @defmethod[(set-style [style pen-style/c])
'dot 'long-dash 'short-dash 'dot-dash
'xor-dot 'xor-long-dash 'xor-short-dash
'xor-dot-dash)])
void?]{ void?]{
Sets the @tech{pen style}. See @racket[pen%] for information about the Sets the @tech{pen style}. See @racket[pen%] for information about the