textDescent()
Typography / MetricsDescription
Returns the descent of the current font at its current size. The descent is the distance below the baseline.
Syntax
float textDescent()
Parameters
None
Returns
floatRelated
Under the Hood
From Processing.h:
float textDescent();
Under the Hood
From Processing.cpp:
float PApplet::textDescent() {
#if PROCESSING_HAS_STB_TRUETYPE
if (g_ttf.loaded) {
float sc = stbtt_ScaleForMappingEmToPixels(&g_ttf.info, g_textSize);
int desc; stbtt_GetFontVMetrics(&g_ttf.info, nullptr, &desc, nullptr);
return std::fabs(desc * sc);
}
#endif
int sc = std::max(1,(int)(g_textSize/8.0f));
return 2.0f * sc;
}