GPUI.Text.StyleRun (gpui v0.2.0-rc.1)

Copy Markdown View Source

A neutral shaping style applied to a logical text range.

Style runs carry presentation facts only. They do not identify syntax, diagnostics, languages, or semantic-token kinds. Positions remain zero-based UTF-16 document coordinates and the native text surface converts them to shaping ranges without changing buffer contents or history.

Summary

Types

font_style()

@type font_style() :: :normal | :italic | :oblique

font_weight()

@type font_weight() ::
  :thin
  | :extra_light
  | :light
  | :normal
  | :medium
  | :semibold
  | :bold
  | :extra_bold
  | :black

rgb()

@type rgb() :: 0..16_777_215

t()

@type t() :: %GPUI.Text.StyleRun{
  color: rgb() | nil,
  font_style: font_style() | nil,
  font_weight: font_weight() | nil,
  range: GPUI.Text.Range.t()
}

Functions

new(range, opts \\ [])

@spec new(
  GPUI.Text.Range.t(),
  keyword()
) :: t()