Skip to content

Commit

Permalink
[FontResolver] fixed null family names
Browse files Browse the repository at this point in the history
  • Loading branch information
haraldsteinlechner committed Dec 14, 2023
1 parent aa0bfd4 commit 712059f
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/Aardvark.Rendering.Text/FontResolver.fs
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,14 @@ module internal FontResolver =
let dict = System.Collections.Generic.Dictionary<string, list<_>>()

for e in entries do
let key = normalizeFamilyName e.FamilyName
if not (isNull e.FamilyName) then
let key = normalizeFamilyName e.FamilyName

match dict.TryGetValue key with
| (true, s) ->
dict.[key] <- e :: s
| _ ->
dict.[key] <- [e]
match dict.TryGetValue key with
| (true, s) ->
dict.[key] <- e :: s
| _ ->
dict.[key] <- [e]

dict

Expand Down Expand Up @@ -227,9 +228,9 @@ module internal FontResolver =
if File.Exists path then
let entries = FontTableEntries.ofFile path
match familyName with
| Some f ->
| Some f when not (isNull f) ->
for r in entries do result.Add { r with FamilyName = f }
| None ->
| _ ->
result.AddRange entries


Expand Down

0 comments on commit 712059f

Please sign in to comment.