File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -316,14 +316,17 @@ def font_is_installed(font: str) -> list[str]:
316316 "Cascadia Code" ,
317317 "Cascadia Mono" ,
318318 "Consolas" ,
319+ "Lucida Console" ,
320+ "Lucida Sans Typewriter" ,
319321 "Monospace" ,
320322 "Menlo" ,
321323 "Courier New" ,
324+ "Courier" ,
322325 "Bitstream Vera Sans Mono" ,
323326 "Andale Mono" ,
324327 "Liberation Mono" ,
325328 "Monaco" ,
326- "Courier " ,
329+ "Fixedsys " ,
327330 "monospace" ,
328331 "Fixed" ,
329332 "Terminal" ,
@@ -345,8 +348,14 @@ def get_family(families: str | list[str]) -> str:
345348 if font_is_installed (family ):
346349 return family
347350 else :
348- warnings .warn ("None of the following fonts is installed: %r" % families )
349- return ""
351+ # On Windows, in offscreen/headless mode, Qt may not detect fonts properly
352+ # Don't warn in this case, just return the first family as a fallback
353+ is_windows_offscreen = (
354+ sys .platform == "win32" and os .environ .get ("QT_QPA_PLATFORM" ) == "offscreen"
355+ )
356+ if not is_windows_offscreen :
357+ warnings .warn ("None of the following fonts is installed: %r" % families )
358+ return families [0 ] if families else ""
350359
351360
352361def get_font (conf : UserConfig , section : str , option : str = "" ) -> QG .QFont :
You can’t perform that action at this time.
0 commit comments