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

Check the typeface file exists #75937

Merged
merged 2 commits into from
Aug 26, 2024

Conversation

alef
Copy link
Contributor

@alef alef commented Aug 25, 2024

Summary

Bugfixes "Check the typeface file exists"

Purpose of change

@NetSysFire reported a crash after #75920. AddFontFromFileTTF aborts if the file path to the font does not exists.

Describe the solution

load_fonts now use the first existing typeface path instead of the user's first one which may be invalid. unifont is already forcibly added so we assume there will be always a valid typeface.

Describe alternatives you've considered

Testing

Built with vscode+cmake on Windows. fonts.json.typeface to contain invalid path. Game loads using next existing font file.

Additional context

@github-actions github-actions bot added Info / User Interface Game - player communication, menus, etc. [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) json-styled JSON lint passed, label assigned by github actions labels Aug 25, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Aug 25, 2024
@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Aug 25, 2024
@alef alef marked this pull request as ready for review August 25, 2024 17:45
@Maleclypse Maleclypse merged commit 058c8c3 into CleverRaven:master Aug 26, 2024
36 of 43 checks passed
@alef alef deleted the fix-crash-typeface-75920 branch August 26, 2024 11:30
alef added a commit to alef/Cataclysm-DDA that referenced this pull request Aug 26, 2024
* Check the typeface file exists

* Obey lint
Knut-Aage-Hofseth pushed a commit to Knut-Aage-Hofseth/Cataclysm-DDA that referenced this pull request Aug 29, 2024
* Check the typeface file exists

* Obey lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants