Documentation
¶
Index ¶
- Constants
- func CachedFontFace(style fyne.TextStyle, opts *truetype.Options) font.Face
- func ClearFontCache()
- func DrawCircle(circle *canvas.Circle, vectorPad int, scale func(float32) int) *image.RGBA
- func DrawLine(line *canvas.Line, vectorPad int, scale func(float32) int) *image.RGBA
- func DrawRectangle(rect *canvas.Rectangle, vectorPad int, scale func(float32) int) *image.RGBA
- func GetAspect(img *canvas.Image) float32
- func PaintImage(img *canvas.Image, c fyne.Canvas, width, height int) image.Image
- func RenderedTextSize(text string, size int, style fyne.TextStyle) fyne.Size
- func SvgCacheMonitorTheme()
- func SvgCacheReset()
- func VectorPad(obj fyne.CanvasObject) int
Constants ¶
const TextDPI = 78
TextDPI is a global constant that determines how text scales to interface sizes
Variables ¶
This section is empty.
Functions ¶
func CachedFontFace ¶
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 ¶ added in v1.3.1
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 ¶ added in v1.3.1
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 ¶ added in v1.3.1
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 PaintImage ¶
PaintImage renders a given fyne Image to a Go standard image
func RenderedTextSize ¶
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 VectorPad ¶ added in v1.3.1
func VectorPad(obj fyne.CanvasObject) int
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.
Types ¶
This section is empty.