Add sans family and true small caps

This commit is contained in:
gloamxun committed 2026-10-19 12:52:53 +08:00
1 parent e44d4c8669
commit 337eaa1778
15 files changed
+628 -122

No files matched your search

+16 -13
View File
@@ -122,7 +122,8 @@ It handles document metadata, `\maketitle`, and `\today` (UTC),
A4 pages, `geometry` margins (`margin`, `top`, `right`, `bottom`, `left`,
`hmargin`, and `vmargin` with `mm`, `cm`, `in`, `pt`, or `bp` units), paragraphs,
numbered and starred heading levels, paragraph indentation (`\parindent`),
`\hfill`, bold, italic and monospaced text, itemize/enumerate lists, page
`\hfill`, serif/sans/monospaced text, true small caps, itemize/enumerate lists,
page
breaks, basic display and inline math, figures, simple tables,
section/figure/table references, and numeric citations from a manual bibliography
or a local `.bib` file. A4 pages use 25 mm margins unless
@@ -187,16 +188,17 @@ are applied only when framing is requested. Like `\fbox`, a `\parbox` is an
atomic vertical block rather than an inline object.
NFSS-style **declarations** are supported with TeX group scoping:
`\bfseries`/`\bf`, `\itshape`/`\slshape`/`\it`, `\ttfamily`/`\tt`, and the
resets `\normalfont`, `\upshape`, `\rmfamily`, `\mdseries`, `\rm`. They stay
active until the end of the current group and nest correctly
(`{\bfseries a {\normalfont b} c}` restores bold for `c`). `\textrm`, `\textup`, `\textmd`, `\textsl`, `\textnormal` are grouped
style commands for roman/upright/medium/slanted/normal text; `\em` is an
italic declaration (an approximation of the LaTeX toggling behaviour).
`\sffamily` is still accepted but does not switch to a sans family.
`\scshape` and `\textsc{...}` are supported as an **uppercase approximation**
(the text is uppercased with unchanged size); real small-caps glyphs and the
usual 80% size reduction are not implemented yet.
`\bfseries`/`\bf`, `\itshape`/`\slshape`/`\it`, `\ttfamily`/`\tt`,
`\sffamily`/`\sf`, and the resets `\normalfont`, `\upshape`, `\rmfamily`,
`\mdseries`, `\rm`. They stay active until the end of the current group and
nest correctly (`{\bfseries a {\normalfont b} c}` restores bold for `c`).
`\textrm`, `\textup`, `\textmd`, `\textsl`, `\textsf`, `\textnormal` are
grouped style commands for roman/upright/medium/slanted/sans/normal text; `\em`
is an italic declaration (an approximation of the LaTeX toggling behaviour).
`\scshape` and `\textsc{...}` use **true small caps**: lowercase letters are
rendered as uppercase glyphs at 80% of the surrounding size, while existing
uppercase letters keep the full size. Sans, bold, and italic small caps select
the matching family and face.
`\mbox{...}` and `\makebox{...}` are **inline horizontal boxes**: the content
is measured as a single unbreakable unit, spaces inside become fixed-width kerns
@@ -424,7 +426,8 @@ The default font paths cover common Linux installations. Set
set `TEXRRA_CJK_FONT` to a TrueType font file with the required glyphs when
the system fallback cannot be found. For `\texttt` output, set
`TEXRRA_MONO_FONT_DIR` when Liberation Mono is not in a common Linux font
directory.
directory; for `\textsf` output, set `TEXRRA_SANS_FONT_DIR` when Liberation
Sans is not in a common Linux font directory.
## Experimental HTML endpoint
@@ -451,7 +454,7 @@ advisory breaks, starred `\vspace`/`\hspace`, `center`, `\hrule`, `\fbox`,
| Area | Implemented | Remaining |
| --- | --- | --- |
| Boxes | `\rule`, `\fbox`, `\parbox`, inline `\mbox`/`\makebox`, `center`, `\hrule` | inline framed `\fbox`, `\raisebox`, `\minipage`, VBox |
| Fonts | serif/mono faces, bold/italic/mono declarations, group scoping, uppercase small caps | `\sffamily` (sans face), real small-cap glyphs |
| Fonts | serif/sans/mono faces, bold/italic/mono/sans declarations, group scoping, true scaled small caps | — |
| Paragraphs | Knuth-Plass breaking, TeX hyphenation, justification, centering, `\parindent` (17pt default), `\hfill`/`\hfil` | `\raggedright`/`\raggedleft` |
| Notes/floats | — | footnote insertion area, figure/table floats |
| Pages | A4/Letter/... page sizes, margins/geometry, automatic pagination, `\newpage`, `\pagebreak` | headers/footers (`fancyhdr`), unified planner/renderer |