@@ -224,6 +224,44 @@ def apply_cmd_settings(self, scheme=None):
224224 }
225225 )
226226
227+ def apply_font_smoothing (self , mode : str = "rgb" ):
228+ """Enable Wine font smoothing using a predefined mode."""
229+
230+ modes = {
231+ "disable" : {"smoothing" : "0" , "orientation" : 1 , "type" : 0 },
232+ "gray" : {"smoothing" : "2" , "orientation" : 1 , "type" : 1 },
233+ "bgr" : {"smoothing" : "2" , "orientation" : 0 , "type" : 2 },
234+ "rgb" : {"smoothing" : "2" , "orientation" : 1 , "type" : 2 },
235+ }
236+
237+ if mode not in modes :
238+ raise ValueError ("Given font smoothing mode is not supported." )
239+
240+ selected = modes [mode ]
241+
242+ self .reg .import_bundle (
243+ {
244+ "HKEY_CURRENT_USER\\ Control Panel\\ Desktop" : [
245+ {"value" : "FontSmoothing" , "data" : selected ["smoothing" ]},
246+ {
247+ "value" : "FontSmoothingGamma" ,
248+ "data" : "00000578" ,
249+ "key_type" : "dword" ,
250+ },
251+ {
252+ "value" : "FontSmoothingOrientation" ,
253+ "data" : f"{ selected ['orientation' ]:08x} " ,
254+ "key_type" : "dword" ,
255+ },
256+ {
257+ "value" : "FontSmoothingType" ,
258+ "data" : f"{ selected ['type' ]:08x} " ,
259+ "key_type" : "dword" ,
260+ },
261+ ]
262+ }
263+ )
264+
227265 def set_renderer (self , value : str ):
228266 """
229267 Set what backend to use for wined3d.
0 commit comments