d2/d2renderers/d2fonts/d2fonts_test.go
2023-03-27 19:26:49 -07:00

21 lines
443 B
Go

package d2fonts
import (
"path/filepath"
"testing"
"oss.terrastruct.com/d2/lib/font"
"oss.terrastruct.com/util-go/assert"
"oss.terrastruct.com/util-go/diff"
)
func TestCutFont(t *testing.T) {
f := Font{
Family: SourceCodePro,
Style: FONT_STYLE_REGULAR,
}
fontBuf := FontFaces[f]
fontBuf = font.CutFont(fontBuf, "a")
err := diff.Testdata(filepath.Join("testdata", "d2fonts", "cut"), ".txt", fontBuf)
assert.Success(t, err)
}