Handbook
Glossary
combine-metrics ( graphics-height ascent descent cap-height -- ascent' descent' )
Vocabulary
ui
.
baseline-alignment
.
private
Inputs
graphics-height
an
object
ascent
an
object
descent
an
object
cap-height
an
object
Outputs
ascent'
an
object
descent'
an
object
Definition
USING:
kernel
math
math.functions
math.order
;
IN:
ui.baseline-alignment.private
::
combine-metrics
( graphics-height ascent descent cap-height -- ascent' descent' )
ascent
[
cap-height 0
or
2
/
:>
mid-line graphics-height 2
/
[
ascent mid-line
-
max
mid-line
+
floor
>integer
]
[
descent mid-line
+
max
mid-line
-
ceiling
>integer
]
bi
]
[
f
f
]
if
;