diff --git a/testdata/Text.png b/testdata/Text.png index eddca1c..391b353 100755 Binary files a/testdata/Text.png and b/testdata/Text.png differ diff --git a/text.go b/text.go index 18f09ff..6019688 100644 --- a/text.go +++ b/text.go @@ -153,10 +153,17 @@ func (cv *Canvas) FillText(str string, x, y float64) { scale := (scaleX + scaleY) * 0.5 fontSize := fixed.Int26_6(math.Round(float64(cv.state.fontSize) * scale)) + // if the font size is large or rotated or skewed in some way, use the + // triangulated font rendering if fontSize > fixed.I(25) { cv.fillText2(str, x, y) return } + mat := cv.state.transform + if mat[1] != 0 || mat[2] != 0 || mat[0] != mat[3] { + cv.fillText2(str, x, y) + return + } frc := cv.getFRContext(cv.state.font, fontSize) fnt := cv.state.font.font