-
-
Notifications
You must be signed in to change notification settings - Fork 118
Build Tags
Taco de Wolff edited this page Jun 25, 2024
·
3 revisions
Canvas uses build tags to select optional replacement implementations. By default canvas will use native Go implementations, which usually have limited or very basic functionality, instead of external or CGO implementations. Below is a list of the different build tags:
-
harfbuzzwill use the CGO binding for HarfBuzz, otherwise basic shaping is performed using thehmtxandkerntables. When using RTL or complex Asian scripts, it is recommended to enable HarfBuzz. Make sure to have HarfBuzz installed on the machine. -
fribidiwill use the CGO binding for GNU's FriBidi, otherwise no script itemization is performed. FriBidi needs to be installed on the machine. -
latexwill use thelatexanddvisvgmbinaries that need to be installed on the machine. Otherwise a Go implementation is used. -
formatswill enable the AVIF and WebP image formats for renderers.
To use build tags, add the -tags command line flag when using the go command, e.g.:
$ go install -tags harfbuzz,fribidi
# go build -tags harfbuzz,fribidi
$ go run -tags harfbuzz,fribidi main.go