On this page:
Font
Font.kind
Font.name
Font.size
Font.in_  pixels
Font.style
Font.weight
Font.has_  underline
Font.smoothing
Font.hinting
Font.features
Font.Kind
Font.Kind.default
Font.Kind.decorative
Font.Kind.roman
Font.Kind.script
Font.Kind.swiss
Font.Kind.modern
Font.Kind.symbol
Font.Kind.system
Font.Style
Font.Style.normal
Font.Style.slant
Font.Style.italic
Font.Weight
Font.Weight.thin
Font.Weight.ultralight
Font.Weight.light
Font.Weight.semilight
Font.Weight.book
Font.Weight.normal
Font.Weight.medium
Font.Weight.semibold
Font.Weight.bold
Font.Weight.ultrabold
Font.Weight.heavy
Font.Weight.ultraheavy
Font.Smoothing
Font.Smoothing.default
Font.Smoothing.partly_  smoothed
Font.Smoothing.smoothed
Font.Smoothing.unsmoothed
Font.Hinting
Font.Hinting.aligned
Font.Hinting.unaligned
8.13.0.9

5 Font🔗ℹ

class

class Font():

  constructor (

    ~kind: kind :: Font.Kind = #'default,

    ~name: name :: maybe(String) = #false,

    ~size: size :: Real.in(0.0, 1024.0) = 12.0,

    ~in_pixels: in_pixels :: Any = #false,

    ~style: style :: Font.Style = #'normal,

    ~weight: weight :: Font.Weight = #'normal,

    ~has_underline: has_underline :: Any = #false,

    ~smoothing: smoothing :: Font.Smoothing = #'default,

    ~hinting: hinting :: Font.Hinting = #'aligned,

    ~features:

      features :: Map.of(Font.FeatureString, NonnegInt) = {},

  )

Creates a font configuration.

A font like an existing one can be constructed using with and the field names kind, name, size, in_pixels, style, weight, has_underline, smoothing, hinting, and features.

property

property (font :: Font).kind :: Font.Kind

 

property

property (font :: Font).name :: maybe(String)

 

property

property (font :: Font).size :: Real.in(0.0, 1024.0)

 

property

property (font :: Font).in_pixels :: Boolean

 

property

property (font :: Font).style :: Font.Style

 

property

property (font :: Font).weight :: Font.Weight

 

property

property (font :: Font).has_underline :: Boolean

 

property

property (font :: Font).smoothing :: Font.Smoothing

 

property

property (font :: Font).hinting :: Font.Hinting

 

property

property (font :: Font).features

  :: Map.of(Font.FeatureString, NonnegInt)

Propeties to access font components.

enumeration

enum Font.Kind:

  default

  decorative

  roman

  script

  swiss

  modern

  symbol

  system

A font kind.

enumeration

enum Font.Style:

  normal

  slant

  italic

A font style.

enumeration

enum Font.Weight:

  ~is_a Int.in(100, 1000 ~inclusive)

  thin

  ultralight

  light

  semilight

  book

  normal

  medium

  semibold

  bold

  ultrabold

  heavy

  ultraheavy

A font weight, either an integer in 100 to 1000 (inclusive) or one of the following symbols:

A font smoothing (anti-aliasing) mode.

enumeration

enum Font.Hinting:

  aligned

  unaligned

A font hinting (to adjust anti-aliasing) mode.