Homebrew [PSA] Be careful using/creating custom system fonts.

PabloMK7

Red Yoshi! ^ω^
OP
Developer
Joined
Feb 21, 2014
Messages
2,614
Trophies
2
Age
24
Location
Yoshi's Island
XP
5,166
Country
Spain
Hello there! Recently I've got some complaints in my CTGP-7 discord server that the mod was either crashing or showing garbled text. It turned out the reason for those crashes and bugs was the usage of custom system fonts so I decided to make this thread to explain why that happens and how to prevent it.

What symptoms do buggy custom system fonts cause?
  • Garbled text, black squares, white squares or no text at all.
  • Missing characters and symbols, such as button symbols, special characters, etc
  • Crashes in homebrew apps or even official games.
Known homebrew applications having issues with custom system fonts:
  • CTRPF: Either the text is garbled or crashes.
  • FBI: Some custom fonts can cause crashes, preventing you from restoring the original working system font.
Why does that happen?

Custom system fonts are commonly saved with A8 color encoding. While many official apps are designed to support all the possible encodings, there are some situations where that isn't the case. The original system font is saved with A4 color encoding which uses less bits per pixels, apps that assume the system font is saved with A4, will show garbled text or will crash randomly.
Another problem is that A8 bcfnts are much bigger than the official one, taking more memory (shouldn't be a big issue tho).

As a user trying to install a custom font, what should I do?

You can always check if the custom font is properly created, for that do the following:
  1. Get 3dsfuse
  2. Open 3dsfuse and mount the custom system font cia
  3. Go to the new mounted cia->(folder with numbers)->romfs and grab the bcfnt.lz file you can find inside.
  4. Get 3dstool and put both the bcfnt and the exe in the same folder.
  5. Run "3dstool -uvf cbf_std.bcfnt.lz --compress-type lzex --compress-out file.bcfnt" in a command prompt, search in google how to execute commands in the command prompt if you don't know how.
  6. Open the new created file.bcfnt in a hex editor such as HxD and check the value circled in this screenshot. If the value is 0B then it is a good font and can be used without any problems. If the value is another one (the most common being 08 then it is a buggy custom system font.) NOTE: Changing that value to 0B won't fix it, but will make it worse :P
As a developer trying to create a custom font, what should I do?

Check the following link to see how custom fonts should be properly created: https://pastebin.com/ZCy0uzux
 
Last edited by PabloMK7,
D

Deleted User

Guest
Thanks for the solution. I'm gonna fix/redo dozens of my custom fonts if I have much free time.
 
D

Deleted User

Guest
Just want to add: If you install a bad font using FBI, reinstalling a reliable font may not be as easy, since FBI also crashes with certain fonts.
 
  • Like
Reactions: PabloMK7

The Real Jdbye

*is birb*
Member
Joined
Mar 17, 2010
Messages
23,373
Trophies
4
Location
Space
XP
13,976
Country
Norway
Hello there! Recently I've got some complaints in my CTGP-7 discord server that the mod was either crashing or showing garbled text. It turned out the reason for those crashes and bugs was the usage of custom system fonts so I decided to make this thread to explain why that happens and how to prevent it.

What symptoms do buggy custom system fonts cause?
  • Garbled text, black squares, white squares or no text at all.
  • Missing characters and symbols, such as button symbols, special characters, etc
  • Crashes in homebrew apps or even official games.
Known homebrew applications having issues with custom system fonts:
  • CTRPF: Either the text is garbled or crashes.
Why does that happen?

Custom system fonts are commonly saved with A8 color encoding. While many official apps are designed to support all the possible encodings, there are some situations where that isn't the case. The original system font is saved with A4 color encoding which uses less bits per pixels, apps that assume the system font is saved with A4, will show garbled text or will crash randomly.
Another problem is that A8 bcfnts are much bigger than the official one, taking more memory (shouldn't be a big issue tho).

As a user trying to install a custom font, what should I do?

You can always check if the custom font is properly created, for that do the following:
  1. Get 3dsfuse
  2. Open 3dsfuse and mount the custom system font cia
  3. Go to the new mounted cia->(folder with numbers)->romfs and grab the bcfnt.lz file you can find inside.
  4. Get 3dstool and put both the bcfnt and the exe in the same folder.
  5. Run "3dstool -uvf cbf_std.bcfnt.lz --compress-type lzex --compress-out file.bcfnt" in a command prompt, search in google how to execute commands in the command prompt if you don't know how.
  6. Open the new created file.bcfnt in a hex editor such as HxD and check the value circled in this screenshot. If the value is 0B then it is a good font and can be used without any problems. If the value is another one (the most common being 08 then it is a buggy custom system font.) NOTE: Changing that value to 0B won't fix it, but will make it worse :P
As a developer trying to create a custom font, what should I do?

Check the following link to see how custom fonts should be properly created: https://pastebin.com/ZCy0uzux
So this isn't really an issue with the fonts. It's an issue with dumb homebrews being hardcoded to only accept a certain format. I think it would be better if the buggy homebrews were edited to make them behave the same way official software does.
 

PabloMK7

Red Yoshi! ^ω^
OP
Developer
Joined
Feb 21, 2014
Messages
2,614
Trophies
2
Age
24
Location
Yoshi's Island
XP
5,166
Country
Spain
dumb homebrews being hardcoded to only accept a certain format.
That's both stupid and rude to the respective homebrew developers. When a file is being replaced by another one, you should always keep the file format 100% equal, otherwise expect problems to happens. Moreover I have mentioned that even official games suffer this problem.
 

The Real Jdbye

*is birb*
Member
Joined
Mar 17, 2010
Messages
23,373
Trophies
4
Location
Space
XP
13,976
Country
Norway
That's both stupid and rude to the respective homebrew developers. When a file is being replaced by another one, you should always keep the file format 100% equal, otherwise expect problems to happens. Moreover I have mentioned that even official games suffer this problem.
I don't see how.
Official software supports it, so why shouldn't homebrew support it? Official software defines the standard for how homebrew should behave and the goal should always be to get homebrew behaving as closely as possible to official software.
It's likely that homebrew devs never considered that this might be a problem in the future, and I certainly don't blame them for that if that's what you think. But it's good coding practice to not hardcode things unless necessary. You never know if Nintendo might change something in the future that breaks homebrew due to things being hardcoded. That doesn't just apply to this, it applies to all things related to the system software.
 
Last edited by The Real Jdbye,
  • Like
Reactions: Miku-sensei

Deleted member 424658

Annoying Weaboo Girl
Member
Joined
Jun 4, 2017
Messages
499
Trophies
0
Age
24
Website
www.reddit.com
XP
677
Country
United States
I don't see how.
Official software supports it, so why shouldn't homebrew support it? Official software defines the standard for how homebrew should behave and the goal should always be to get homebrew behaving as closely as possible to official software.
It's likely that homebrew devs never considered that this might be a problem in the future, and I certainly don't blame them for that if that's what you think. But it's good coding practice to not hardcode things unless necessary. You never know if Nintendo might change something in the future that breaks homebrew due to things being hardcoded. That doesn't just apply to this, it applies to all things related to the system software.
Custom Fonts still don't work properly in many games. Smash 4's text is all broken using custom fonts.
 
  • Like
Reactions: Deleted User

The Real Jdbye

*is birb*
Member
Joined
Mar 17, 2010
Messages
23,373
Trophies
4
Location
Space
XP
13,976
Country
Norway
Custom Fonts still don't work properly in many games. Smash 4's text is all broken using custom fonts.
I see, that changes things slightly. Although that was probably an oversight on Nintendo's part, since you'd think that if the 3DS supports the format then it would work. Anyway, converting fonts to A4 is easy enough.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Psionic Roshambo @ Psionic Roshambo:
    I just want a Pokemon Hell Raiser fan game 😭
  • K3Nv2 @ K3Nv2:
    Anyone wanna play with my joydock
  • BigOnYa @ BigOnYa:
    Biomutant looks cool tho, may have to try that
  • Quincy @ Quincy:
    Usually when such a big title leaks the Temp will be the first to report about it (going off of historical reports here, Pokemon SV being the latest one I can recall seeing pop up here)
  • K3Nv2 @ K3Nv2:
    I still like how a freaking mp3 file hacks webos all that security defeated by text yet again
  • BigOnYa @ BigOnYa:
    They have simulators for everything nowdays, cray cray. How about a sim that shows you playing the Switch.
  • K3Nv2 @ K3Nv2:
    That's called yuzu
    +1
  • BigOnYa @ BigOnYa:
    I want a 120hz 4k tv but crazy how more expensive the 120hz over the 60hz are. Or even more crazy is the price of 8k's.
  • K3Nv2 @ K3Nv2:
    No real point since movies are 30fps
  • BigOnYa @ BigOnYa:
    Not a big movie buff, more of a gamer tbh. And Series X is 120hz 8k ready, but yea only 120hz 4k games out right now, but thinking of in the future.
  • K3Nv2 @ K3Nv2:
    Mostly why you never see TV manufacturers going post 60hz
  • BigOnYa @ BigOnYa:
    I only watch tv when i goto bed, it puts me to sleep, and I have a nas drive filled w my fav shows so i can watch them in order, commercial free. I usually watch Married w Children, or South Park
  • K3Nv2 @ K3Nv2:
    Stremio ruined my need for nas
  • BigOnYa @ BigOnYa:
    I stream from Nas to firestick, one on every tv, and use Kodi. I'm happy w it, plays everything. (I pirate/torrent shows/movies on pc, and put on nas)
  • K3Nv2 @ K3Nv2:
    Kodi repost are still pretty popular
  • BigOnYa @ BigOnYa:
    What the hell is Kodi reposts? what do you mean, or "Wut?" -xdqwerty
  • K3Nv2 @ K3Nv2:
    Google them basically web crawlers to movie sites
  • BigOnYa @ BigOnYa:
    oh you mean the 3rd party apps on Kodi, yea i know what you mean, yea there are still a few cool ones, in fact watched the new planet of the apes movie other night w wifey thru one, was good pic surprisingly, not a cam
  • BigOnYa @ BigOnYa:
    Damn, only $2.06 and free shipping. Gotta cost more for them to ship than $2.06
  • BigOnYa @ BigOnYa:
    I got my Dad a firestick for Xmas and showed him those 3rd party sites on Kodi, he loves it, all he watches anymore. He said he has got 3 letters from AT&T already about pirating, but he says f them, let them shut my internet off (He wants out of his AT&T contract anyways)
  • K3Nv2 @ K3Nv2:
    That's where stremio comes to play never got a letter about it
  • BigOnYa @ BigOnYa:
    I just use a VPN, even give him my login and password so can use it also, and he refuses, he's funny.
  • BigOnYa @ BigOnYa:
    I had to find and get him an old style flip phone even without text, cause thats what he wanted. No text, no internet, only phone calls. Old, old school.
    BigOnYa @ BigOnYa: I had to find and get him an old style flip phone even without text, cause thats what he wanted...