Release v2.2.2: Fix Fedora 41 ReportLab ps2tt('dejavu-bold') font family mapping and add bundled Vera.ttf fallback + PLAN-COMPREHENSIVE-MCP-AND-CHATBOT-REST-API-CAPABILITY-EXPOSURE
This commit is contained in:
1 parent
2a882853a9
commit
b465312e3d
41 files changed
+196
-153
No files matched your search
@@ -297,24 +297,25 @@ def compile_markdown_to_pdf(
|
||||
from hyperstitionstud_io.publishing.fonts import resolve_font_path
|
||||
|
||||
f_reg = resolve_font_path("DejaVuSans.ttf")
|
||||
f_bold = resolve_font_path("DejaVuSans-Bold.ttf")
|
||||
f_ob = resolve_font_path("DejaVuSans-Oblique.ttf", fallback_filename="DejaVuSans.ttf")
|
||||
f_bob = resolve_font_path("DejaVuSans-BoldOblique.ttf", fallback_filename="DejaVuSans-Bold.ttf")
|
||||
f_mreg = resolve_font_path("DejaVuSansMono.ttf")
|
||||
f_mbold = resolve_font_path("DejaVuSansMono-Bold.ttf")
|
||||
f_bold = resolve_font_path("DejaVuSans-Bold.ttf", fallback_filename="DejaVuSans.ttf") or f_reg
|
||||
f_ob = resolve_font_path("DejaVuSans-Oblique.ttf", fallback_filename="DejaVuSans.ttf") or f_reg
|
||||
f_bob = resolve_font_path("DejaVuSans-BoldOblique.ttf", fallback_filename="DejaVuSans-Bold.ttf") or f_bold or f_reg
|
||||
f_mreg = resolve_font_path("DejaVuSansMono.ttf", fallback_filename="DejaVuSans.ttf") or f_reg
|
||||
f_mbold = resolve_font_path("DejaVuSansMono-Bold.ttf", fallback_filename="DejaVuSans-Bold.ttf") or f_mreg or f_bold or f_reg
|
||||
|
||||
sans_cmap: dict[int, Any] | None = None
|
||||
mono_cmap: dict[int, Any] | None = None
|
||||
|
||||
if f_reg and f_bold and f_mreg and f_mbold:
|
||||
if f_reg:
|
||||
from reportlab import rl_config
|
||||
from reportlab.lib.fonts import addMapping
|
||||
|
||||
tt_sans = TTFont("DejaVu", str(f_reg))
|
||||
tt_bold = TTFont("DejaVu-Bold", str(f_bold))
|
||||
tt_bold = TTFont("DejaVu-Bold", str(f_bold or f_reg))
|
||||
tt_ob = TTFont("DejaVu-Oblique", str(f_ob or f_reg))
|
||||
tt_bob = TTFont("DejaVu-BoldOblique", str(f_bob or f_bold))
|
||||
tt_mono = TTFont("DejaVuMono", str(f_mreg))
|
||||
tt_mbold = TTFont("DejaVuMono-Bold", str(f_mbold))
|
||||
tt_bob = TTFont("DejaVu-BoldOblique", str(f_bob or f_bold or f_reg))
|
||||
tt_mono = TTFont("DejaVuMono", str(f_mreg or f_reg))
|
||||
tt_mbold = TTFont("DejaVuMono-Bold", str(f_mbold or f_mreg or f_bold or f_reg))
|
||||
|
||||
sans_cmap = tt_sans.face.charToGlyph
|
||||
mono_cmap = tt_mono.face.charToGlyph
|
||||
@@ -341,6 +342,12 @@ def compile_markdown_to_pdf(
|
||||
italic="DejaVuMono",
|
||||
boldItalic="DejaVuMono-Bold",
|
||||
)
|
||||
addMapping("DejaVu", 0, 0, "DejaVu")
|
||||
addMapping("DejaVu", 1, 0, "DejaVu-Bold")
|
||||
addMapping("DejaVu", 0, 1, "DejaVu-Oblique")
|
||||
addMapping("DejaVu", 1, 1, "DejaVu-BoldOblique")
|
||||
addMapping("DejaVuMono", 0, 0, "DejaVuMono")
|
||||
addMapping("DejaVuMono", 1, 0, "DejaVuMono-Bold")
|
||||
|
||||
# Group 3 Dark-Mode Palette Tokens (#020617 Void, #070d1b Well, #0c1324/#111a2e Zebra, #26344d Border)
|
||||
c_void = colors.HexColor("#020617")
|
||||
|
||||
Reference in new issue
Block a user