Faculty of Information Technology
Software Engineering Group

Opened 7 years ago

Last modified 6 years ago

#83 new defect

Font warnings - connected to Ms windows?

Reported by: Patrik Svestka Owned by:
Priority: minor Milestone:
Component: default Keywords:
Cc: Also affects CVS HEAD (eXept version): no

Description

When I start StX I always get these types of warnings in launcher - I wonder if that what is the reason for that?

Font [warning]: encoding for "a courier-medium-roman-10 (iso10646-1)-Font" should be iso10646-1; is ms-easteurope
Font [warning]: encoding for "a courier-bold-roman-10 (iso10646-1)-Font" should be iso10646-1; is ms-easteurope
Font [warning]: encoding for "a courier-medium-oblique-10 (iso10646-1)-Font" should be iso10646-1; is ms-easteurope
Font [warning]: encoding for "a courier-bold-oblique-10 (iso10646-1)-Font" should be iso10646-1; is ms-easteurope
Font [warning]: encoding Font [warning]: encoding for "a Segoe UI-bold-roman-9.0 (ms-default)-Font" should be ms-default; is ms-easteurope
for "a symbol-medium-roman-10 (iso10646-1)-Font" should be iso10646-1; is ms-symbol

Change History (1)

comment:1 Changed 6 years ago by Patrik Svestka

Most probably this method is the reason:

encoding notNil ifTrue:[
        (encoding ~= fetchedEncoding) ifTrue:[
            (( #( #'iso10646-1' #'ms-default' #'ms-ansi' #'ms-oem' ) includes:encoding)
            and:[ ( #( #'iso10646-1' #'ms-default' #'ms-ansi' #'ms-oem' ) includes:fetchedEncoding)]) ifFalse:[
                encoding ~= #* ifTrue:[
                    ('Font [warning]: encoding for "%1" should be %2; is %3 '
                        bindWith:self with: encoding with: fetchedEncoding) infoPrintCR.
                ].
            ].
        ].
    ] ifFalse:[
        encoding := fetchedEncoding.
    ].

The question is why it is important to check the font encoding when everything should be unicode.

in method:

getFontInfos
    "ask the device about all of my actual attributes"

    |info fetchedEncoding|

    replacementFont notNil ifTrue:[
        replacementFont getFontInfos.
        ^ self
    ].

    info := self getFontMetrics.

    minCode := info minCode.
    maxCode := info maxCode.
    direction := info direction.

    fetchedEncoding := info encoding.
    fetchedEncoding isNil ifTrue:[
        fetchedEncoding := device encodingOf:fontId.
    ].

    encoding notNil ifTrue:[
        (encoding ~= fetchedEncoding) ifTrue:[
            (( #( #'iso10646-1' #'ms-default' #'ms-ansi' #'ms-oem' ) includes:encoding)
            and:[ ( #( #'iso10646-1' #'ms-default' #'ms-ansi' #'ms-oem' ) includes:fetchedEncoding)]) ifFalse:[
                encoding ~= #* ifTrue:[
                    ('Font [warning]: encoding for "%1" should be %2; is %3 '
                        bindWith:self with: encoding with: fetchedEncoding) infoPrintCR.
                ].
            ].
        ].
    ] ifFalse:[
        encoding := fetchedEncoding.
    ].
    ascent := info ascent.
    descent := info descent.
    maxAscent := info maxAscent.
    maxDescent := info maxDescent.
    minWidth := info minWidth.
    maxWidth := info maxWidth.
    width := info averageWidth.

    width < minWidth ifTrue:[
        "/ some systems/fonts return a wrong value (0) as width of a space
        "/ - at least with X11 ...
        width := minWidth
    ].
    isFixedWidth := minWidth == maxWidth.

    "/ a temporary hack for the vista-cleartype font redraw problem
    false "isFixedWidth" ifFalse:[
        UserPreferences current workAroundRenderingBugOnVista ifTrue:[
            self hasOverlappingCharacters:true.
        ]
    ].       


Note: See TracTickets for help on using tickets.