Closed PFGimenez closed 5 years ago
Does this issue persist if you change the flags to tcod.FONT_LAYOUT_ASCII_INROW | tcod.FONT_TYPE_GREYSCALE
?
I'm afk at the moment, I can test in about one hour.
This is the result with tcod.FONT_LAYOUT_ASCII_INROW | tcod.FONT_TYPE_GREYSCALE
:
(it's completely black)
The magic pink background could mess up the font loader, anything other than white on black is ambiguous. Here's a version with a black background:
It works ! Thank you. Is it normal that the pink version worked with the libtcod version of http://rogueliketutorials.com ?
I'm not sure, maybe?
There are two font loaders in libtcod: the original one for the SDL
, OPENGL
, and GLSL
renderers; and the one made by me for the SDL2
and OPENGL2
renderers.
When I tested the font with SDL
, OPENGL
, and GLSL
I got three different results.
My font loader ignores the FONT_TYPE_GREYSCALE
flag and individually converts greyscale glyphs to white-with-alpha, but assumes any glyph with colors will provide its own alpha. As expected the font loads as white on pink glyphs multiplied by the foreground color with this loader.
If the problem comes from the font I used, I guess you can close this issue.
I was confused about the tileset format for a little while but it looks like it's just using magic pink as a key-color. I could eventually add automatic support for this in the new font loader.
I noticed that libtcod guesses automatically the key color using the space (' ') character, if it can help you : https://github.com/libtcod/libtcod/blob/master/src/libtcod/sys_sdl_c.cpp#L330
You can now use those tilesets as-is in the latest versions of python-tcod and libtcod, as long as it's using one of the newer renderers.
That's me again
Problem
When I load a custom non-square font with the auto renderer (GLSL), the font is not properly loaded. In this example, I try to print "Hello World!". It works fine with the SDL renderer.
What I expect (obtained with the SDL renderer):
What I see with the auto renderer (again, the yellow border is drawn by my OS):
Minimal example code
Configuration
I use python 3.7.2+, python-tcod 8.3.2 and SDL 2.0.9 on Debian testing. I got the same problem with another computer (Ubuntu 18.04) with SDL 2.0.8.
Resource
The custom font can be downloaded here: http://dwarffortresswiki.org/images/4/4a/Andux_cp866ish.png