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

Standalone PPSSPP flatpak on Steam Deck showing blank squares instead of Japanese characters #18659

Closed
3 of 5 tasks
sweetsosweet opened this issue Jan 1, 2024 · 23 comments
Closed
3 of 5 tasks
Labels
SDL2 Issue on SDL (or Qt in SDL code) but not all ports.
Milestone

Comments

@sweetsosweet
Copy link

sweetsosweet commented Jan 1, 2024

Game or games this happens in

none and NPJH50459 v1.01

What area of the game / PPSSPP

Either in the save game data or when trying to name a new character, I only get blank squares in the translated version of 7th Dragon 2020 instead of English/Japanese text. It works fine on Android as well as in the PPSSPP core for retroarch on Steam Deck, but in the standalone app it only shows empty squares.

I've added the font files to the asset folder. Before adding this my list of UI languages under system settings was only English, and after adding this it populated multiple languages, however the language is still black squares even in the UI.

When I switch to Japanese (I think) from this list the system starts loading very slowly until I switch back to English.

I'm not sure if this is system related, because I can see Japanese text in the actual JP ini file, but it just doesn't show up in the standalone app. Not sure what I may be doing wrong.

Also note I would prefer to use the standalone so I can use the same savestates across my android devices and Steam Deck.

Here are some screenshots from the Deck:

Screenshot_20240101_122802
Screenshot_20240101_120221
Screenshot_20240101_120313
Screenshot_20240101_120323
Screenshot_20240101_120346

Here is a screenshot from the Retroarch core on Steam Deck (Edited to add):

Screenshot_20240101_123605

Here are some screenshots from Android for comparison:

Screenshot_20240101-115631
Screenshot_20240101-120417
Screenshot_20240101-120428

What should happen

The Japanese text should be in Japanese, but only shows open squares

Logs

No response

Platform

Linux / BSD

Mobile device model or graphics card (GPU)

Steam Deck

PPSSPP version affected

v1.16.6

Last working version

No response

Graphics backend (3D API)

Vulkan

Checklist

  • Test in the latest git build in case it's already fixed.
  • Search for other reports of the same issue.
  • Try resetting settings or older versions and include if the issue is related.
  • Try without any cheats and without loading any save states.
  • Include logs or screenshots of issue.
@hrydgard
Copy link
Owner

hrydgard commented Jan 1, 2024

I think this is the same issue with the flatpak as #18474 . No solution yet

@sweetsosweet
Copy link
Author

Oh I see thank you, I couldn't find the same issue in a search...

@sweetsosweet
Copy link
Author

Wanted to add that I do have the fonts installed by default on my system, hope there's a fix soon:

Screenshot_20240101_131728

@Mr-Beacon00
Copy link

try to replace default ttf font?
it's located in /var/lib/flatpak/app/org.ppsspp.PPSSPP/x86_64/stable/"numbers"/files/share/ppsspp/assets/Roboto-Condensed.ttf

@LunaMoo
Copy link
Collaborator

LunaMoo commented Jan 2, 2024

Roboto-Condensed.ttf doesn't contain japanese we use inside PPSSPP UI and changing it will not do much, we generate japanese font from ARIALUNI.ttf into font_atlas.zim where it's used from, possibly someone generated the font atlas without having that font and potentially used replacement which is missing kanji or maybe even removed unicode fonts altogether.

Flatpack isn't really official release, and not sure about it's changes and limitations, but if that's possible within your platform, try copying assets from official release. or generate new font_atlas adding your choice of japanese font.

@hrydgard
Copy link
Owner

hrydgard commented Jan 2, 2024

@LunaMoo I don't think that's what's happening. If the current platform appears to support "native" font rendering (or rather, if we have written support for it, which we have for Linux now), we don't use the atlas for general text rendering at all, instead we render text block by text block and cache them.

Unfortunately it seems that one some systems we fail to pick a font that has the symbols we need when doing this, or we fail in some other way and fall back to just the small atlas. Not sure what the case is here.

@LunaMoo
Copy link
Collaborator

LunaMoo commented Jan 2, 2024

Isn't flatpak "sandboxed" which would make system fonts unavailable?

@LunaMoo
Copy link
Collaborator

LunaMoo commented Jan 2, 2024

