Text wrap in Makie?

Looking at documentation for Makie text there is a keyword for text wrapping: word_wrap_with::Real = -1. I need a bit of explanatory text in one panel but I cannot get the wrap to work. Any one has an idea how to fix that (M[not]WE below)? Also, can I change font of the text, i.e. times or Helvetica in addition to e.g. :regular?

	f=Figure()
	a1=Axis(f[1,1])
	xlims!(a1,(0,100))
	ylims!(a1,(0,100))
	hidedecorations!(a1)
	hidespines!(a1)
	text!(5,95,text="a whole lot of text,a whole lot of text,a whole lot of text,a whole lot of text,a whole lot of text,a whole lot of text,a whole lot of text,a whole lot of text,a whole lot of text,a whole lot of text,a whole lot of text,a whole lot of text,a whole lot of text,a whole lot of text,a whole lot of text,a whole lot of text",word_wrap_with=50, font=:regular, fontsize=20)
	a2=Axis(f[1,2])
	xlims!(a2,(0,100))
	ylims!(a2,(0,100))
	f

word_wrap_width with a “d”

And doesn’t font = "Helvetica" work?

To see how to change fonts across a whole Figure, check https://docs.makie.org/stable/documentation/fonts/#symbol

1 Like

Hah, I was wondering why it said word_wrap_with in the documentation :smiley: Thanks. And yes, font=“Helvetica” did work, since the example had font=:regular I tried font=:Helvetica… Many thanks!

Documentation misspelling here: text