Handbook
Glossary
align-baselines ( gadgets -- ys )
Vocabulary
ui
.
baseline-alignment
Inputs
gadgets
an
object
Outputs
ys
an
object
Definition
USING:
accessors
kernel
math
math.order
sequences
ui.baseline-alignment.private
ui.gadgets
;
IN:
ui.baseline-alignment
::
align-baselines
( gadgets -- ys )
gadgets
[
dup
pref-dim
<gadget-metrics>
]
map
dup
max-ascent
0
or
:>
max-ascent
dup
max-cap-height
0
or
:>
max-cap-height
dup
max-graphics-height
:>
max-graphics-height max-cap-height max-graphics-height
+
2
/i
:>
critical-line critical-line max-ascent
[-]
:>
text-leading max-ascent critical-line
[-]
:>
graphics-leading
[
dup
ascent>>
[
ascent>>
max-ascent
swap
-
text-leading
]
[
height>>
max-graphics-height
swap
-
2
/i
graphics-leading
]
if
+
]
map
;