Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Linux Wine Font Fallback (Read 871 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Linux Wine Font Fallback

I've been running into some issues recently with Wine font fallback on Linux (Linux Mint 22.1, Wine Staging 10.4~noble - 1). I have tried to follow all the methods in the topic at https://hydrogenaud.io/index.php/topic,122072.0.html, but none of these methods ended up working. I ended up using the HKEY_CURRENT_USER\Software\Wine\Fonts\Replacements instead, which did allow me to render the fonts I desired together (Lexend Deca & Shippori Gothic B2 Bold).

The issue is that these fonts seem to align properly in some CUI tabs and misalign in others. For example, they are aligned in the OpenLyrics tab
X
X
but not in the playlist view.
X

To achieve this, I edited the following registry keys to:
Code: [Select]
"MS UI Gothic"="Shippori Gothic UI"
"SimSun"="Shippori Gothic UI"

The MS UI Gothic change changed the font in everything except Playlist View, while SimSun (strangely, given it is a Korean font) changed the font in Playlist View.

If anyone could explain the strangeness of this solution to me as well as the Wine font fallback process, that would be greatly appreciated.
It's AcTuAlLy Engapmahc. That's pronounced [ingæpʰmæʃ].

Re: Linux Wine Font Fallback

Reply #1
If I understand you want to use Lexend Deca as your primary font and Shippori Gothic B2 Font as fallback for the characters missing in Lexend (cjk, japanese, etc)
Have you tried this method?
https://hydrogenaud.io/index.php/topic,121786.msg1023231.html#msg1023231
I uses that with Segoe UI and the fonts copied from Windows install + some other symbol ones and do the job

The key is
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink]

X

and make sure that you use the font names as wine see them

X

Then selecting the font in winecfg and the program it use the fallback for every simbol not included in the font. In the order you put them in the substitution

My current Segoe UI

Code: [Select]
MEIRYO.TTC,Meiryo UI,128,96
MEIRYO.TTC,Meiryo UI
MSGOTHIC.TTC,MS UI Gothic
MSJH.TTC,Microsoft JhengHei UI,128,96
MSJH.TTC,Microsoft JhengHei UI
MSYH.TTC,Microsoft YaHei UI,128,96
MSYH.TTC,Microsoft YaHei UI
MALGUN.TTF,Malgun Gothic,128,96
MALGUN.TTF,Malgun Gothic
MINGLIU.TTC,PMingLiU
SIMSUN.TTC,SimSun
GULIM.TTC,Gulim
YUGOTHM.TTC,Yu Gothic UI,128,96
YUGOTHM.TTC,Yu Gothic UI
FONT AWESOME 6 FREE-REGULAR-400.OTF,Font Awesome 6 Free Regular
FONT AWESOME 6 BRANDS-REGULAR-400.OTF,Font Awesome 6 Brands Regular
FONTAWESOME-WEBFONT.TTF,FontAwesome
SEGUISYM.TTF,Segoe UI Symbol
SEGUIEMJ.TTF,Segoe UI Emoji
SEGMDL2.TTF,Segoe MDL2 Assets
SEGFI.TTF,Segoe Fluent Icons
TAHOMA.TTF,Tahoma
ARIAL-UNICODE-MS.TTF,Arial Unicode MS
.

As long as I select Segoe UI it show the fallbacks ins every panel

Korean in playlist

X

in facets

X

in bio (smp script)

X

symbols from fontawasome, etc

X



Re: Linux Wine Font Fallback

Reply #2
Well, I tried what you outlined here. I definitely misunderstood the instructions first time around. This time, I was able to edit the font stack for Segoe UI, and the loaded Japanese font did in fact change. Here is the registry value and result.

Code: [Select]
ShipporiGothicB2-Bold.ttf,Shippori Gothic B2 Bold
MEIRYO.TTC,Meiryo UI,128,96
MEIRYO.TTC,Meiryo UI
MSGOTHIC.TTC,MS UI Gothic
MSJH.TTC,Microsoft JhengHei UI,128,96
MSJH.TTC,Microsoft JhengHei UI
MSYH.TTC,Microsoft YaHei UI,128,96
MSYH.TTC,Microsoft YaHei UI
MALGUN.TTF,Malgun Gothic,128,96
MALGUN.TTF,Malgun Gothic
MINGLIU.TTC,PMingLiU
SIMSUN.TTC,SimSun
GULIM.TTC,Gulim
YUGOTHM.TTC,Yu Gothic UI,128,96
YUGOTHM.TTC,Yu Gothic UI
Font Awesome 6 Free-Regular-400.otf,Font Awesome 6 Free Regular
Font Awesome 6 Brands-Regular-400.otf,Font Awesome 6 Brands Regular
FONTAWESOME-WEBFONT.TTF,FontAwesome
SEGUISYM.TTF,Segoe UI Symbol
SEGUIEMJ.TTF,Segoe UI Emoji
SEGMDL2.TTF,Segoe MDL2 Assets
SEGFI.TTF,Segoe Fluent Icons
TAHOMA.TTF,Tahoma
ARIAL-UNICODE-MS.TTF,Arial Unicode MS

