func NewFinder(opts *FinderOpts) *Finder {
	if opts == nil {
		opts = &FinderOpts{Extensions: []string{".ttf", ".ttc", ".otf"}}
	}
	var fonts []*Font
	walker := func(filename string, info os.FileInfo, err error) error {
		if err != nil {
			return err
		}
		if info.IsDir() {
			return nil
		}
		if extensions := opts.Extensions; len(extensions) > 0 {
			extension := filepath.Ext(strings.ToLower(filename))
			if !strutil.SliceContains(extensions, extension) {
				return nil
			}
		}
		matches := fontRegistry.matchFontsByFilename(filename)
		if len(matches) == 0 {
			matches = append(matches, &Font{Filename: filename})
		}
		fonts = append(fonts, matches...)
		return nil
	}
	for _, dir := range xdg.FontDirs {
		if err := filepath.Walk(dir, walker); err != nil {
			continue
		}
	}
	return &Finder{
		fonts: fonts,
	}
}
NewFinder returns a new font finder. If the opts parameter is nil, default
options are used.

Default options:
Extensions: []string{".ttf", ".ttc", ".otf"}
package sysfont
import (
	"os"
	"path/filepath"
	"strings"
	"github.com/adrg/strutil"
	"github.com/adrg/xdg"
)
type Finder struct {
	fonts []*Font
}
type FinderOpts struct {
	Extensions []string
}