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

Fixed broken Android build due to missing FreeType library #77314

Merged
merged 1 commit into from
Oct 26, 2024

Conversation

katemonster33
Copy link
Contributor

Summary

Build "Fixed broken Android build due to missing FreeType library"

Purpose of change

Android build broken since FreeType integration, fixing the build

Describe the solution

Since freetype static library is already included in SDL_ttf, just needed to add include statement to the compiler

Describe alternatives you've considered

Testing

Additional context

@github-actions github-actions bot added Code: Build Issues regarding different builds and build environments astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Oct 25, 2024
@katemonster33
Copy link
Contributor Author

@db48x I opened the build on android and it doesn't seem like freetype is enabled. Is this expected? Screenshot_20241024-224540.png

@db48x
Copy link
Contributor

db48x commented Oct 25, 2024

The default font (Roboto Medium) doesn’t have any Japanese characters so it’s falling back to asking SDL to render something (cata_imgui.cpp:451). You can edit your config/fonts.json to include a Japanese font and it will use it for the Japanese characters while building the texture atlas.

@katemonster33
Copy link
Contributor Author

@db48x seems like at the default terminal size used in the android build (80x24) the fonts all look real bad. With larger values it looks better. And yeah, English looks better. Screenshot_20241024-235236.png

@db48x
Copy link
Contributor

db48x commented Oct 25, 2024

Better, but still not as good as it should look. Can you open the ImGui Demo window, open the Style Editor, and show me the Fonts tab? What metrics are we using for the first font?

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Oct 25, 2024
@katemonster33
Copy link
Contributor Author

@db48x is this what you need? Looks like Roboto 16pt? Is that expected? It looks fine I think, I just wanted to be sure I've really fixed the android build. Screenshot_20241025-112708.png

@db48x
Copy link
Contributor

db48x commented Oct 25, 2024

Almost. Go to the fonts tab and show me the atlas and first page of the Roboto font.

It looks better than before, but compare the text in the game with the clock at the top of the screen. The text in the game should look like that!

From the screenshot, it looks like the screen is 2400×1080. What size is the game? 1080px/24rows = 45px text, not 16px. Why does the game think it should render text at 16px?

@katemonster33
Copy link
Contributor Author

I don't think I can do that on the Android build, unfortunately, because on Android the app hijacks the touch screen and doesn't allow you to click points on the screen using your finger.
I think that unfortunately the reason it looks like this is that Android draws at a resolution based on the terminal width and height and then simply up scales it to the phones screen size. I think the fonts just aren't going to look good on Android as long as we do it like that.

@db48x
Copy link
Contributor

db48x commented Oct 26, 2024

Ok, that’s fun. At least you’ve fixed the build.

@Maleclypse Maleclypse merged commit 8ab3163 into CleverRaven:master Oct 26, 2024
15 of 21 checks passed
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 Code: Build Issues regarding different builds and build environments json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants