获取Mathematica前端服从FontFamily选项 [英] Getting the Mathematica front end to obey the FontFamily option

查看:140
本文介绍了获取Mathematica前端服从FontFamily选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

就汉字而言,我无法使Mathematica的Front End使用我选择的字体。我怎样才能得到它使用我需要的字体?

这里我提供了两个截图来显示问题,一个来自Word(顶部),另一个来自Mathematica在WinXP ,都显示相同的字符串。请注意,Mathematica使用几种不同的字体(我猜它使用字体替换时,它首先使用的字体不包含字形---但是我指定的字体包含我需要的所有字形!)。这里我使用的是Win7自带的字体Microsoft YaHei,但是下面是一些测试代码:$ / $> b
$ b

  str =肖像美女 

风格[str,Large,FontFamily - > (SimSun)]


$ b (SimSun附带XP和包含所有这些字符也是如此,虽然不知道是否在所有版本中。)



编辑2:我在Windows XP上(使用启用了东亚语言支持),我想知道其他操作系统的结果是不同的。









总结:看来,行为取决于特定的操作系统和安装的字体,不幸的是似乎没有办法使字体统一(即使存在包含所有字形的单个字体) p>

解决方案

字体族名称不等同于系统字体文件名称。您可以通过下面的方式阅读这些字体名称。



这是获取正确的字体名称的简单方法是
$ b $首先,键入一些文本,例如我们,使用Mathematica菜单编辑您的目标字体。

  • 其次,添加 // InputForm 。运行单元格后,您将获得正确的字体名称。在我的电脑中,楷体的fontfamily名字是¿[Not]Ìå_GB2312。真棒。




  • When it comes to Chinese characters, I am unable to get the Front End of Mathematica to use the fonts of my choice. How can I get it to use the fonts I need?

    Here I provide two screenshots to show the problem, one from Word (top), the other from Mathematica on WinXP, both displaying the same string. Note that Mathematica uses several different fonts (I guess it uses font substitution when the font it tries to use first doesn't contain a glyph---however the font I specified contains all glyphs I need!). Here I use the font Microsoft YaHei, which comes with Win7, but is downloadable for XP too.

    EDIT: Here's some test code:

    str = "肖诮陗俏削帩消峭捎绡莦弰悄焇琑逍㲖㲵䏴哨娋宵屑綃梢痟睄筲艄萷销䇌䘯趙揱旓硝稍踃輎矟䌃箾蛸誚榍蕱銷鞘潲碿糏霄䴛韒髾鮹鞩魈颵"
    
    Style[str, Large, FontFamily -> "SimSun"]
    

    (SimSun comes with XP and should contain all these characters too, although not sure if in all versions.)

    EDIT 2: I am on Windows XP (with East Asian language support enabled), I wonder if the results are different on other OSs.


    Summary: It appears that the behaviour depends on the particular OS and the fonts installed, and unfortunately there seems to be no way to make the fonts uniform (even if there exists a single font containing all the glyphs).

    解决方案

    Font family names are not equivalent to system font files names. You can read those font names by the way below.

    This is the easy way to get the right font family name is

    • Firstly, type some text, e.g."我们", edit to your "target font" using the Mathematica menu.
    • Secondly, add //InputForm. After running the cell, you will get the right font name. In my computer, the fontfamily name for "楷体" is "¿ [Not]Ìå_GB2312". Awesome.

    这篇关于获取Mathematica前端服从FontFamily选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