Skip to content

Commit

Permalink
Fix race condition in FindSystemFont
Browse files Browse the repository at this point in the history
  • Loading branch information
tdewolff committed Jul 5, 2024
1 parent 75e5bbe commit d9ac4a8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions font.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,8 @@ func FindSystemFont(name string, style FontStyle) (string, bool) {
if systemFonts.SystemFonts == nil {
systemFonts.SystemFonts, _ = font.FindSystemFonts(font.DefaultFontDirs())
}
systemFonts.Unlock()

font, ok := systemFonts.Match(name, font.ParseStyleCSS(style.CSS(), style.Italic()))
systemFonts.Unlock()
return font.Filename, ok
}

Expand Down

0 comments on commit d9ac4a8

Please sign in to comment.