2

The Ubuntu Nerd font is installed on the system.

xfontsel defines the font. As you can see in the screenshot, the Cyrillic alphabet is displayed correctly (the last line)

enter image description here

man iso_8859-5 it tells me under which code I can get one or another character of my encoding

enter image description here

In the Xresources configuration file I am specifying the sequence of the Cyrillic alphabet:

...
Xlogin*titleMessage:             \260\261\262\263\264\265\266
xlogin*greeting:                 \260\261\262\263\264\265\266
xlogin*namePrompt:               Username:\040
xlogin*passwdPrompt:             Password:\040
xlogin*fail:                     Authentication failed
...
xlogin*greetFont:                -*-ubuntu nerd font-*-r-normal-*-17-120-100-100-*-*-iso8859-5
xlogin*font:                     -*-ubuntu nerd font-*-r-normal-*-17-120-100-100-*-*-iso8859-5
xlogin*promptFont:               -*-ubuntu nerd font-*-r-normal-*-17-120-100-100-*-*-iso8859-5
xlogin*failFont:                 -*-ubuntu nerd font-*-r-normal-*-17-120-100-100-*-*-iso8859-5
xlogin*greetFace:                Ubuntu Nerd Font-14:bold
xlogin*face:                     Ubuntu Nerd Font-10
xlogin*promptFace:               Ubuntu Nerd Font-12:bold
xlogin*failFace:                 Ubuntu Nerd Font-10:bold

But when starting xdm, I get the wrong characters that I specified in the configuration file.

enter image description here

What could be the problem?

I have already tried various solutions to the problems. The locale is set in the required encoding. The Xresources file is also in UTF-8 format. I've already tried everything. But as a result, when I output the text, I get a two-byte representation of each Cyrillic character. It feels like xdm doesn't understand UTF-8.

UPD1:

Unicode is not output

Xlogin*titleMessage:             Добро пожаловать
xlogin*greeting:                 Добро пожаловать
xlogin*namePrompt:               Пользователь:\040
xlogin*passwdPrompt:             Пароль:\040
xlogin*fail:                     Ошибка аутентификации

xlogin*greetFont:                -*-ubuntumono nerd font mono-*-r-normal-*-17-120-100-100-m-*-iso8859-5
xlogin*font:                     -*-ubuntumono nerd font mono-*-r-normal-*-17-120-100-100-m-*-iso8859-5
xlogin*promptFont:               -*-ubuntumono nerd font mono-*-r-normal-*-17-120-100-100-m-*-iso8859-5
xlogin*failFont:                 -*-ubuntumono nerd font mono-*-r-normal-*-17-120-100-100-m-*-iso8859-5
xlogin*greetFace:                Ubuntumono Nerd Font-14:bold:italic
xlogin*face:                     Ubuntumono Nerd Font-10
xlogin*promptFace:               Ubuntumono Nerd Font-12:bold
xlogin*failFace:                 Ubuntumono Nerd Font-10:bold

enter image description here

UPD2:

Another setting option. It feels like xdm doesn't see the specified font:

enter image description here

xlogin*titleMessage:             Добро пожаловать
xlogin*greeting:                 Добро пожаловать
xlogin*namePrompt:               Пользователь:\040
xlogin*passwdPrompt:             Пароль:\040
xlogin*fail:                     Ошибка аутентификации

xlogin*greetFont:                -*-ubunt nerd font-*-r-*-*-*-*-*-*-*-*-*-uni
xlogin*font:                     -*-ubunt nerd font-*-r-*-*-*-*-*-*-*-*-*-uni
xlogin*promptFont:               -*-ubunt nerd font-*-r-*-*-*-*-*-*-*-*-*-uni
xlogin*failFont:                 -*-ubunt nerd font-*-r-*-*-*-*-*-*-*-*-*-uni
xlogin*greetFace:                Ubuntu Nerd Font-14:bold:italic
xlogin*face:                     Ubuntu Nerd Font-10
xlogin*promptFace:               Ubuntu Nerd Font-12:bold
xlogin*failFace:                 Ubuntu Nerd Font-10:bold

enter image description here

1 Answer 1

2

The greeter for xdm (in Debian and derived systems) uses Xft for drawing the string (see source code):

