gioui.orggioui.org/font Index | Files | Directories

package font

import "gioui.org/font"

Package font provides type describing font faces attributes.

Index

Types

type Face

type Face interface {
	Face() font.Face
}

Face is an opaque handle to a typeface. The concrete implementation depends upon the kind of font and shaper in use.

type Font

type Font struct {
	Typeface Typeface
	Variant  Variant
	Style    Style
	// Weight is the text weight. If zero, Normal is used instead.
	Weight Weight
}

Font specify a particular typeface variant, style and weight.

type FontFace

type FontFace struct {
	Font Font
	Face Face
}

A FontFace is a Font and a matching Face.

type Style

type Style int

Style is the font style.

const (
	Regular Style = iota
	Italic
)

func (Style) String

func (s Style) String() string

type Typeface

type Typeface string

Typeface identifies a particular typeface design. The empty string denotes the default typeface.

type Variant

type Variant string

Variant denotes a typeface variant such as "Mono" or "Smallcaps".

type Weight

type Weight int

Weight is a font weight, in CSS units subtracted 400 so the zero value is normal text weight.

const (
	Thin       Weight = -300
	ExtraLight Weight = -200
	Light      Weight = -100
	Normal     Weight = 0
	Medium     Weight = 100
	SemiBold   Weight = 200
	Bold       Weight = 300
	ExtraBold  Weight = 400
	Black      Weight = 500
)

func (Weight) String

func (w Weight) String() string

Source Files

font.go

Directories

PathSynopsis
font/gofontPackage gofont exports the Go fonts as a text.Collection.
font/opentypePackage opentype implements text layout and shaping for OpenType files.
Version
v0.1.0
Published
Jul 1, 2023
Platform
linux/amd64
Imports
1 packages
Last checked
1 minute ago

Tools for package owners.