Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails with unsupported pixel mode. #52

Closed
IllanFed opened this issue Feb 14, 2017 · 6 comments

Comments

Projects
None yet
2 participants
@IllanFed
Copy link

commented Feb 14, 2017

After correct build can`t start kitty, fails with error:

File "./kitty/fonts/freetype.py", line 125, in render_to_bitmap
    format(text, bitmap.pixel_mode)
ValueError: FreeType rendered the glyph for ' ' with an unsupported pixel mode: 0.

I tried different font_family(Hack, monospace, etc).
Problem in fonts, fontconfig or something different?

System info:

# cat /etc/issue
Debian GNU/Linux 8 \n \l

# dpkg -l|grep 'fontconfig\|glfw\|glew' 
ii  fontconfig                            2.11.0-6.3+deb8u1                    amd64        generic font configuration library - support binaries
ii  fontconfig-config                     2.11.0-6.3+deb8u1                    all          generic font configuration library - configuration
ii  fontconfig-infinality                 1-2                                  all          Configuration files for freetype-infinality
ii  glew-utils                            2.0.0-3                              amd64        OpenGL Extension Wrangler - utilities
ii  libglew-dev:amd64                     2.0.0-3                              amd64        OpenGL Extension Wrangler - development environment
ii  libglew1.10:amd64                     1.10.0-3                             amd64        OpenGL Extension Wrangler - runtime environment
ii  libglew2.0:amd64                      2.0.0-3                              amd64        OpenGL Extension Wrangler - runtime environment
ii  libglfw3:amd64                        3.2.1-1                              amd64        portable library for OpenGL, window and input (x11 libraries)
ii  libglfw3-dev:amd64                    3.2.1-1                              amd64        portable library for OpenGL, window and input (development files)

# /opt/python3.5/bin/python3.5 -V                                              
Python 3.5.3

# xdpyinfo -version
xdpyinfo 1.3.1

# xsel --version
xsel version 1.2.0 by Conrad Parker <conrad@vergenet.net>
@kovidgoyal

This comment has been minimized.

Copy link
Owner

commented Feb 14, 2017

Hmm, that's strange error, its basically an invalid value being returned from freetype for rendering characters. https://www.freetype.org/freetype2/docs/reference/ft2-basic_types.html#FT_Pixel_Mode

It may be that the error is harmless and can be ignored, you can try that by changing line 122 in freetype.py in the kitty source code to

if False:

and see if the font is rendered anyway.

@IllanFed

This comment has been minimized.

Copy link
Author

commented Feb 14, 2017

If ignore this error - kitty starts, but symbols can`t render.

kitty_issue1

@kovidgoyal

This comment has been minimized.

Copy link
Owner

commented Feb 14, 2017

Oh well, worth a try. I tried the Hack font on my linux system, it renders fine in kitty -- dont know what else to suggest.

@IllanFed

This comment has been minimized.

Copy link
Author

commented Feb 14, 2017

I am guessing conflict with freetype-infinality, i will check it.

@IllanFed

This comment has been minimized.

Copy link
Author

commented Feb 14, 2017

After build from source last version of freetype it works.
https://sourceforge.net/projects/freetype/files/

tar xf freetype-2.7.1.tar.gz && cd freetype-2.7.1
./autogen.sh
make
sudo make install
export LD_LIBRARY_PATH="/usr/local/lib;/opt/python3.5/lib"
/opt/python3.5/bin/python3.5 ../../kitty/
@kovidgoyal

This comment has been minimized.

Copy link
Owner

commented Feb 14, 2017

I'm not aware of anything in the kitty code that requires very new versions of freetype, but then I am not a freetype expert. What was the old version of freetype on your system?

If anyone comes up with anything in freetype.c that can be changed, I'll be happy to accept a pull request. In the meantime I'm closing this issue, as I can't see anything wrong in the kitty freetype code. Feel free to re-open if I am wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.