MCPcopy Create free account
hub / github.com/tdewolff/canvas / parseFeatures

Function parseFeatures

text/harfbuzz.go:96–117  ·  view source on GitHub ↗
(input string)

Source from the content-addressed store, hash-verified

94}
95
96func parseFeatures(input string) []harfbuzz.Feature {
97 if input == "" {
98 return nil
99 }
100
101 features := []harfbuzz.Feature{}
102 for _, part := range strings.Split(input, ",") {
103 if part == "" {
104 continue
105 }
106
107 feature, err := harfbuzz.ParseFeature(part)
108 if err != nil {
109 fmt.Fprintf(os.Stderr, "error parsing feature '%s': %v\n", part, err)
110 continue
111 }
112
113 features = append(features, feature)
114 }
115
116 return features
117}
118
119func LookupScript(r rune) Script {
120 return Script(language.LookupScript(r))

Callers 1

ShapeMethod · 0.85

Calls 1

SplitMethod · 0.80

Tested by

no test coverage detected