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

Cleanup: Seperate platform-specific code for font handling. #8666

Merged
merged 5 commits into from Feb 13, 2021

Conversation

michicc
Copy link
Member

@michicc michicc commented Feb 13, 2021

Motivation / Problem

A lot of platform-specific code for font handling is mashed into two files with lots of #ifdefs sprinkled around. Separating it makes for more readable code.

Description

OS-specific code is moved into files in the various OS directories. As Fontconfig is only used for Unix-oid systems, it's implementation is moved into os/unix. FreeType code stays in the normal fontcache.cpp file.

Limitations

The current code is quite complicated with how stuff like settings globals are enabled/disabled. This PR simplifies this by always enabling them no matter if TrueType fonts are actually used.

In the best case, the compiler/linker will just strip them out, in the worst case the binaries gets a few bytes larger than needed.

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

Copy link
Member

@TrueBrain TrueBrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; I am sure people will complain when you broke it, and I am sure you will fix it. So .. YOLO!

@michicc michicc merged commit 63ed3f3 into OpenTTD:master Feb 13, 2021
@michicc michicc deleted the pr/split_font branch February 13, 2021 19:09
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

Successfully merging this pull request may close these issues.

None yet

2 participants