draw2dimg/ftgc.go
func NewGraphicContextWithPainter(img draw.Image, painter Painter) *GraphicContext {
	width, height := img.Bounds().Dx(), img.Bounds().Dy()
	dpi := 92
	gc := &GraphicContext{
		draw2dbase.NewStackGraphicContext(),
		img,
		painter,
		raster.NewRasterizer(width, height),
		raster.NewRasterizer(width, height),
		draw2d.GetGlobalFontCache(),
		draw2dbase.NewGlyphCache(),
		&truetype.GlyphBuf{},
		dpi,
	}
	return gc
}
func NewGraphicContextWithPainter(img draw.Image, painter Painter) *GraphicContext {
	width, height := img.Bounds().Dx(), img.Bounds().Dy()
	dpi := 92
	gc := &GraphicContext{
		draw2dbase.NewStackGraphicContext(),
		img,
		painter,
		raster.NewRasterizer(width, height),
		raster.NewRasterizer(width, height),
		draw2d.GetGlobalFontCache(),
		draw2dbase.NewGlyphCache(),
		&truetype.GlyphBuf{},
		dpi,
	}
	return gc
}
// NewGraphicContextWithPainter creates a new Graphic context from an image and a Painter (see Freetype-go)