fixed dependencies

This commit is contained in:
nuknal
2024-10-24 15:46:01 +08:00
parent d16a5bd9c0
commit 1161e8d054
2005 changed files with 690883 additions and 0 deletions

62
vendor/github.com/go-latex/latex/drawtex/canvas.go generated vendored Normal file
View File

@@ -0,0 +1,62 @@
// Copyright ©2020 The go-latex Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package drawtex describes the graphics interface for drawing LaTeX.
package drawtex // import "github.com/go-latex/latex/drawtex"
import (
"github.com/go-latex/latex/font"
"golang.org/x/image/font/sfnt"
)
type Canvas struct {
ops []Op
}
func New() *Canvas {
return &Canvas{}
}
func (c *Canvas) RenderGlyph(x, y float64, infos Glyph) {
c.ops = append(c.ops, GlyphOp{x, y, infos})
}
func (c *Canvas) RenderRectFilled(x1, y1, x2, y2 float64) {
c.ops = append(c.ops, RectOp{x1, y1, x2, y2})
}
func (c *Canvas) Ops() []Op { return c.ops }
type Op interface {
isOp()
}
type GlyphOp struct {
X, Y float64
Glyph Glyph
}
func (GlyphOp) isOp() {}
type RectOp struct {
X1, Y1 float64
X2, Y2 float64
}
func (RectOp) isOp() {}
type Glyph struct {
Font *sfnt.Font
Size float64
Postscript string
Metrics font.Metrics
Symbol string
Num sfnt.GlyphIndex
Offset float64
}
var (
_ Op = (*GlyphOp)(nil)
_ Op = (*RectOp)(nil)
)