package painter

import "fyne.io/fyne/v2/internal/painter"

Index

Constants

const TextDPI = 78

TextDPI is a global constant that determines how text scales to interface sizes

Functions

func CachedFontFace

func CachedFontFace(style fyne.TextStyle, opts *truetype.Options) font.Face

CachedFontFace returns a font face held in memory. These are loaded from the current theme.

func ClearFontCache

func ClearFontCache()

ClearFontCache is used to remove cached fonts in the case that we wish to re-load font faces

func DrawCircle

func DrawCircle(circle *canvas.Circle, vectorPad float32, scale func(float32) float32) *image.RGBA

DrawCircle rasterizes the given circle object into an image. The bounds of the output image will be increased by vectorPad to allow for stroke overflow at the edges. The scale function is used to understand how many pixels are required per unit of size.

func DrawLine

func DrawLine(line *canvas.Line, vectorPad float32, scale func(float32) float32) *image.RGBA

DrawLine rasterizes the given line object into an image. The bounds of the output image will be increased by vectorPad to allow for stroke overflow at the edges. The scale function is used to understand how many pixels are required per unit of size.

func DrawRectangle

func DrawRectangle(rect *canvas.Rectangle, vectorPad float32, scale func(float32) float32) *image.RGBA

DrawRectangle rasterizes the given rectangle object with stroke border into an image. The bounds of the output image will be increased by vectorPad to allow for stroke overflow at the edges. The scale function is used to understand how many pixels are required per unit of size.

func GetAspect

func GetAspect(img *canvas.Image) float32

GetAspect looks up an aspect ratio of an image

func PaintImage

func PaintImage(img *canvas.Image, c fyne.Canvas, width, height int) image.Image

PaintImage renders a given fyne Image to a Go standard image

func RenderedTextSize

func RenderedTextSize(text string, size float32, style fyne.TextStyle) fyne.Size

RenderedTextSize looks up how bit a string would be if drawn on screen

func SvgCacheMonitorTheme

func SvgCacheMonitorTheme()

SvgCacheMonitorTheme hooks up the SVG cache to listen for theme changes and resets the cache

func SvgCacheReset

func SvgCacheReset()

SvgCacheReset clears the SVG cache.

func VectorPad

func VectorPad(obj fyne.CanvasObject) float32

VectorPad returns the number of additional points that should be added around a texture. This is to accommodate overflow caused by stroke and line endings etc. THe result is in fyne.Size type coordinates and should be scaled for output.

Source Files

draw.go font.go image.go svg_cache.go vector.go

Directories

PathSynopsis
internal/painter/glPackage gl provides a full Fyne render implementation using system OpenGL libraries.
internal/painter/software
Version
v2.0.0-rc5
Published
Jan 18, 2021
Platform
darwin/amd64
Imports
22 packages
Last checked
1 hour ago

Tools for package owners.