printer

package module
v0.0.0-...-3d871a9 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: MIT Imports: 9 Imported by: 0

README

printer

Hey Its Package you can use to write text on images

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Printer

func Printer(w http.ResponseWriter, r *http.Request)

func Save

func Save(img image.Image, path string) error

func TextOnImg

func TextOnImg(request Request) (image.Image, error)

TextOnImg given a path to an image, a font & size and a text it will return an Image with the given text printed in the ~middle of the image

Types

type Assets

type Assets struct {
	BgImgPath string
	FontPath  string
	FontSize  float64
}

func (*Assets) Serve

func (a *Assets) Serve(w http.ResponseWriter, r *http.Request)

Serve writes on the image referenced on Assets.BgImgPath with the font set on Assets.FontPath and the size Assets.FontSize the text present on the http.Request.

type Request

type Request struct {
	BgImgPath string
	FontPath  string
	FontSize  float64
	Text      string
}

Jump to

Keyboard shortcuts

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