Maybe this: NixOS/nixpkgs#119433

@Mr-Beacon00
Copy link

Ubuntu 64 位-2024-01-03-15-26-32
I don't have Steam Deck, but i test it on Ubuntu. replaced default font with japanese font. at least UI text is okay now.

@hrydgard
Copy link
Owner

hrydgard commented Jan 3, 2024

I think it's the font detection that isn't working then...

See USE_SDL2_TTF_FONTCONFIG in the code, I guess if that isn't set in the build, we won't detect fonts properly.

@hrydgard hrydgard added the SDL2 Issue on SDL (or Qt in SDL code) but not all ports. label Jan 3, 2024
@hrydgard hrydgard added this to the v1.17.0 milestone Jan 3, 2024
@kaishin
Copy link

kaishin commented Jan 8, 2024

I have the same issue on both Steam Deck and Pop_OS!
Happy to help with testing or providing additional details.

@kaishin
Copy link

kaishin commented Jan 8, 2024

Just as @Mr-Beacon00 I can confirm that replacing the font with one that supports CJK solves the issue.

@thesourcehim
Copy link
Contributor

I have the same issue with UI in Fedora 39, built from source, not flatpack. I see the following in font_atlasscript.txt:
font UBUNTU24 C:/Windows/Fonts/ARIALUNI.ttf UWEhkcRGHKVTe 30 0

So does this mean if I build under linux, I can't have unicode fonts? I have ARIALUNI.ttf, but build system does not look for it?

@hrydgard
Copy link
Owner

hrydgard commented Jan 9, 2024

@thesourcehim I think there's just something screwed up in the build process for flatpaks, leading us to not look for fonts properly. Because this does work on plain linux when self-built.

@thesourcehim
Copy link
Contributor

But I build from source using b.sh (release 1.16.6), I don't use flatpack, and yet Japanese characters are broken. I have Microsoft fonts installed and configured in fontconfig. Text editors and other office applications can use them.

@hrydgard
Copy link
Owner

hrydgard commented Jan 9, 2024

might be that you have to install sdl2-ttf and fontconfig, and then build..

@thesourcehim
Copy link
Contributor

thesourcehim commented Jan 9, 2024

I have it installed along with it's development package:
SDL2_ttf-2.20.2-2.fc39.x86_64
SDL2_ttf-devel-2.20.2-2.fc39.x86_64

Can I gather some verbose build log to see what goes wrong?

Update: as far as I can see font_atlas.zim is directly copied from assests subfolder of the repo, not generated during build.
Edit: forgot to mention, that my problem only with UI text, in-game text (in PSP2i jp version for example) is fine.

@hrydgard
Copy link
Owner

In #18732 I'm adding "Droid Sans Fallback" to the list of fonts we try to load. This seems to be present on a very regular Ubuntu install, and can easily be installed as described in the PR if not.

can someone check if this font is pre-installed on Steam Deck?

@hrydgard hrydgard modified the milestones: v1.17.0, v1.18.0 Jan 19, 2024
@sweetsosweet
Copy link
Author

Doesn't look like it's on Steam Deck by default I think?

Screenshot_20240119_182301

@hrydgard
Copy link
Owner

Hm, ok. But presumably we can figure out one that will work if we add it to the list. Though, it does feel like there should be a better way to do this..

@sweetsosweet can you check which one of these fonts are quite large on disk? Or see if there's another one named something like Fallback.

@sweetsosweet
Copy link
Author

Ok, I couldn't find anything including Fallback, and most fonts are a few hundred kbs. I found the Noto fonts are all very large though, 16-25 mbs:

Screenshot_20240119_213607

/usr/share/fonts/TTF/DejaVuSans.ttf is about 740kb

@thesourcehim
Copy link
Contributor

Just tested with 9fdcef9
My UI problem is solved, Japanese characters are ok.

@hrydgard
Copy link
Owner

Thanks for testing. I'm gonna close this, please re-open if it happens again (I dunno, maybe they change the names for the font files...)

@hrydgard hrydgard modified the milestones: v1.18.0, v1.17.0 Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SDL2 Issue on SDL (or Qt in SDL code) but not all ports.
Projects
None yet
Development

No branches or pull requests

6 participants