From 77fd6c3b2db697ad8d608887c67e2fbba2700fa2 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Tue, 24 Jan 2023 12:13:54 +0100 Subject: [PATCH] proton: Install all available fonts to the prefix. This requires commit "loader: Install all fonts provided by Proton in the registry." in Wine, otherwise font support will be broken. --- proton | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/proton b/proton index b3d9d7a2..255791b6 100755 --- a/proton +++ b/proton @@ -706,33 +706,20 @@ class CompatData: tracked_files.write(tracked_name + "\n") def create_fonts_symlinks(self): - fontsmap = [ - ( g_proton.fonts_dir, "arial.ttf" ), - ( g_proton.fonts_dir, "arialbd.ttf" ), - ( g_proton.fonts_dir, "times.ttf" ), - ( g_proton.fonts_dir, "cour.ttf" ), - ( g_proton.fonts_dir, "courbd.ttf" ), - ( g_proton.fonts_dir, "msyh.ttf" ), - ( g_proton.fonts_dir, "simsun.ttc" ), - ( g_proton.fonts_dir, "msgothic.ttc" ), - ( g_proton.fonts_dir, "malgun.ttf" ), - ( g_proton.fonts_dir, "micross.ttf" ), - ( g_proton.fonts_dir, "nirmala.ttf" ), - - ( g_proton.wine_fonts_dir, "tahoma.ttf" ), - ] - windowsfonts = self.prefix_dir + "/drive_c/windows/Fonts" makedirs(windowsfonts) - for p in fontsmap: - lname = os.path.join(windowsfonts, p[1]) - fname = os.path.join(p[0], p[1]) - if file_exists(lname, follow_symlinks=False): - if os.path.islink(lname): - os.remove(lname) + for fonts_dir in [g_proton.fonts_dir, g_proton.wine_fonts_dir]: + for font in os.listdir(fonts_dir): + if not font.endswith('.ttf') and not font.endswith('.ttc'): + continue + lname = os.path.join(windowsfonts, font) + fname = os.path.join(fonts_dir, font) + if file_exists(lname, follow_symlinks=False): + if os.path.islink(lname): + os.remove(lname) + os.symlink(fname, lname) + else: os.symlink(fname, lname) - else: - os.symlink(fname, lname) def migrate_user_paths(self): #move winxp-style paths to vista+ paths. we can't do this in