# define DRAW_STRING(f, x, y, m, l) \
    /* Debug("DRAW_STRING(%s, %d, %d, %s, %d)\n", #f, x, y, m, l); */ \
    XftDrawString8 (w->login.draw, &w->login.f##color, w->login.f##Face, \
            x, y, (FcChar8 *) (m), l)

Xft provides a few variations of string-drawing (see manual):

Families of Functions
       Xft provides groups of drawing functions which differ according to  the
       way  the  data is encoded, e.g., 8-bit (ISO-8859-1) versus UTF-8.  Here
       is a summary of these related functions:

       Encoding   XftDrawString*       XftTextExtents*       XftTextRender*
       -------------------------------------------------------------------------
       8          XftDrawString8       XftTextExtents8       XftTextRender8
       16         XftDrawString16      XftTextExtents16      XftTextRender16
       16BE       XftDrawString16      XftTextExtents16      XftTextRender16BE
       16LE       XftDrawString16      XftTextExtents16      XftTextRender16LE
       32         XftDrawString32      XftTextExtents32      XftTextRender32
       32BE       XftDrawString32      XftTextExtents32      XftTextRender32BE
       32LE       XftDrawString32      XftTextExtents32      XftTextRender32LE
       UTF-8      XftDrawStringUtf8    XftTextExtentsUtf8    XftTextRenderUtf8
       UTF-16     XftDrawStringUtf16   XftTextExtentsUtf16   XftTextRenderUtf16

The greeter uses greetFont for the non-Xft configuration (see source code):

#ifndef USE_XFT
    {XtNfont, XtCFont, XtRFontStruct, sizeof (XFontStruct *),
    offset (textFont), XtRString,   "*-new century schoolbook-medium-r-normal-*-180-*"},
    {XtNpromptFont, XtCFont, XtRFontStruct, sizeof (XFontStruct *),
    offset (promptFont), XtRString, "*-new century schoolbook-bold-r-normal-*-180-*"},
    {XtNgreetFont, XtCFont, XtRFontStruct, sizeof (XFontStruct *),
    offset (greetFont), XtRString,  "*-new century schoolbook-bold-i-normal-*-240-*"},
    {XtNfailFont, XtCFont, XtRFontStruct, sizeof (XFontStruct *),
    offset (failFont), XtRString,   "*-new century schoolbook-bold-r-normal-*-180-*"},
#else /* USE_XFT */
    {XtNface, XtCFace, XtRXftFont, sizeof (XftFont *),
        offset (textFace), XtRString, "Serif-18"},
    {XtNpromptFace, XtCFace, XtRXftFont, sizeof (XftFont *),
        offset (promptFace), XtRString, "Serif-18:bold"},
    {XtNgreetFace, XtCFace, XtRXftFont, sizeof (XftFont *),
        offset (greetFace), XtRString, "Serif-24:italic"},
    {XtNfailFace, XtCFace, XtRXftFont, sizeof (XftFont *),
        offset (failFace), XtRString, "Serif-18:bold"},
    {XtNforeground, XtCForeground, XtRXftColor, sizeof(XftColor),
        offset(textcolor), XtRString,   XtDefaultForeground},
    {XtNpromptColor, XtCForeground, XtRXftColor, sizeof(XftColor),
        offset(promptcolor), XtRString, XtDefaultForeground},
    {XtNgreetColor, XtCForeground, XtRXftColor, sizeof(XftColor),
        offset(greetcolor), XtRString,  XtDefaultForeground},
    {XtNfailColor, XtCForeground, XtRXftColor, sizeof (XftColor),
    offset(failcolor), XtRString,   XtDefaultForeground},
#endif

The xdm manpage tells you about this difference:

       xlogin.Login.greetFace
              The face used to display the greeting when built with  Xft  sup‐
              port.  The default is ‘‘Serif‐24:italic’’.

       xlogin.Login.greetFont
              The  font  used  to display the greeting when not built with Xft
              support.

Because you did not configure a font face, the greeter uses the default font (which according to the Xft manual, is limited to an eight-bit encoding such as ISO-8859-1 or ISO-8859-5).

1
  • So, I have specified these parameters in the configuration. Nothing changes. My question shows the configuration of the font setting, where I specified both xlogin*greetFont and xlogin*greetFace. Mar 28 at 7:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .