k4zmu2a / SpaceCadetPinball

Decompilation of 3D Pinball for Windows – Space Cadet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PB_MSGFT.bin and other font questions

AlphaNERD- opened this issue · comments

Hello there,

i've recently cloned your repo in order to work on the UI. Initially i set out to make a more controller-friendly UI for Space Cadet for devices such as the ASUS ROG Ally or Steam Deck. However i figured that the first thing i wanted to do is fix the font for other languages.

I recreated the font of Space Cadet in FontStruct (available here, turns out it's very easy if you have a dot matrix font and your font editor is a grid) and made additional characters to cover many european languages, FontStruct is free to use so you or other people can pick it up and modify the font there.

So now i have two questions:

  1. Would you be open to adding that font to Space Cadet?
  2. If yes, how can i convert this font for Space Cadet?
  3. How can i make a pull request anyway? I forked the PS Vita port and because of that Github didn't allow me to fork your repo directly for a PR down the road.

Hello.
First of all, here is some PB font theory:
Original 3DPB game used:
• For English version:
o In-game text: bitmap fonts (such as PB_MSGFT.bin and PINBALL2.MID)
o UI: system font
• For other localizations: system font for both UI and in-game text
Original FT game used:
• For English version:
o In-game text: bitmap font (embedded into .dat)
o UI: system font
• For other localizations: I don’t know, never seen a localized copy
My version of the game supports:
• Original bitmap fonts, all variations
• TTF fonts, currently has only English font embedded

Now for the answers:

  1. As is it right now – probably not.
    It has different dot pattern, density and outline compared to the original.
    Original bitmap font has this high-density VFD look; I am not sure how to best represent it using vector fonts.
    Using either some kind of dot pattern or solid color lines of averaged color. Whatever looks closets to the original when drawn by ImGUI.
  2. The game supports vector fonts in .TTF format.
    I’d rather not add another bitmap font in proprietary PB_MSGFT.bin-like format.
  3. You must fork this repo if you want to make PRs for this project.
    Making changes in Vita source port and PRing them here makes no sense.

My plans regarding fonts:
V2.1 ships with .TTF font backend but no embedded font for most of the languages.
My first goal is to fix this by adding an embedded pan-Unicode font (probably Noto).
This new font will be used for both GUI and in-game messages, like it was done in 3DPB.
Latin languages covered by the original bitmap font will keep using it for in-game messages.
This change will also include new font setup GUI, for configuring font size and anti-aliasing.

My stance on font recreation:
I consider the task of recreating and extending the original bitmap font as a luxury feature, to be done after all essential features.
Technically, there is a way to load multiple .TFF fonts and switch between them on the fly.
So that the in-game messages render using dot style font while GUI uses regular font.
I am not against accepting such font as PR ahead of dev schedule, as long as it meets my arbitrary criteria)

Extra 1:
Sample of the original font from FT, 3DPB uses the same asset at the lowest resolution.
image