otavepto / gbe_fork

Fork of https://gitlab.com/Mr_Goldberg/goldberg_emulator
https://gitlab.com/Mr_Goldberg/goldberg_emulator
GNU Lesser General Public License v3.0
191 stars 55 forks source link

Overlay Font Problem (invalid ImGui glyphs ranges) #119

Closed Kirius88 closed 3 months ago

Kirius88 commented 3 months ago

Hello! Thanks for the update! But there is a problem(

Here I attached a screenshot with a problem with cyrillic characters: https://github.com/otavepto/gbe_fork/issues/99#issuecomment-2009407761

Unfortunately, this problem remains in the latest version "release-sdk_159-overlay_font". No matter what font I choose in “overlay_appearance.txt” the result is the same: instead of some letters - ?

For the test, I entered all the letters of the Russian alphabet into the file "achievements.json" in one of the achievements. Both capital letters and small ones. The result in the game is:

test2

Instead of 17 capital letters this ? symbol. Same with 2 small letters.

otavepto commented 3 months ago

Can you post the 2 strings shown in the picture in text form here please. Edit: Found an offender character "\u0451", Unifont and Roboto have a glyph for it, I assume it's a bug in the glyph ranges collected https://github.com/otavepto/gbe_fork/blob/5ddbfccfdd17ba2ed716ce7326a9d87531959eb3/overlay_experimental/steam_overlay.cpp#L291-L295

Edit 2: Yup that's the broken code, a quick hack

font_builder.AddText(u8"ё");

Solved it! image

Achievements strings are already being loaded dynamically, so the broken code is definitely this part https://github.com/otavepto/gbe_fork/blob/5ddbfccfdd17ba2ed716ce7326a9d87531959eb3/overlay_experimental/steam_overlay.cpp#L247-L250 I'll look into it.

otavepto commented 3 months ago

Done, download this build artifact when Github finishes: https://github.com/otavepto/gbe_fork/actions/runs/8547526894

image

otavepto commented 3 months ago

I've also pushed a hotfix release. Will close this one for now. Feel free to open a new issue if you faced other problems 👍 .