google / xsecurelock

X11 screen lock utility with security in mind
Apache License 2.0
869 stars 65 forks source link

Support colorful TTF emoji fonts #83

Open maximbaz opened 5 years ago

maximbaz commented 5 years ago

Hey,

I was really excited to see the new XSECURELOCK_PASSWORD_PROMPT=emoji, but I'm not able to make it work with colorful emoji fonts like JoyPixels (former EmojiOne) or Google Noto Color Emoji.

The README says:

You can get a list of supported font names by running xlsfonts and fc-list.

I have JoyPixels font installed system-wide in /usr/share/fonts/TTF/JoyPixels.ttf. Tried both commands, only one of them finds the font:

❯ xlsfonts | rg joy

❯ fc-list | rg joy                        
/usr/share/fonts/TTF/JoyPixels.ttf:
JoyPixels:style=Regular

I have tried several ways to enable the font:

❯ XSECURELOCK_PASSWORD_PROMPT=emoji XSECURELOCK_FONT=JoyPixels xsecurelock
X Error of failed request:  BadLength (poly request too large or internal Xlib length error)
  Major opcode of failed request:  139 (RENDER)
  Minor opcode of failed request:  20 (RenderAddGlyphs)
  Serial number of failed request:  48
  Current serial number in output stream:  49
2019-07-06T13:27:21Z 8784 xsecurelock: read: unexpected end of file.
2019-07-06T13:27:21Z 8773 xsecurelock: auth child failed with status 1.

❯ XSECURELOCK_PASSWORD_PROMPT=emoji XSECURELOCK_FONT="JoyPixels:style=Regular" xsecurelock
X Error of failed request:  BadLength (poly request too large or internal Xlib length error)
  Major opcode of failed request:  139 (RENDER)
  Minor opcode of failed request:  20 (RenderAddGlyphs)
  Serial number of failed request:  48
  Current serial number in output stream:  49
2019-07-06T13:28:24Z 9491 xsecurelock: read: unexpected end of file.
2019-07-06T13:28:24Z 9477 xsecurelock: auth child failed with status 1.

Am I missing something? Are you able to use colorful emojis? Is it even possible to specify multiple fonts, for text and for emojis?

Can I provide more information for debug purposes?

If you want to try, you can grab JoyPixels.ttf here

divVerent commented 5 years ago

Unfortunately I don't know what it takes to make such fonts work - it might be the case that libXft cannot handle them and we need a different font rendering library for that.

The error seems to indicate that the problem is not the colors but the complexity of the font.

normanr commented 4 years ago

Perhaps related: https://gitlab.freedesktop.org/xorg/lib/libxft/issues/6

When using pango-view with --backend=ft2 the test emoji isn't rendered in color (but pango-view doesn't crash. With --backend=cairo the emoji renders as expected. I'm not sure that using cairo instead of xft would be an option for the unlock prompt, but that would be a potential work around.

sw-diva-e commented 4 years ago

installing fonts-symbola solved an similar issue for me

maximbaz commented 4 years ago

Symbola is not colorful though 🙂

smac89 commented 3 years ago

I am experiencing this issue myself, but it's much worse.

I try to use the emoji prompt as well, by running this command:

XSECURELOCK_FONT='Noto Color Emoji' XSECURELOCK_PASSWORD_PROMPT=emoji xsecurelock

Unfortunately, when I get to the lockscreen, there is no prompt, just a blank screen. I tried moving my mouse, or just entering the password anyways, but nothing worked to exit the application. I had to resort to doing a hard reboot.

opentokix commented 2 years ago

Is anything being done with this top priority issue?