txt section numbering, @typeface :middle/:lift and html scale, NewGardinerOmni, html :leading (from dev 9fa469dd74ed)

Section headings under txt are numbered inside a @document only; @typeface
gains :middle and :lift and its :scale now means the same in html and
pdf; NewGardinerOmni ships (OFL 1.1, Mark-Jan Nederhof) and @egyptian /
@chinese replace @cjk; @table :leading and :colsep reach html; kdesc
--typeface help names the flag; @document.txt is a Python class.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
ackandClaude Fable 5.1 committed 2026-09-18 20:02:44 +02:00
1 parent 0ead40f272
commit 63956c00e5
26 files changed
+437 -173

No files matched your search

+19
View File
@@ -1,3 +1,4 @@
#include <iomanip>
#include "util.h"
#include "error.h"
#include "log.h"
@@ -118,6 +119,24 @@ std::string Document_class::font_definitions()
ss << " --sans-serif: \"" << m_resolved_sans.family_name << "\", sans-serif;\n";
if (!m_mono_typeface.empty())
ss << " --monospace: \"" << m_resolved_mono.family_name << "\", monospace;\n";
// The factor a @typeface span's font-size is multiplied by (2026-09-18).
// font.css renders the body at "font-size-adjust: ex-height 0.5", so
// the text the reader sees is 0.5 / x-height times its nominal size
// (EB Garamond, x-height 0.400: 1.25). A @typeface span switches
// the adjust OFF (a script with no x-height cannot be matched), so
// its ":scale N" was N times the NOMINAL size -- about a fifth
// smaller against the visible text than the same N in pdf, where
// fontspec's Scale= is against text rendered at nominal size.
// Folding the body's enlargement in here makes :scale mean the
// same thing in both targets. Emitted as a custom property the
// span multiplies in with calc(), so a fragment rendered without
// @document falls back to 1. SYNC: the anchor 0.5 is font.css's.
const float xheight_anchor = 0.5f;
if (m_resolved_serif.xheight_ratio > 0.0f) {
std::stringstream factor {};
factor << std::setprecision(4) << xheight_anchor / m_resolved_serif.xheight_ratio;
ss << " --typeface_scale: " << factor.str() << ";\n";
}
ss << "}\n";
}
// Font-size normalization across families is no longer emitted from