Skip to content

feat(dsl): set the theme body and heading fonts from Presentation - #484

Merged
baseballyama merged 2 commits into
mainfrom
feat/dsl-presentation-fonts
Oct 25, 2026
Merged

baseballyama merged 2 commits into
mainfrom
feat/dsl-presentation-fonts

Conversation

@baseballyama

Copy link
Copy Markdown
Member

Summary

<Presentation fonts={{ minorLatin, majorLatin, ... }}> sets the theme font scheme through the existing setPresentationFonts, so text, tables and charts that name no font follow the deck's body font. Before, the DSL had no way to set theme fonts, and charts kept the theme's Calibri while every Text was written in another font.

Motivation

In a slide-generation benchmark every deck set font="Arial" on each Text and left charts alone, so chart labels were Calibri next to Arial body text (a reviewer flagged it once, but it happens in every deck). Two possible fixes were considered:

  • Default a chart's textStyle.font to the body font: rejected. ChartTextStyle.font writes the same typeface into <a:latin> and <a:ea>, so Japanese chart text would be pinned to Arial instead of the theme's East Asian / Jpan script font.
  • Set the theme's minorLatin (what chart text inherits): correct, but the core setPresentationFonts was only reachable from the DSL through Raw.

So this exposes the existing core capability on Presentation, next to theme (colors), instead of adding a parallel chart-level default.

Checked with LibreOffice on a benchmark deck: with the theme's minorLatin / majorLatin set to Arial, the combo chart's axis, data labels and legend render in the Arial substitute (Liberation Sans) instead of Carlito, and the Japanese text is unchanged.

Changes

  • PresentationProps.fonts?: PresentationFontsInput, applied after theme with setPresentationFonts (first-theme semantics, same as theme).
  • packages/dsl/README.md and skill/references/tsx.md document it and recommend setting the body font there so charts follow.

Testing

  • test/dsl-presentation-fonts.test.ts: compiles a deck with fonts and a chart; the theme reads back minorLatin / majorLatin = Arial, the East Asian slot is untouched, the chart names no font of its own; omitted fonts leaves the theme as created.
  • test/dsl.test.ts, neutral-wording tests pass.

Breaking changes

None. New optional prop.

Checklist

  • I have read CLAUDE.md and followed the project's conventions.
  • I have added or updated tests for the change.
  • I have added or updated documentation where user-visible behavior changed.
  • If this is a breaking change, I have added a changeset / CHANGELOG entry and
    flagged it above.

Copilot AI balanced review requested due to automatic review settings October 25, 2026 02:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

A deck could only set a font on each Text, so its charts kept the
theme's Calibri. Presentation fonts calls setPresentationFonts, which
text, tables and charts without a font inherit, and keeps the theme's
East Asian fonts, unlike a chart textStyle.font.
@baseballyama
baseballyama force-pushed the feat/dsl-presentation-fonts branch from 2f21a6b to 9347b57 Compare October 25, 2026 05:36
@baseballyama
baseballyama merged commit b974295 into main Oct 25, 2026
14 checks passed
@baseballyama
baseballyama deleted the feat/dsl-presentation-fonts branch October 25, 2026 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants