Typeface families for drawn text: font.family_default and font.family_monospace.
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
| Name | Value | Description |
|---|---|---|
font.family_default | The chart's default typeface. | |
font.family_monospace | A 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
//@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