Sidechair

font.* constants

Browse the reference

Typeface families for drawn text: font.family_default and font.family_monospace.

Try it in the editor

font.family_* constants go in the text_font_family argument of label.new, box.new, table.cell and their set_ functions. font.family_default uses the chart's regular typeface. font.family_monospace uses a fixed-width one, which keeps columns of numbers lined up in tables and labels.

Constants

NameValueDescription
font.family_defaultThe chart's default typeface.
font.family_monospaceA fixed-width typeface.

Remarks

  • Monospace is the practical choice for anything you align with spaces, such as a column of prices in a label.

Example

Pine ScriptMonospace labelOpen in editor
//@version=6
indicator("Fonts", overlay = true)
if barstate.islast
    label.new(bar_index, high, "O " + str.tostring(open, "#.00") + "\nC " + str.tostring(close, "#.00"), text_font_family = font.family_monospace, style = label.style_label_down)
plot(close, "Close", color.gray)

See also

Runs on Sidechair