2009-02-22 12 views

Odpowiedz

6

Znaleźliśmy odpowiedź, szukałem setSystemFontTo. Kompletny skrypt jest teraz:

"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. 
8

Powyższa odpowiedź może być już nieaktualna, przynajmniej nie działa z moim obrazem 3.10. tak, używam to:

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. 
6

To jest nowy sposób to zrobić w 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. 
4

W systemie Linux z Pharo 2.0, dodałem następującą zawartość do pliku w specjalnym katalog, który jest odczytywany automatycznie przy starcie Obrazek:

StartupLoader default executeAtomicItems: { 
    StartupAction 
    name: 'Use Free type' 
    code: '(Smalltalk at: #FreeTypeSystemSettings) 
    perform: #loadFt2Library: with: (true)' 
    runOnce: true. 
    StartupAction name: 'Setting up fonts' code: [ 
    |font codeFont| 

    FileStream stdout lf; nextPutAll: 'Setting up fonts'; lf. 

    font := LogicalFont familyName: 'DejaVu Sans' pointSize: 12. 
    codeFont := LogicalFont familyName: 'DejaVu Sans Mono' pointSize: 12. 
    StandardFonts listFont: codeFont. 
    StandardFonts menuFont: font. 
    StandardFonts codeFont: codeFont. 
    StandardFonts buttonFont: codeFont. 
    StandardFonts defaultFont: font. 
    StandardFonts windowTitleFont: font. 
    StandardFonts balloonFont: font. 
    StandardFonts haloFont: font. 

    FileStream stdout lf; nextPutAll: 'Finished'; lf]. 
}. 

Ten specjalny katalog może być ujawnione z

FileDirectory preferencesVersionFolder 

Powinieneś przeczytać dokumentację klasy StartupLoader.

Powiązane problemy