【问题标题】:How to install new font in RStudio?如何在 RStudio 中安装新字体?
【发布时间】:2014-10-20 03:58:00
【问题描述】:

我想在 RStudio 中安装新字体。 更具体地说,我在办公室 (Windows) 和家里 (OS X) 使用 RStudio,但我发现字体不同,我需要一段时间才能习惯。

有人可以建议如何在 Mac 的 RStudio 中安装 SAS 等宽字体吗?
(我在此处和 Google 中进行了搜索,但没有找到问题的答案.)

提前谢谢你!

【问题讨论】:

    标签: macos fonts rstudio


    【解决方案1】:

    我在 Windows 上遇到了类似的问题,我想使用我安装的新字体 mononoki 字体。我找不到更改选项,所以我查看了 RStudio 源代码,发现对于 RStudio 的桌面版本,RStudio 会自动从操作系统加载字体。它应该在 MAC 上以相同的方式工作。

    你所要做的就是:

    1.Install your font as usual for your OS
    2.Then restart RStudio
    3.The new font appears in the Editor Fonts pull down menu 
       (navigation: Global Options -->Appearance --> Editor Fonts)
    4.Select the font from Editor Fonts pulldown menu.(Your Done!)
    

    这是从 RStudio 加载字体的code。如您所见,它会自动加载比例和固定字体。 RStudio 的 Web 版本将字体选择限制为仅几种字体。

     static class DesktopThemeFontLoader implements ThemeFontLoader
       {
          public native final String getProportionalFont() /*-{
             return $wnd.desktop.proportionalFont();
          }-*/;
    
          public native final String getFixedWidthFont() /*-{
             return $wnd.desktop.fixedWidthFont();
          }-*/;
       }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-01-16
      • 2021-06-15
      • 2015-12-17
      • 1970-01-01
      • 2021-12-11
      • 1970-01-01
      相关资源
      最近更新 更多