如何在Smalltalk Squeak/Pharo中轻松更改为原生字体

soe*_*rno 13 fonts smalltalk squeak pharo

随着每个新的Squeak/Pharo图像,我立即将字体更改为某些原生版本.这是很多鼠标点击,我想编写过程脚本.

nes*_*983 8

上面的答案可能已经过时了,至少它不适用于我的3.10图像.所以,我用这个:

defaultFont := LogicalFont familyName: 'Geneva' pointSize: 10 emphasis:0 .
codeFont := LogicalFont familyName: 'Monaco' pointSize: 10 emphasis:0.
Preferences setCodeFontTo: codeFont.
Preferences setWindowTitleFontTo: defaultFont.
Preferences setButtonFontTo: defaultFont.
Preferences setListFontTo: defaultFont.
Preferences setMenuFontTo: defaultFont.
Preferences setSystemFontTo: defaultFont.
Run Code Online (Sandbox Code Playgroud)


soe*_*rno 6

找到答案,正在寻找setSystemFontTo.完整的脚本现在是:

"Set fonts on Mac OS X"
defaultFont := LogicalFont familyName: 'Lucida Grande' pointSize: 10 
   stretchValue:  5 weightValue: 400 slantValue: 0.
codeFont := LogicalFont familyName: 'Monaco' pointSize: 10 
   stretchValue:  5 weightValue: 400 slantValue: 0.
Preferences setCodeFontTo: codeFont.
Preferences setWindowTitleFontTo: defaultFont.
Preferences setButtonFontTo: defaultFont.
Preferences setListFontTo: defaultFont.
Preferences setMenuFontTo: defaultFont.
Preferences setSystemFontTo: defaultFont.
Run Code Online (Sandbox Code Playgroud)


Seb*_*tre 6

这是在Pharo中实现这一目标的新方法:

|font codeFont|

font := LogicalFont familyName: 'Bitmap DejaVu Sans' pointSize: 10.
codeFont := LogicalFont familyName: 'Bitmap DejaVu Sans' pointSize: 9.
StandardFonts listFont: codeFont.
StandardFonts menuFont: font.
StandardFonts codeFont: codeFont.
StandardFonts buttonFont: codeFont.
StandardFonts defaultFont: font.
StandardFonts windowTitleFont: font.

FreeTypeFontProvider current updateFromSystem.  
Run Code Online (Sandbox Code Playgroud)