singalen / wesnoth

iOS development fork of Wesnoth
http://www.wesnoth.org/
GNU General Public License v2.0
3 stars 0 forks source link

Font doesn’t look sharp. #86

Open singalen opened 6 years ago

singalen commented 6 years ago

my eyes hurt because of the font, it doesn’t look sharp. I have iPad Pro 10.5, can something be done with this matter?

There is no issue in mainline Wesnoth for this, as it was deemed too subjective. HighDPI font support on iOS needs to be done, though.

there was a discussion comparing 1.12 and 1.13 font rendering. 1.13 looked much brickier. \ to me. Subjectively.

Font scaling commit must have something to do with it.

singalen commented 6 years ago

Relevant pieces of Discord log:

24.05.2017: [20:00] shadowm: Huh, 1.12's font rendering looks completely different to how I remember. [20:00] shadowm: Not sure if it's because I installed FreeType 2.7. [20:01] shadowm: Oh right, it must be that because Wesnoth 1.12 uses medium/full hinting, and that's precisely what changed in FT 2.7.(змінено) [20:01] Vultraz: oh, that reminds me [20:01] Vultraz: the green font tint [20:01] Vultraz: tell me more [20:02] Vultraz: something about "don't use subpixel hinting on non-opaque surfaces"? [20:03] shadowm: (Namely, it now looks like this, compared to... just look at any 1.12 screenshot on https://wiki.wesnoth.org/Screenshots, really.) https://cdn.discordapp.com/attachments/259976436490829825/317135634915393536/Spectacle.K27050.png

[20:05] shadowm: @Vultraz https://github.com/wesnoth/wesnoth/commit/cfb1f8e098655d3a9d9dd96df5ee5f525e89d5fb GitHub font: Provide our own fontconfig settings (bug #20337) · wesnoth/wesnoth@cfb1f8e Due to an unfortunate combination of Cairo's use of premultiplied alpha and our engine expecting to be able to blit pre-rasterized text surfaces with an alpha channel into arbitrary surfaces, we ca...

[20:05] shadowm: My commit fails to mention the more general principle. [20:06] shadowm: In order for subpixel hinting to work as intended, the algorithm must be aware of the color data of the surface on which the text is intended to be rendered. [20:07] shadowm: Otherwise, it must make some dangerous assumptions -- for example, assume the text is going to be rendered on a pure black or pure white surface. [20:07] shadowm: Wesnoth 1.12 through 1.13.2 (i.e. the last dev release I did) render text primarily onto fully-transparent surfaces instead. [20:08] Vultraz: Would https://github.com/wesnoth/wesnoth/commit/c91b200b7a10bf82fb13417a1267fcdf0fc4b2c1 have affected this GitHub ttext: tweaks to rendering, especially on Windows · wesnoth/wesnoth@c91b200 This restores some code that wasn't being used on Windows to strip pre-multiplied alpha from the text render before passing it to SDL_CreateRGBSurfaceFrom. Despite the code comment to the contrary,...