X

Unfortunately, you might be able to tell that the Playlist View is still rendering fonts differently. I presume that means that it has its own font fallback mechanism separate from the other components (why???).

If anyone knows what the hell is going on here, that would be great. I haven't had the time to learn about making JSplitter/SMP's work on Linux yet in general, much less so a custom playlist viewer. I presume I might not be facing that issue if I just switched to something else.

I was able to get proper font fallback working for Segoe UI, but not for Lexend Deca. Here are my results. Lexend Deca shows up as such in foobar2000, so I named the registry key that. It has the exact same value as the Segoe UI one. Is this the correct method?

X

Didn't work again for playlist view; Japanese text is obviously not Shippori Gothic B2 Bold, but rather Source Han Sans.

Any help or testing ideas would be appreciated. In the meantime, I might just look into switching playlist viewers if I can get it in everything but that. Or switching to Default UI. Also thanks for the help so far  @paregistrase.

Additionally, trying to replace Segoe UI with Lexend via registry as I outlined above did not work at all.
It's AcTuAlLy Engapmahc. That's pronounced [ingæpʰmæʃ].

Re: Linux Wine Font Fallback

Reply #3
I think these fixes (suggested by @paregistrase & other people) are the same you already tried, but just to be sure...
https://github.com/regorxxx/Playlist-Manager-SMP/wiki/Wine-(Unix-compatibility)#fonts-and-square-symbols-for-non-latin-chars

Also note CUI allows to set different fonts for different UI elements, be sure you have not set another font for playlist views! Which could explain why it's using different fonts as fallback.

Re: Linux Wine Font Fallback

Reply #4
I think these fixes (suggested by @paregistrase & other people) are the same you already tried, but just to be sure...
https://github.com/regorxxx/Playlist-Manager-SMP/wiki/Wine-(Unix-compatibility)#fonts-and-square-symbols-for-non-latin-chars

Also note CUI allows to set different fonts for different UI elements, be sure you have not set another font for playlist views! Which could explain why it's using different fonts as fallback.

This is the same solution I believe. Also, I have been making sure to set all the fonts in CUI to follow the Common fonts selections. The font fallback really seems to just be inherently different for playlist view and switcher. Thanks for the sanity check, though.

I also want to use these tricks to make the main Latin font something other than Segoe UI, but font fallback doesn't work when a non-Segoe UI font (or non-any that is there by default, actually) is selected as the main common font in CUI.
It's AcTuAlLy Engapmahc. That's pronounced [ingæpʰmæʃ].

Re: Linux Wine Font Fallback

Reply #5
I made a new prefix to test with only a fallback for lexend with Shippor and the problem seems to be that Shippor only have bold style

The fallback is
Name: Lexend Deca Regular
value: SHIPPORIGOTHICB2_BOLD.TTF,Shippori Gothic B2 Bold


X

and lexend have all styles

X

so the fallback only works well in bold mode

Shippor for reference
X

and now Lexend with the fallback

Regular
X
Bold
X


Maybe use one font that support all styles for the fallback....





Re: Linux Wine Font Fallback

Reply #6
I suppose that's the same for any font, so if that's the case, I will add a warning about this to the wiki too

Re: Linux Wine Font Fallback

Reply #7
I suppose that's the same for any font, so if that's the case, I will add a warning about this to the wiki too
In the wine registry there a entry for regular, bold, black,italic, etc for almost every foont

X

To make the fallback of SegoeUI in the heading (Segoe UI,16,1) of bio panel it need and independent SegorUI bold (negrita) registry entry

X

but mixing a regular with a bold as fallback is the first time that I tried

Re: Linux Wine Font Fallback

Reply #8
I made a new prefix to test with only a fallback for lexend with Shippor and the problem seems to be that Shippor only have bold style

The fallback is
Name: Lexend Deca Regular
value: SHIPPORIGOTHICB2_BOLD.TTF,Shippori Gothic B2 Bold

so the fallback only works well in bold mode

Maybe use one font that support all styles for the fallback....
Huh, I had no idea that would've been the case. Thanks for the insight @paregistrase.
It's AcTuAlLy Engapmahc. That's pronounced [ingæpʰmæʃ].

Re: Linux Wine Font Fallback

Reply #9
I tested this in DUI and CUI, and it seems like the playlist view problem still only persists in the CUI playlist viewer. Again I'll look into alternatives, but I'll go leave a reply in the CUI thread to see if I can get an answer there.
It's AcTuAlLy Engapmahc. That's pronounced [ingæpʰmæʃ].