Chooses a proportional or a monospace typeface for the text inside a box.
font.family_monospace gives every character the same width, so columns of numbers line up; font.family_default is the regular face.
Only the text of that box changes. Size and color are separate settings.
Syntax
box.set_text_font_family(id: series box, text_font_family: series string) -> void
box.set_text_font_family(text_font_family: series string) -> voidArguments
| Name | Type | Default | Description |
|---|---|---|---|
| id | series box | required | The box whose text typeface changes. |
| text_font_family | series string | required | font.family_default (default) or font.family_monospace, which gives every character the same width. |
Returns
Nothing.
Remarks
- On Sidechair: typefaces are not applied yet, so a call reports a warning and the text keeps the default face.
Example
//@version=6
indicator("box.set_text_font_family: aligned digits", overlay = true)
if barstate.islast
z = box.new(bar_index - 10, high, bar_index, low, bgcolor = color.new(color.gray, 85), text = "H " + str.tostring(high, "#.00") + " L " + str.tostring(low, "#.00"), text_color = color.white)
box.set_text_font_family(z, font.family_monospace)See also
Not on Sidechair yet