Skip to content

Conversation

@TellowKrinkle
Copy link
Member

@TellowKrinkle TellowKrinkle commented Nov 23, 2025

Description of Changes

  • Allow use of system fonts
  • Load all language fonts instead of just the one supported by the current locale
  • mmap fonts instead of copying them into memory
  • Enable non-English game titles in FSUI
  • Allow slightly wider title strings on horizontal FSUI buttons
  • Center icons in their buttons on the FSUI nav bar

Fixes #12804

Rationale behind Changes

  • No more prompts to download fonts when using non-latin languages unless your system is missing that font
  • Don't need to ship 25MB Noto Color Emoji on Windows (still needed on macOS and Linux)
  • Can use non-English game titles in FSUI
  • Non-English characters in paths render properly in FSUI
  • Save ~75MB of ram when using the 25MB Noto Color Emoji font

Suggested Testing Steps

  • Delete any downloaded fonts from your PCSX2 directory
  • Make sure you don't get prompted to download any fonts (unless on Linux and don't have Noto fonts)
  • Make sure non-English game titles render properly in FSUI
  • Make sure fonts look nice in your language in FSUI (Arabic is still broken, sorry)
  • Make sure line height looks reasonable everywhere in FSUI (lines shouldn't look like they're squished against each other)

Notes

  • Font sizes have changed for non-latin fonts. Translators will need to re-check FSUI to make sure their translations still fit.
  • Linux packagers should add Noto Sans {CJK, Arabic, Hebrew, Devanagari} to the recommended dependencies of their packages.

Did you use AI to help find, test, or implement this issue or feature?

No

@TellowKrinkle TellowKrinkle force-pushed the AllTheFonts branch 2 times, most recently from 2f63b04 to 03f7350 Compare November 26, 2025 04:36
Copy link
Contributor

@TheLastRar TheLastRar left a comment

Choose a reason for hiding this comment

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

translation.cpp needs to be formatted, any sections where you disagree with clang-format probably should have // clang-format off/on comments added.

I've not reviewed the added freetype code or the patches to imgui.

Comment on lines -20 to 30
void SetFontPath(std::string path);
struct FontInfo
{
std::span<const u8> data;
std::span<const u32> exclude_ranges;
const char* face_name;
bool is_emoji_font;
};

/// Sets a list of fonts to use.
void SetFonts(std::vector<FontInfo> info);

Copy link
Contributor

Choose a reason for hiding this comment

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

Given how we have to tread emoji fonts separately, would it make sense to pass those fonts as a second parameter instead of having to check is_emoji_font eveytime we iterate info?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hopefully in the future we can treat emoji fonts less special, and it'll just be an is_emoji_font ? color : grayscale.

I'd like to keep them together.

Copy link
Contributor

Choose a reason for hiding this comment

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

Aside from the Glyph*AdvanceX setting, the main special treatment needed would be filtering the Variation Selector codepoints.
I'm suspecting that will probably be needed for as long as we use ImGui for text rendering.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahh true

I'd still like them together since it allows the font selection code to have minimal extra stuff to work around imgui's brokenness.

Copy link
Member Author

Choose a reason for hiding this comment

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

Side note, I'd like to get rid of the forced advance at some point, since it affects the spacing when used in normal text. If we want them to use a fixed amount of space when being used as icons, we should do that by separately rendering the icon and giving it a fixed amount of space, not by editing the font (which is shared by normal text rendering) to make it monospace.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd still like them together since it allows the font selection code to have minimal extra stuff to work around imgui's brokenness.

I guess it's a question where you think it's best to handle it.
I'm still inclined to think in translation is better, where you are already filtering the emoji font due to ImGui's broken bitmap and missing COLv1 support.
But I guess that is up to you.

Side note, I'd like to get rid of the forced advance at some point.

We should, outside of the settings interfaces I think there are a few other locations relying on forced advance, but outside the scope here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm still inclined to think in translation is better, where you are already filtering the emoji font due to ImGui's broken bitmap and missing COLv1 support.

0001-FSUI-Separate-font-and-emoji-font-lists.patch

Is this what you were thinking? Because it doesn't really help specialize that filtering for only emoji fonts or anything.
(The filtering isn't even applied to all emoji fonts, since it wouldn't properly allow a non-SVG COLRv0 or B&W emoji font.)

Copy link
Contributor

Choose a reason for hiding this comment

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

I mentioned the filtering as more of an example of translations working around ImGui issues, rather then anything to be address. (It looks fine to me).

Your patch does look reasonable, when I to a poke at it I had looked at TryLoadFonts/DownloadFontIfMissing instead TheLastRar@122c5fb

Copy link
Member Author

Choose a reason for hiding this comment

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

Not a huge fan of either patch tbh, but I'd prefer mine if we have to use one

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess it's fine

Maybe a 3rd opinion would serve as a deciding factor.

Protects against all the other stuff we load eating up all the address space that we want
@TellowKrinkle TellowKrinkle force-pushed the AllTheFonts branch 3 times, most recently from c716ff3 to 2618ccc Compare November 29, 2025 05:47
@spaceage64
Copy link

I have a question: instead of relying on Noto Color Emoji, can’t it instead just take the OS’s color emoji font and work with that? Then there is no longer a need to include Noto just for some emojis.

@TellowKrinkle
Copy link
Member Author

I have a question: instead of relying on Noto Color Emoji, can’t it instead just take the OS’s color emoji font and work with that? Then there is no longer a need to include Noto just for some emojis.

It does that on Windows.

Apple Color Emoji isn't currently renderable, since it's bitmap based, which isn't supported by imgui+Freetype.

Most Linux distros ship Noto Color Emoji, but it comes in Bitmap, SVG, and COLRv1 versions and SVG is the only one imgui supports. That's the biggest of the three, so most Linux distros do not ship it. Fedora recently switched from Bitmap to COLRv1, neither of which we can render.

Copy link
Contributor

@TheLastRar TheLastRar left a comment

Choose a reason for hiding this comment

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

Had a quick look at the achievement FSUI and spacing looked okay.

Code changes look fine, Pending another reviewers opinion on #13589 (comment)

ocornut responded to your request ocornut/imgui#8857
Can you perhaps respond to them given it's relevance to your patch?

@TellowKrinkle
Copy link
Member Author

Can you perhaps respond to them given it's relevance to your patch?

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Japanese Game Title for Big Picture Mode

5 participants