-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SystemFontFamilies does not return all FontFamilies in Chinese System #304
Comments
I'm classifying this as a feature request, since I believe that eventually we'll come to a conclusion that the existing API should be improved for users to be able to pass any fonts directly (not by name). |
Hi @ForNeVeR , thanks for your concern. I am so sorry about confusing the conception of installed and system font. The file of 宋体 is a system font which filename is It is probably that this API provides all available alias of Font for different languages. For example, the MS Gothic font provides name 'MS Gothic' and 'MS ゴシック' in FamilyNames with respect to en-us and ja-jp. From the above test, I guess the implementation of the GetSystemFont method can be rewritten as:
It is working fine in my system and may is a viable solution 😄 . |
Thanks a lot for help! I've fixed the issue and will prepare a release soon. |
I got an exception thrown in the GetRenderer method when I am trying to change the font name from Arial to 宋体.
In the VS debugger, I can confirm the Fonts.SystemFontFamilies only contains 204 elements without 宋体, but it indeed exists in my system and can be created through
var songti = new Font('宋体', 9)
. The songti variable shows it could be found atSystem.Drawing.FontFamily
, containing 253 elements.https://github.com/ForNeVeR/wpf-math/blob/b5d0af65a80e7095addcde247005a8ac1d01b0b6/src/WpfMath/TexFormula.cs#L107
So, using SystemFontFamilies in GetRenderer is aimed to avoid some expectable error or just a bug? Is it possible to change it to the
System.Drawing.FontFamily
?The text was updated successfully, but these errors were encountered: