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"]
[style (or/c 'transparent 'solid 'opaque
'xor 'hilite 'panel
'bdiagonal-hatch 'crossdiag-hatch
'fdiagonal-hatch 'cross-hatch
'horizontal-hatch 'vertical-hatch)
'solid]
[style brush-style/c 'solid]
[stipple (or/c #f (is-a?/c bitmap%))
#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)
(or/c 'transparent 'solid 'opaque
'xor 'hilite 'panel
'bdiagonal-hatch 'crossdiag-hatch
'fdiagonal-hatch 'cross-hatch
'horizontal-hatch 'vertical-hatch)]{
brush-style/c]{
Returns the @tech{brush style}. See @racket[brush%] for information about
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
'xor 'hilite 'panel
'bdiagonal-hatch 'crossdiag-hatch
'fdiagonal-hatch 'cross-hatch
'horizontal-hatch 'vertical-hatch)])
@defmethod[(set-style [style brush-style/c])
void?]{
Sets the @tech{brush style}. See

View File

@ -98,28 +98,22 @@ See also
@defconstructor*/make[(()
([size (integer-in 1 1024)]
[family (or/c 'default 'decorative 'roman 'script
'swiss 'modern 'symbol 'system)]
[style (or/c 'normal 'italic 'slant) 'normal]
[weight (or/c 'normal 'bold 'light) 'normal]
[family font-family/c]
[style font-style/c 'normal]
[weight font-weight/c 'normal]
[underline? any/c #f]
[smoothing (or/c 'default 'partly-smoothed
'smoothed 'unsmoothed)
'default]
[smoothing font-smoothing/c 'default]
[size-in-pixels? any/c #f]
[hinting (or/c 'aligned 'unaligned) 'aligned])
[hinting font-hinting/c 'aligned])
([size (integer-in 1 1024)]
[face string?]
[family (or/c 'default 'decorative 'roman 'script
'swiss 'modern 'symbol 'system)]
[style (or/c 'normal 'italic 'slant) 'normal]
[weight (or/c 'normal 'bold 'light) 'normal]
[family font-family/c]
[style font-style/c 'normal]
[weight font-weight/c 'normal]
[underline? any/c #f]
[smoothing (or/c 'default 'partly-smoothed
'smoothed 'unsmoothed)
'default]
[smoothing font-smoothing/c 'default]
[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
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)
(or/c 'default 'decorative 'roman 'script
'swiss 'modern 'symbol 'system)]{
@defmethod[(get-family) font-family/c]{
Gets the font's family. See @racket[font%] for information about
families.
@ -159,8 +151,7 @@ face and family specifications, only.
}
@defmethod[(get-hinting)
(or/c 'aligned 'unaligned)]{
@defmethod[(get-hinting) font-hinting/c]{
Gets the font's hinting. See @racket[font%] for information about
hinting.
@ -191,16 +182,14 @@ For a size in points and a screen or bitmap drawing context, the
}
@defmethod[(get-smoothing)
(or/c 'default 'partly-smoothed 'smoothed 'unsmoothed)]{
@defmethod[(get-smoothing) font-smoothing/c]{
Gets the font's anti-alias smoothing mode. See @racket[font%] for
information about smoothing.
}
@defmethod[(get-style)
(or/c 'normal 'italic 'slant)]{
@defmethod[(get-style) font-style/c]{
Gets the font's slant style. See @racket[font%] for information about
styles.
@ -215,8 +204,7 @@ otherwise.
}
@defmethod[(get-weight)
(or/c 'normal 'bold 'light)]{
@defmethod[(get-weight) font-weight/c]{
Gets the font's weight. See @racket[font%] for information about
weights.

View File

@ -70,15 +70,9 @@ See also @racket[make-pen].
@defconstructor[([color (or/c string? (is-a?/c color%)) "black"]
[width (real-in 0 255) 0]
[style (or/c 'transparent 'solid 'xor 'hilite
'dot 'long-dash 'short-dash 'dot-dash
'xor-dot 'xor-long-dash 'xor-short-dash
'xor-dot-dash)
'solid]
[cap (or/c 'round 'projecting 'butt)
'round]
[join (or/c 'round 'bevel 'miter)
'round]
[style pen-style/c 'solid]
[cap pen-cap-style/c 'round]
[join pen-join-style/c 'round]
[stipple (or/c #f (is-a?/c bitmap%))
#f])]{
@ -89,8 +83,7 @@ Creates a pen with the given color, width, @tech{pen style}, @tech{cap style}, @
}
@defmethod[(get-cap)
(or/c 'round 'projecting 'butt)]{
@defmethod[(get-cap) pen-cap-style/c]{
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
@ -139,8 +132,7 @@ Returns the pen's color object.
}
@defmethod[(get-join)
(or/c 'round 'bevel 'miter)]{
@defmethod[(get-join) pen-join-style/c]{
Returns the pen @deftech{join style} that is used between multiple lines
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)
(or/c 'transparent 'solid 'xor 'hilite
'dot 'long-dash 'short-dash 'dot-dash
'xor-dot 'xor-long-dash 'xor-short-dash
'xor-dot-dash)]{
@defmethod[(get-style) pen-style/c]{
Returns the @tech{pen style}. See @racket[pen%] for information about
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?]{
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?]{
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
'dot 'long-dash 'short-dash 'dot-dash
'xor-dot 'xor-long-dash 'xor-short-dash
'xor-dot-dash)])
@defmethod[(set-style [style pen-style/c])
void?]{
Sets the @tech{pen style}. See @racket[pen%] for information about the