[20:08] shadowm: As a posterior step, those surfaces are eventually blitted onto whatever the actual render target is -- for example, the story screen or a button. [20:08] Vultraz: Yes, I know. I don't know of any other way to do it [20:09] shadowm: By the nature of the process, it's impossible for subpixel hinting to work correctly because the color data for the glyph render target changes, so it ought to be disabled entirely, which is what I did for 1.12 and 1.13.1 or 1.13.2. [20:09] shadowm: Or 1.13.0. [20:09] shadowm: I don't remember which. It was a 1.13.x. [20:09] shadowm: And yes, it essentially means you need to use CAIRO_ANTIALIAS_GRAY on Windows. [20:10] Vultraz: read my commit message, though [20:10] Vultraz: :/ [20:10] Vultraz: Unless I'm misunderstanding, pango_cairo_show_layout would get called 4 times on Windows. Removing 3 of those calls meant the use of CAIRO_ANTIALIAS_GRAY as a fix for bug #21648 now resulted in horrible-looking text. Changing the AA method to CAIRO_ANTIALIAS_GRAY now seems to produce acceptable results. [20:10] shadowm: But now you get green-tinted text. Or did, I don't remember if the last dev release still has the issue. [20:11] shadowm: fires up Windows 8.1 VM. [20:12] shadowm: Apparently not anymore. [20:12] shadowm: So I assume you changed something since 1.13.7/since you gave me those screenshots. [20:12] Vultraz: not that I know of... [20:13] shadowm: Well, I know for certain my Pango/Cairo environment for Windows hasn't changed since 1.13.2. [20:14] Vultraz: but you're right, i see no green text in game [20:14] Vultraz: well.. maybe a tiny bit green. I can't tell. [20:14] shadowm: Easy. Take a screenshot of the preferences dialog, zoom on it on the GIMP or whatever, and see how many colors there are around the individual glyphs. [20:15] Vultraz: oh, I've never seen green text in places like that [20:15] shadowm: https://cdn.discordapp.com/attachments/259976436490829825/317138523968765953/unknown.png [20:15] Vultraz: wedge has, apparently [20:15] Vultraz: ill ask him to confirm [20:16] Vultraz: I wonder if it would be any way efficient to render text with a texture and not a surface [20:17] shadowm: knows nothing about SDL 2 [20:17] Vultraz: why does no one know anything about SDL 2 :frowning: [20:17] shadowm: Well, I for one don't know anything about SDL 1.2 either. [20:17] shadowm: I haven't ever written an actual game engine. [20:18] Vultraz: I've been diving into it to try to figure out how to update our rendering pipeline [20:18] Vultraz: seems SDL2 is much easier to work with than SDL1.2 [20:18] Vultraz: (just the impression I get from anecdotes) [20:18] Vultraz: the API is pretty simple [20:18] Vultraz: using it effectively is... not [20:19] shadowm: Here's an example of RGB subpixel hinting screwing things up in one of the PNG originals of your 1.13.7 screenshots: [20:19] shadowm: https://cdn.discordapp.com/attachments/259976436490829825/317139611056996355/unknown.png [20:19] Vultraz: good god [20:20] shadowm: (Both pictures are 4x the size of the original crops.) [20:21] shadowm: SDL is crossplatform and that's great, but it's still challenging in that it requires you to understand how things like graphics work at a relatively low level (even more if you use OpenGL). [20:21] shadowm: It's like C++. [20:21] Vultraz: yeah... [20:22] Vultraz: oh well, I'm learning Skills(змінено) [20:22] shadowm: It's a neat abstraction layer but it doesn't completely erase or hide the complexities permeating the platform.

2018-04-23: jyrkive: Easiest fix would be disabling font smoothing. [14:15] sinda: Ah, so that will help? Fantastic :smile: [14:16] sinda: @Rusack your screenshot is quite small (half resolution?) and in jpg, so sadly it doesn't illustrate the point.(змінено) [14:17] jyrkive: Assuming you're talking about the weird translucent lines which are supposed to be opaque (especially in in-game chat), yes. That translucency is the result of the font smoothing algorithm. [14:18] jyrkive: Hinting is supposed to ensure that lines are always visible and clear, and we should already be using it. [14:18] jyrkive: But if it doesn't help, fully disabling font smoothing is the brute-force solution. [14:18] BOTGitHub:

grz0 [wesnoth/wesnoth] Issue opened: #2956 Lua error in Dark Forecast map It always happens in turn >=53 !lua_error

Version: 1.13.13 Platform: Windows 10 [14:19] jyrkive: (I have font smoothing disabled in Windows settings because I want highest possible contrast and clarity. I don't care about smoothness. And as a side effect, I don't experience Wesnoth's font issues at all.) [14:27] BOTIRC: for me disabling font smoothing makes ingame chat look slightly better, but everywhere else much much worse

singalen commented 6 years ago

Another forum post referring to fonts in 1.13 vs 1.12: https://forums.wesnoth.org/viewtopic.php?f=5&t=46094&p=616173#p616173

singalen commented 6 years ago

Specificallu Rusack meant HiDPI fonts (Wesnoth compared to native app): wesnoth-smoothing-ipad10