txt2img

package
v1.2.3-beta2 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package txt2img 文字转图片

Index

Constants

View Source
const (

	// FontPath 通用字体路径
	FontPath = "data/Font/"
	// FontFile 苹方字体
	FontFile = FontPath + "regular.ttf"
	// BoldFontFile 粗体苹方字体
	BoldFontFile = FontPath + "regular-bold.ttf"
)

Variables

This section is empty.

Functions

func CanvasToBase64

func CanvasToBase64(canvas *gg.Context) (base64Bytes []byte, err error)

CanvasToBase64 gg内容转为base64

func Render

func Render(text string, width, fontSize int) (canvas *gg.Context, err error)

Render 文字转图片

func RenderToBase64

func RenderToBase64(text string, width, fontSize int) (base64Bytes []byte, err error)

RenderToBase64 文字转base64

Types

This section is empty.

Jump to

Keyboard shortcuts

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