B2019-118 Font appears in Registry but the related file does not appear in the font folder. Results in a crash. Error Handler was added to eliminate this case
This commit is contained in:
parent
a804f2f716
commit
17f24b7100
@ -112,7 +112,15 @@ namespace Volian.Base.Library
|
||||
if (name.StartsWith(fontName))
|
||||
{
|
||||
string fontFile = (string)FontKey.GetValue(name);
|
||||
FontFactory.Register(fontFile.Contains("\\") ? fontFile : FontFind.FontDir + "\\" + fontFile);
|
||||
try // B2019-118 Add error handling for FontFacory.Register (Windows Registry contains a node that
|
||||
// points to a file that no longer exists
|
||||
{
|
||||
FontFactory.Register(fontFile.Contains("\\") ? fontFile : FontFind.FontDir + "\\" + fontFile);
|
||||
}
|
||||
catch (Exception ex) // catch any exception and add the error to the error log.
|
||||
{
|
||||
_MyLog.WarnFormat("Font Error {0} - {1}", name, ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!FontFactory.IsRegistered(fontName))
|
||||
|
Loading…
x
Reference in New Issue
Block a user