Categorygithub.com/zijiren233/go-text2picture
modulepackage
1.1.3
Repository: https://github.com/zijiren233/go-text2picture.git
Documentation: pkg.go.dev

# README

go-text2picture

package main

import (
	"fmt"
	"image/color"
	"io"
	"os"

	"github.com/zijiren233/go-text2picture"
)

func main() {
	pic := text2picture.NewPictureWithBackGround(text2picture.NewColorPicture(500, 100, text2picture.White), 320, 10, 5)
	pic.DrawWithBlack("test 123\n4321...")
	pic.DrawWithColor(text2picture.Red, "test color ... ")
	pic.PointOffset(0, float64(pic.NextLineDistance()))
	pic.DrawWithBlack("test offset")
	pic.DrawWithBlack("   test auto newline")
	f, err := os.OpenFile("./test.png", os.O_CREATE|os.O_WRONLY|os.O_TRUNC, os.ModePerm)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer f.Close()
	io.Copy(f, pic.GeneratePicture())
}

# Functions

No description provided by the author
Load local fonts.
No description provided by the author
No description provided by the author
Color can be generated using text2picture.NewColor().
png: background padding: text left and right padding fontSize: font size in points.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author