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,8 +112,16 @@ namespace Volian.Base.Library
|
|||||||
if (name.StartsWith(fontName))
|
if (name.StartsWith(fontName))
|
||||||
{
|
{
|
||||||
string fontFile = (string)FontKey.GetValue(name);
|
string fontFile = (string)FontKey.GetValue(name);
|
||||||
|
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);
|
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))
|
if (!FontFactory.IsRegistered(fontName))
|
||||||
RegisterFontByFontFolders(fontName);
|
RegisterFontByFontFolders(fontName);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user