draw

package
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: BSD-3-Clause Imports: 12 Imported by: 1

Documentation

Overview

Package draw use a backend and a layout object to draw glyphs on the ouput.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrawEmoji

func DrawEmoji(font backend.Font, glyph backend.GID, extents backend.GlyphExtents,
	fontSize, x, y, xAdvance utils.Fl, dst backend.Canvas,
)

DrawEmoji loads and draws `glyph` onto `dst`. It may be used by backend implementations to render emojis.

Types

type Context

type Context struct {
	Output backend.Canvas         // where to draw the text
	Fonts  text.FontConfiguration // used to find fonts
}

func (Context) CreateFirstLine

func (ctx Context) CreateFirstLine(layout text.EngineLayout, textOverflow string, blockEllipsis pr.TaggedString, x, y, angle pr.Fl,
) backend.TextDrawing

CreateFirstLine create the text for the first line of [layout], starting at position `(x,y)`. It also register the fonts used with backend.Canvas.AddFont.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL