draw

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2023 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.TextLayout, style pr.StyleAccessor,
	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 font used.

Jump to

Keyboard shortcuts

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