Skia.Font (Skia v0.1.1)

Copy Markdown View Source

Sized font value built from a Skia.Typeface.

{:ok, typeface} = Skia.Typeface.match_family("Inter", weight: 700)
font = Skia.Font.new(typeface, size: 18)

Summary

Types

t()

@type t() :: %Skia.Font{size: float() | nil, typeface: Skia.Typeface.t() | nil}

Functions

glyph_ids(font, text)

@spec glyph_ids(t(), String.t()) :: {:ok, [non_neg_integer()]} | {:error, atom()}

metrics(font)

@spec metrics(t()) :: {:ok, map()} | {:error, atom()}

new(typeface \\ nil, opts \\ [])

@spec new(
  Skia.Typeface.t() | nil,
  keyword()
) :: t()