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:
    Nintendo should do a health PSA like that lol
  • K3Nv2 @ K3Nv2:
    Nintendo becomes responsible for 2024s virus
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Only 666 dollars for 24TBs lol
  • K3Nv2 @ K3Nv2:
    Two of these half the price Seagate Barracuda Pro 12TB Internal Hard Drive Performance HDD – 3.5 Inch SATA 6 Gb/s 7200 RPM 256MB Cache for Computer Desktop (ST12000DM0007) (Renewed) https://a.co/d/cpVKNo1
  • BigOnYa @ BigOnYa:
    *Renewed. I don't like or trust "renewed, refurbished, reconditioned" anything.
  • K3Nv2 @ K3Nv2:
    I renewed your wife
    +1
  • BigOnYa @ BigOnYa:
    Renewed is like following Psi around on his dates, then when he done doing the deed, he taps me in without her cleaning up first, no thanks
    +1
  • K3Nv2 @ K3Nv2:
    That's not being renewed that's unlocking more medical bills from stds
    +1
  • BigOnYa @ BigOnYa:
    Somethings maybe, but drives are rated in hours, so most likely many hours already on them. I just don't trust em for data. Maybe a used(renewed) car or something be ok tho.
  • K3Nv2 @ K3Nv2:
    I like my girls like my car made in 2000
    +1
  • BigOnYa @ BigOnYa:
    I like my products new, not buying a box of condoms (renewed)
  • K3Nv2 @ K3Nv2:
    You already learned from buying used condoms from the first kid
  • K3Nv2 @ K3Nv2:
    Tyrone said it was barley used
    +1
  • K3Nv2 @ K3Nv2:
    Wonder whatever happened to that ownage pranks guy
  • BigOnYa @ BigOnYa:
    I dont know why people hate on Starfield, I think its dope. I didn't play it day one, only started it couple weeks ago so maybe they fixed issues with updates already.
  • K3Nv2 @ K3Nv2:
    Microsoft could release a poop simulator and people will say it's shit
  • Quincy @ Quincy:
    Hold up hooolddd uuupppp, we're less than a week from PM:TTYD releasing and it has not leaked yet? :o Miracles do still exist in this dystopia 🤣
  • BigOnYa @ BigOnYa:
    True. People hated on Fallout 76 at first also, but they still have huge numbers playing online.
  • BigOnYa @ BigOnYa:
    What is PM:TTYD
  • Quincy @ Quincy:
    Paper Mario: The Thousand-Year Door
  • Psionic Roshambo @ Psionic Roshambo:
    I think I played that one
  • Quincy @ Quincy:
    (i.e. Nintendos' next first party switch title/remake)
  • BigOnYa @ BigOnYa:
    Meh, I want metroid 4
  • Psionic Roshambo @ Psionic Roshambo:
    I have a refurbished hard drive like 8TBs just use it for movies and music so if it blows up nothing I can't replace lol
    Psionic Roshambo @ Psionic Roshambo: I have a refurbished hard drive like 8TBs just use it for movies and music so if it blows up...