Page MenuHomeWildfire Games

Use 2x scale fonts when gui.scale < 1
AbandonedPublic

Authored by domdomegg on Apr 17 2017, 11:43 PM.

Details

Reviewers
Dariost
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Trac Tickets
#3876
Summary

Use 2x scale fonts when gui.scale < 1, and alias said fonts. Makes it a much better experience for players on hidpi screens.

Trac ticket #3876

Dependent on D328

Test Plan

Test Plan: Check everything looks good at various levels of gui.scale, and we get no crashes due to missing fonts etc.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

domdomegg created this revision.Apr 17 2017, 11:43 PM

Because of the way this is written, it should be very easy to generate 4x fonts if people require. However, generating larger and larger size fonts isn't ideal, would be best to integrate TrueType if we kept adding even more sizes.

Dariost added a reviewer: Restricted Owners Package.Apr 18 2017, 11:44 AM
Dariost edited edge metadata.

I think it's better to add D328 as a dependency and consider gui.scale accoring to that patch.

I couldn't test this patch as pyrogenesis crashed with this error:

tex_codec.cpp(70): Function call failed: return value was -120101 (Unknown error (-120101, 0xFFFFFFFFFFFE2ADB))
Function call failed: return value was -120101 (Unknown error (-120101, 0xFFFFFFFFFFFE2ADB))
Location: tex_codec.cpp:70 (tex_codec_for_header)

P.S. I haven't yet reviewed the code, but I think it's better to add a space between operand and operator (e.g. it's better to write a * b instead of a*b)

domdomegg updated this revision to Diff 1330.Apr 18 2017, 1:21 PM

Fix text inputs, use direct gui.scale (now dependent on D328)

domdomegg edited the summary of this revision. (Show Details)Apr 18 2017, 1:22 PM

I'd strongly prefer fixing the font rendering code to use Pango (and thus Harfbuzz, which would also solve display issues with a few languages) and use font files directly instead of what we are doing now.

We are already having some issues with fonts given that we ship ~100MB font files for 3 languages, so doubling that size for this seems even worse.

wraitii abandoned this revision.Jul 28 2020, 10:15 AM
wraitii added a subscriber: wraitii.

I agree with leper above and I don't think this is ever getting in, further discussion has died -> closing.