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

OpenGL font rendering #8731

Closed
stormcone opened this issue Feb 22, 2021 · 1 comment
Closed

OpenGL font rendering #8731

stormcone opened this issue Feb 22, 2021 · 1 comment

Comments

@stormcone
Copy link
Contributor

If using font files, the OpenGL driver renders the fonts thinner than the SDL one. Is there a setting or some other thing that I can do to get back the boldness? I tried to set bold in the config file after the font names, but that way the fonts are too bold and pixelated.

Version of OpenTTD

20210222-master-mb67245d71e

Expected result

Similar font appearance as with the SDL driver.

Actual result

Thinner font appearance than with the SDL driver.

$ ./openttd -v sdl -d freetype=2,driver=1
dbg: [freetype] Initialized
dbg: [freetype] Requested 'DejaVu Sans', using 'DejaVu Sans Book'
dbg: [freetype] Requested 'Liberation Sans', using 'Liberation Sans Regular'
dbg: [freetype] Requested 'Liberation Serif', using 'Liberation Serif Regular'
dbg: [driver] Successfully loaded blitter '32bpp-anim'
dbg: [driver] SDL2: Mouse is at (707, 645), use display 0 (0, 0, 1920, 1080)
dbg: [driver] SDL2: using mode 1920x1054
dbg: [driver] SDL2: using driver 'x11'
dbg: [driver] Successfully loaded video driver 'sdl'
$ ./openttd -v sdl-opengl -d freetype=2,driver=1
dbg: [freetype] Initialized
dbg: [freetype] Requested 'DejaVu Sans', using 'DejaVu Sans Book'
dbg: [freetype] Requested 'Liberation Sans', using 'Liberation Sans Regular'
dbg: [freetype] Requested 'Liberation Serif', using 'Liberation Serif Regular'
dbg: [driver] Successfully loaded blitter '32bpp-anim'
dbg: [driver] SDL2: Mouse is at (405, 573), use display 0 (0, 0, 1920, 1080)
dbg: [driver] SDL2: using mode 1920x1054
dbg: [driver] SDL2: using driver 'x11'
dbg: [driver] OpenGL driver: NVIDIA Corporation - GeForce GTX 1050 Ti/PCIe/SSE2 (4.6.0 NVIDIA 460.39)

(Btw. the mono font is missing from the debug output. :))

SDL on the left, SDL-OpenGL on the right:
opentdd_font_render

Config file snippet:

small_font = Liberation Sans
medium_font = DejaVu Sans
large_font = Liberation Serif
mono_font = Liberation Mono
small_size = 12
medium_size = 16
large_size = 26
mono_size = 14
small_aa = true
medium_aa = true
large_aa = true
mono_aa = true

System:
Fedora 33
NVIDIA GeForce GTX 1050 Ti
NVIDIA driver 460.39

Steps to reproduce

  1. Set the config to use font files
  2. Start OpenTTD with -v sdl
  3. Start OpenTTD with -v sdl-opengl
  4. See the difference
@michicc
Copy link
Member

michicc commented Feb 23, 2021

Heh, totally forgot about font anti-aliasing. OpenGL video backend is currently causing the 8bpp blitter to be used if you don't load any 32bpp graphics as it is faster.

Fixing that isn't hard, I just wonder whether to force a 32bpp blitter for enabled anti-alias just with OpenGL or in general.

michicc added a commit to michicc/OpenTTD that referenced this issue Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants