text

package
v1.3.0-beta2 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: GPL-3.0 Imports: 7 Imported by: 93

Documentation

Overview

Package text 文字转图片

Index

Constants

View Source
const (
	// FontPath 通用字体路径
	FontPath = "data/Font/"
	// FontFile 苹方字体
	FontFile = FontPath + "regular.ttf"
	// BoldFontFile 粗体苹方字体
	BoldFontFile = FontPath + "regular-bold.ttf"
	// SakuraFontFile ...
	SakuraFontFile = FontPath + "sakura.ttf"
	// ConsolasFontFile ...
	ConsolasFontFile = FontPath + "consolas.ttf"
)

Variables

This section is empty.

Functions

func RenderToBase64

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

RenderToBase64 文字转base64

Types

type Text

type Text struct {
	// contains filtered or unexported fields
}

func Render

func Render(text, font string, width, fontSize int) (txtc Text, err error)

Render 文字转图片 width 是图片宽度

func (Text) Image

func (txtc Text) Image() image.Image

Image ...

Jump to

Keyboard shortcuts

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