From beaea3749f8c017014b380b1e94374f01e48d433 Mon Sep 17 00:00:00 2001 From: krauthaufen Date: Wed, 6 Dec 2023 20:57:05 +0100 Subject: [PATCH] fixed windows font resolver --- src/Aardvark.Rendering.Text/FontResolver.fs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Aardvark.Rendering.Text/FontResolver.fs b/src/Aardvark.Rendering.Text/FontResolver.fs index 8e58838c..fce36a9d 100644 --- a/src/Aardvark.Rendering.Text/FontResolver.fs +++ b/src/Aardvark.Rendering.Text/FontResolver.fs @@ -190,7 +190,7 @@ module internal FontResolver = let mutable run = true - let nameRx = System.Text.RegularExpressions.Regex @"^(.*?)[ \t]*(Bold|Semibold|Thin|Italic)?[ \t]*\([ \t]*(TrueType|OpenType)[ \t]*\)[ \t]*$" + let nameRx = System.Text.RegularExpressions.Regex(@"^(.*?)[ \t]*(Bold Italic|Light Italic|Thin Italic|Bold|Semibold|Thin|Italic|Light)?[ \t]*\([ \t]*(TrueType|OpenType)[ \t]*\)[ \t]*$", System.Text.RegularExpressions.RegexOptions.IgnoreCase) let result = System.Collections.Generic.List<_>() let fonts = Environment.GetFolderPath Environment.SpecialFolder.Fonts @@ -209,8 +209,8 @@ module internal FontResolver = let ret = RegEnumValue(key, index, pName, &nameLen, 0n, 0n, pValue, &valueLen) if ret = 0 then - let name = System.Text.Encoding.ASCII.GetString(nameBuffer, 0, nameLen) - let file = System.Text.Encoding.ASCII.GetString(valueBuffer, 0, valueLen) + let name = System.Text.Encoding.ASCII.GetString(nameBuffer, 0, nameLen).Trim(' ', char 0) + let file = System.Text.Encoding.ASCII.GetString(valueBuffer, 0, valueLen).Trim(' ', char 0) let familyName = let m = nameRx.Match name