erm/vendor/github.com/liamg/fontinfo/matchers.go

20 lines
535 B
Go
Raw Normal View History

2021-07-30 22:29:20 +00:00
package fontinfo
import "strings"
type matcher func(m *fontMetadata) bool
// MatchFamily is a matcher which matches fonts with the specified font family (case insensitive)
func MatchFamily(family string) matcher {
return func(m *fontMetadata) bool {
return strings.EqualFold(m.FontFamily, family)
}
}
// MatchStyle is a matcher which matches fonts with the specified font family (case insensitive)
func MatchStyle(style string) matcher {
return func(m *fontMetadata) bool {
return strings.EqualFold(m.FontStyle, style)
}
}