v0.20.7 restructure source and platform workspaces

This commit is contained in:
Deep Research System
2026-05-07 21:13:21 +08:00
parent b3050260b2
commit a4adeb591f
172 changed files with 214 additions and 543 deletions
+32
View File
@@ -0,0 +1,32 @@
"""Font resolution helpers for PDF rendering."""
from __future__ import annotations
from dataclasses import dataclass
from pathlib import Path
@dataclass(frozen=True)
class QuartoFonts:
main_font: str
sans_font: str
requires_system_fonts: bool
def resolve_quarto_fonts(fonts_dir: Path) -> QuartoFonts:
"""Resolve Quarto font names.
Quarto/xelatex currently uses installed font family names. We still accept
fonts_dir so callers can validate/report environment state consistently.
"""
expected = [
fonts_dir / "SourceHanSerifSC-Regular.otf",
fonts_dir / "SourceHanSansSC-Bold.otf",
]
requires_system_fonts = not all(path.exists() for path in expected)
return QuartoFonts(
main_font="Source Han Serif CN",
sans_font="Source Han Sans CN",
requires_system_fonts=requires_system_fonts,
)