PtextAscent
processing
Returns ascent of the current font at its current size. This information is useful for determining the height of the font above the baseline. For example, adding the PtextAscent
and PtextDescent
values will give you the total height of the line.
Link to original Processing doc
PtextAscent is available since version 1.0.0.
See also
Signatures
Examples
// @preview image
120 200 '2D' PGraphics
255 Pbackground //white
0xff0000ff Pstroke //blue
0xffff0000 Pfill //red
20 PtextSize //change this, text should be aligned to line
50 'y' STORE
0.8 'scalar' STORE
PtextAscent $scalar * 'a' STORE
0 $y $a - 120 $y $a - Pline
'Warp 10' 10 $y Ptext //coordinates = bottom left
32 PtextSize //change this, text should be aligned to line
150 'y' STORE
0.8 'scalar' STORE
PtextAscent $scalar * 'a' STORE
0 $y $a - 120 $y $a - Pline
'NCC' 10 $y Ptext //coordinates = bottom left
Pencode