Handbook
Glossary
set-style ( canvas style -- canvas )
Vocabulary
pdf
.
canvas
Inputs
canvas
an
object
style
an
object
Outputs
canvas
an
object
Definition
USING:
accessors
assocs
colors
combinators
io.styles
kernel
math.order
sequences
ui.text
;
IN:
pdf.canvas
:
set-style
( canvas style -- canvas )
{
[
font-name
of
"sans-serif"
or
{
{
"sans-serif"
[
"Helvetica"
]
}
{
"serif"
[
"Times"
]
}
{
"monospace"
[
"Courier"
]
}
[
" is unsupported"
append
throw
]
}
case
[
dup
font>>
]
dip
>>name
drop
]
[
font-size
of
12
or
[
dup
font>>
]
dip
>>size
drop
]
[
font-style
of
[
dup
font>>
]
dip
{
{
bold
[
t
f
]
}
{
italic
[
f
t
]
}
{
bold-italic
[
t
t
]
}
[
drop
f
f
]
}
case
[
>>bold?
]
[
>>italic?
]
bi*
drop
]
[
foreground
of
COLOR:
black
or
>>foreground
]
[
background
of
f
or
>>background
]
[
page-color
of
f
or
>>page-color
]
[
inset
of
{
0 0
}
or
>>inset
]
}
cleave
dup
font>>
font-metrics
[
>>metrics
]
[
height>>
[
max
]
curry
change-line-height
]
bi
;