View Source Scenic.Primitive.Style.LineHeight (Scenic v0.11.2)

Adjust the vertical spacing of lines of text in a single block.

data-format

Data Format

This is expressed as a percentage of the size of the font. So a value of 1.2 would mean 120% the font size as the spacing from baseline to baseline.

The behavior of this style is intended to be very similar to the line_height CSS style.

Example:

graph
  |> text( "Some Text\r\nMore Text", line_height: 1.1 )

The default if :line_height is not specified is 1.2. Set this style if you want to override it.

note

Note

This style is not actually represented in the low-level Scenic.Script format. Instead it is a hint that is processed when a graph is "compiled" into a script. Essentially it instructs the graph compiler to automatically apply transforms to each line in a multi-line text string that separate out the lines of text from each other.