Environment:
CDE Version: 2.5.3
OS: OpenBSD 7.9
I am trying to set up a font fallback mechanism for CJK characters in an en_US.UTF-8 environment. By default, CJK characters are rendered as a mismatched combination of different fonts and sizes. To make them look uniform, I attempted to specify exact CJK fonts (like MingLiU) alongside Latin fonts by modifying ~/.dt/sessions/home/dt.resources.
However, modifying the font list causes severe rendering issues, with different CDE components (especially the title bars and dtterm) reacting very inconsistently to the font fallback definitions.
Here are the things I tried and the results:
Appending a CJK font to the default font: (e.g., FontList: -dt-interface system-medium-r-normal-s-------, -dynalab-mingliu-medium-r-normal--14----m-*-iso10646-1:)
Result: Upon restarting the session, all text turns into Chinese character gibberish (mojibake). Curiously, the gibberish characters are not rendered in the MingLiU font I specified, but in some other random font. The same issue occurs with other CJK fonts.
Using lucida bright as the primary font:
Result: Filenames, dtterm areas suffer from spacing/ghosting issues (they use monospace fonts by default). CJK characters do not fall back correctly; instead, they are converted into weird symbol combinations native to the Latin font.
Using only a CJK font (MingLiU) for everything:
Result: Most UI elements render the English letters the font provided correctly. However, the window title bars fail to use the font and regress to a tiny, basic X core sans-serif font.
Combining lucida bright and a CJK font (e.g., lucida bright, mingliu):
Result: Most text displays normally though I didn't test CJK characters. However, window title bars (dtwm) turn into "tofu" (empty square boxes).
Using lucida sans typewriter:
Result: Filenames in the file manager display relatively normally, but the terminal (dtterm) fails and falls back to the same tiny basic X core sans-serif font mentioned.
In conclusion, there is a significant compatibility issue with how different CDE components parse and apply font fallbacks in UTF-8 locales. The window manager (dtwm) title bars and the terminal (dtterm) are particularly fragile, often falling back to a hardcoded tiny X core font.
Replacing dt-interface-user (monospace) with lucida sans typewriter:
Result: The text actually disappears completely.
Using only a CJK font (MingLiU) as the default:
Result: The CJK characters fail to display and instead turn into a jumbled mix of Latin characters.
I just made a crucial discovery: the lucida bright font that partially worked was a system-provided font (likely a legacy core X font). However when I load user-imported TrueType Lucida Bright Font , it behaves exactly like the lucida sans typewriter mentioned earlier, the text simply disappears completely.
Yeah, sorry about that - I think fonts are one of the weakest aspects of this CDE. Unfortunately I don't know enough about them to be able to help here. Hopefully someone more versed can provide some help, or even better a reworked font handling system in CDE, like XFT or something similar.
Hi Jon,
Thanks for getting back to me - no worries at all. I completely understand that legacy X11/Motif font handling is notoriously difficult to work with. Btw I really like how the default sharp, non-anti-aliased fonts look, I'm just kinda looking for customized fallback system. I’ll leave this ticket open as a reference point in case anyone decides to tackle the font system or XFT rework in the future. Thanks for keeping CDE alive and for all your hard work on the project!