Sidechair

box.set_text_formatting()

Browse the reference

Makes the text inside a box bold, italic, both or plain.

Try it in the editor

Use text.format_bold, text.format_italic or text.format_none, or join bold and italic with +. The setting covers the whole string of the box.

Color and size are controlled separately.

Syntax

Pine Script
box.set_text_formatting(id: series box, text_formatting: series text_format) -> void
box.set_text_formatting(text_formatting: series text_format) -> void

Arguments

NameTypeDefaultDescription
idseries boxrequiredThe box whose text formatting changes.
text_formattingseries text_formatrequiredtext.format_none (default), text.format_bold or text.format_italic; join bold and italic with +.

Returns

Nothing.

Remarks

  • On Sidechair: formatting is not applied yet, so a call reports a warning and the text stays plain.

Example

Pine ScriptBold italic zone nameOpen in editor
//@version=6
indicator("box.set_text_formatting: bold italic", overlay = true)
if barstate.islast
    z = box.new(bar_index - 10, high, bar_index, low, bgcolor = color.new(color.red, 88), text = "Supply", text_color = color.red)
    box.set_text_formatting(z, text.format_bold + text.format_italic)

See also

Not on Sidechair yet