MCPcopy Create free account
hub / github.com/cogentcore/core / DeleteFont

Method DeleteFont

paint/fontlib.go:185–197  ·  view source on GitHub ↗

DeleteFont removes given font from list of available fonts -- if not supported etc

(fontnm string)

Source from the content-addressed store, hash-verified

183
184// DeleteFont removes given font from list of available fonts -- if not supported etc
185func (fl *FontLib) DeleteFont(fontnm string) {
186 loadFontMu.Lock()
187 defer loadFontMu.Unlock()
188 delete(fl.FontsAvail, fontnm)
189 for i, fi := range fl.FontInfo {
190 if strings.ToLower(fi.Name) == fontnm {
191 sz := len(fl.FontInfo)
192 copy(fl.FontInfo[i:], fl.FontInfo[i+1:])
193 fl.FontInfo = fl.FontInfo[:sz-1]
194 break
195 }
196 }
197}
198
199// OpenAllFonts attempts to load all fonts that were found -- call this before
200// displaying the font chooser to eliminate any bad fonts.

Callers 1

FontMethod · 0.95

Calls 2

LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected