Skip to content

FontFamilyAdapter will throw System.Collections.Generic.KeyNotFoundException when the font do not has a "en-us" family names. #120

@clijiac

Description

@clijiac

I know this maybe not a very common case. But I got this issue on my pc.
I have a font named 汉仪综艺体简 , just has a "zh-cn" FamilyNames cause the PaperCut can not startup.

trace log ( though contains some chinese,But I think it is clear enough):

对类型“TheArtOfDev.HtmlRenderer.WPF.HtmlPanel”的构造函数执行符合指定的绑定约束的调用时引发了异常。 (See inner exception for details.)
---> System.Windows.Markup.XamlParseException: 对类型“TheArtOfDev.HtmlRenderer.WPF.HtmlPanel”的构造函数执行符合指定的绑定约束的调用时引发了异常。
---> System.TypeInitializationException: “TheArtOfDev.HtmlRenderer.WPF.Adapters.WpfAdapter”的类型初始值设定项引发异常。
---> System.Collections.Generic.KeyNotFoundException: 给定关键字不在字典中。
在 System.ThrowHelper.ThrowKeyNotFoundException()
在 System.Collections.Generic.Dictionary`2.get_Item(TKey key)
在 TheArtOfDev.HtmlRenderer.WPF.Adapters.FontFamilyAdapter.get_Name() 位置 d:\source\github\HTML-Renderer\Source\HtmlRenderer.WPF\Adapters\FontFamilyAdapter.cs:行号 54
在 TheArtOfDev.HtmlRenderer.Core.Handlers.FontsHandler.AddFontFamily(RFontFamily fontFamily) 位置 d:\source\github\HTML-Renderer\Source\HtmlRenderer\Core\Handlers\FontsHandler.cs:行号 88
在 TheArtOfDev.HtmlRenderer.WPF.Adapters.WpfAdapter..ctor() 位置 d:\source\github\HTML-Renderer\Source\HtmlRenderer.WPF\Adapters\WpfAdapter.cs:行号 64
在 TheArtOfDev.HtmlRenderer.WPF.Adapters.WpfAdapter..cctor() 位置 d:\source\github\HTML-Renderer\Source\HtmlRenderer.WPF\Adapters\WpfAdapter.cs:行号 37

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions