File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -848,13 +848,15 @@ def freetype(font: StrOrBytesPath | BinaryIO | None) -> FreeTypeFont:
848848 # when XDG_DATA_HOME is unset or empty. This user-level directory
849849 # takes precedence over system-level directories.
850850 data_home = os .path .expanduser ("~/.local/share" )
851- dirs . append ( os . path . join ( data_home , "fonts" ))
851+ xdg_dirs = [ data_home ]
852852
853853 data_dirs = os .environ .get ("XDG_DATA_DIRS" )
854854 if not data_dirs :
855855 # Similarly, defaults are defined for the system-level directories
856856 data_dirs = "/usr/local/share:/usr/share"
857- dirs += [os .path .join (ddir , "fonts" ) for ddir in data_dirs .split (":" )]
857+ xdg_dirs += data_dirs .split (":" )
858+
859+ dirs += [os .path .join (xdg_dir , "fonts" ) for xdg_dir in xdg_dirs ]
858860 elif sys .platform == "darwin" :
859861 dirs += [
860862 "/Library/Fonts" ,
You can’t perform that action at this time.
0 commit comments