607 encodingLabel adjust:#right. |
607 encodingLabel adjust:#right. |
608 self showEncodingFilter ifFalse:[ |
608 self showEncodingFilter ifFalse:[ |
609 encodingLabel beInvisible |
609 encodingLabel beInvisible |
610 ]. |
610 ]. |
611 |
611 |
612 Screen current supportsXFTFonts ifTrue:[ |
612 self graphicsDevice supportsXftFonts ifTrue:[ |
613 self xftFontsOnlyHolder value: (UserPreferences current useXftFontsOnly). |
613 self xftFontsOnlyHolder value: (UserPreferences current useXftFontsOnly). |
614 xftCheckBox := CheckBox label:(resources string:'XFT Fonts Only') in:box1. |
614 xftCheckBox := CheckBox label:(resources string:'XFT Fonts Only') in:box1. |
615 xftCheckBox model:xftFontsOnlyHolder. |
615 xftCheckBox model:xftFontsOnlyHolder. |
616 xftFontsOnlyHolder onChangeEvaluate:[ self xftFontsOnlyChanged ]. |
616 xftFontsOnlyHolder onChangeEvaluate:[ self xftFontsOnlyChanged ]. |
617 |
617 |
1073 previewField characterEncoding:enc. |
1073 previewField characterEncoding:enc. |
1074 |
1074 |
1075 encodingLabel label:enc. |
1075 encodingLabel label:enc. |
1076 currentEncoding := enc. |
1076 currentEncoding := enc. |
1077 fontName := deviceFont fullName. |
1077 fontName := deviceFont fullName. |
1078 (font isKindOf:XftFontDescription) ifTrue:[fontName := fontName,' (xft)']. |
1078 font isXftFont ifTrue:[fontName := fontName,' (xft)']. |
1079 previewField contents:(font userFriendlyName,'\\' withCRs,(self class defaultSampleStringForEncoding:enc) asString). |
1079 previewField contents:(font userFriendlyName,'\\' withCRs,(self class defaultSampleStringForEncoding:enc) asString). |
1080 ] ifFalse:[ |
1080 ] ifFalse:[ |
1081 previewField contents:nil. |
1081 previewField contents:nil. |
1082 encodingLabel label:nil. |
1082 encodingLabel label:nil. |
1083 currentEncoding := nil. |
1083 currentEncoding := nil. |
1560 |
1560 |
1561 "Modified: 26.5.1996 / 15:04:29 / cg" |
1561 "Modified: 26.5.1996 / 15:04:29 / cg" |
1562 ! |
1562 ! |
1563 |
1563 |
1564 flushListOfAvailableFonts |
1564 flushListOfAvailableFonts |
1565 XftFontDescription flushListOfAvailableFonts. |
1565 self withWaitCursorDo:[ |
1566 self updateFamilyList |
1566 "this may take some time, especially with X11 XFT fonts" |
|
1567 self graphicsDevice |
|
1568 flushListOfAvailableFonts; |
|
1569 listOfAvailableFonts. |
|
1570 |
|
1571 familyList list:nil. |
|
1572 self updateFamilyList. |
|
1573 ]. |
1567 ! |
1574 ! |
1568 |
1575 |
1569 okPressed |
1576 okPressed |
1570 "ok was pressed; hide myself and evaluate the okAction, passing |
1577 "ok was pressed; hide myself and evaluate the okAction, passing |
1571 family, face, style and size as arguments" |
1578 family, face, style and size as arguments" |
1572 |
1579 |
1573 |sz szUnitUsed| |
1580 |sz szUnitUsed| |
1574 |
1581 |
1575 szUnitUsed := (sizeUnit ? #pt). |
1582 szUnitUsed := (sizeUnit ? #pt). |
1576 sz := Number readFrom:currentSize. |
1583 sz := Number readFrom:currentSize. |
1577 (currentSize endsWith:'px') ifTrue:[ |
1584 (currentSize endsWith:#px) ifTrue:[ |
1578 szUnitUsed := #px |
1585 szUnitUsed := #px |
1579 ]. |
1586 ]. |
1580 |
1587 |
1581 self hide. |
1588 self hide. |
1582 okAction notNil ifTrue:[ |
1589 okAction notNil ifTrue:[ |
1583 currentFamily notNil ifTrue:[ |
1590 currentFamily notNil ifTrue:[ |
1584 okAction value: |
1591 okAction value: |
1585 (((Screen current supportsXFTFonts and:[ self xftFontsOnlyHolder value ]) |
1592 (((self graphicsDevice supportsXftFonts and:[self xftFontsOnlyHolder value]) |
1586 ifTrue:[XftFontDescription] |
1593 ifTrue:[XftFontDescription] |
1587 ifFalse:[FontDescription]) |
1594 ifFalse:[FontDescription]) |
1588 family:currentFamily |
1595 family:currentFamily |
1589 face:currentFace |
1596 face:currentFace |
1590 style:currentStyle |
1597 style:currentStyle |