Skip to content

fix(theme): restore symbol coverage lost when M+ 1p was repointed - #259

Merged
Bill Traynor (wmat) merged 1 commit into
mainfrom
fix/restore-mplus-symbol-coverage
Sep 1, 2026
Merged

Bill Traynor (wmat) merged 1 commit into
mainfrom
fix/restore-mplus-symbol-coverage

Conversation

@wmat

Copy link
Copy Markdown
Collaborator

Problem

d93e7bf repointed the M+ 1p Fallback catalog entry from fonts/mplus-1p-regular-fallback.ttf to GEM_FONTS_DIR/mplus1p-regular-fallback.ttf, so that hard line breaks keep the body font's line height.

The two copies are not nested — neither is a superset of the other:

codepoints unique to it
local fonts/ copy 6726 1243 (reachable in no other font in the chain)
bundled gem copy 6982 1504

The bundled copy adds U+000A, U+200B, U+202F, U+2060 and a wider CJK range — all good reasons to keep it first. The local copy carries IPA extensions and a set of dingbats including U+2718 HEAVY BALLOT X. Repointing the entry silently dropped those 1243 codepoints and left fonts/mplus-1p-regular-fallback.ttf shipped but unreferenced.

66df4a2 fixed the list markers by moving them onto glyphs JetBrainsMono maps directly. That is the right fix there, because the marker has its own font family. Document body text has no such escape — its chain is body → M+ 1p Fallback → Noto Sans → Noto Emoji — so a spec that writes ✘ in a table now gets:

WARNING: Could not locate the character `✘' (✘) in the following fonts: body, M+ 1p Fallback, Noto Sans, Noto Emoji

which is fatal for any build using --failure-level=WARN. This is currently breaking riscv-cheri CI on every PR that picks up the submodule bump (e.g. riscv/riscv-cheri#1204). Note ✔ on the same table line still resolves, because the bundled copy happens to map it — so the pair renders inconsistently even where the build is allowed to pass.

Change

Register the local copy under a second catalog name and append it to the end of the fallback chain.

Nothing is removed and nothing is reordered. The bundled copy still comes first and still decides line feed and CJK; the added entry is reachable only for codepoints no earlier font in the chain provides. Placing it last is deliberate — inserting it mid-chain would pull ☺ ♠ ♣ ♥ ♦ away from Noto Sans/Noto Emoji.

Verification

Built in ghcr.io/riscv/riscv-docs-base-container-image:latest with a document containing a ✔/✘ table, a + hard-break block and three nested list levels, using the same flags riscv-cheri passes:

  • before: 1 warning, exit 1; after: 0 warnings, exit 0
  • ✘ moves from a missing-glyph box to mplus-1p-regular; ✔ is unchanged, still served by the bundled copy
  • hard-break baseline advances stay at 13.980/13.979pt — identical before and after, and unchanged from 66df4a2
  • list markers still render in JetBrainsMono-Regular; no new font enters the marker chain
  • of 28 text spans, only the 3 ✘ spans differ

🤖 Generated with Claude Code

d93e7bf repointed `M+ 1p Fallback` from fonts/mplus-1p-regular-fallback.ttf
to GEM_FONTS_DIR/mplus1p-regular-fallback.ttf so that hard line breaks keep
the body font's line height. The two copies are not nested — neither is a
superset of the other:

  local copy  6726 codepoints, 1243 of them in no other font in the chain
  bundled copy 6982 codepoints, 1504 of them absent from the local copy

The bundled copy adds U+000A, U+200B, U+202F, U+2060 and a wider CJK range.
The local copy carries IPA extensions and a set of dingbats, among them
U+2718 HEAVY BALLOT X. Repointing the entry silently dropped that 1243 and
left the file in fonts/ shipped but unreferenced.

66df4a2 fixed the list markers by moving them onto glyphs JetBrainsMono maps
directly, which is the right fix there because the marker has its own font
family. Document body text has no such escape: its chain is body -> M+ 1p
Fallback -> Noto Sans -> Noto Emoji, and a spec that writes U+2718 in a table
now gets

  WARNING: Could not locate the character `✘' (✘) in the following
  fonts: body, M+ 1p Fallback, Noto Sans, Noto Emoji

which is fatal for any build using --failure-level=WARN, as riscv-cheri does.
U+2714 on the same line still resolves, because the bundled copy happens to
map it — so the pair renders inconsistently even when the build is allowed
to pass.

Register the local copy under a second name and append it to the end of the
fallback chain. Nothing is removed and nothing is reordered: the bundled copy
still comes first and still decides line feed and CJK, and the added entry is
reachable only for codepoints no earlier font provides.

Verified in ghcr.io/riscv/riscv-docs-base-container-image with a document
containing a U+2714/U+2718 table, a `+` hard-break block and three nested
list levels, built with the same flags riscv-cheri uses:

* before: 1 warning, exit 1; after: 0 warnings, exit 0
* U+2718 moves from a missing-glyph box to mplus-1p-regular; U+2714 is
  unchanged, still served by the bundled copy
* hard-break baseline advances stay at 13.980/13.979pt, identical before and
  after and unchanged from 66df4a2
* list markers still render in JetBrainsMono-Regular; no new font is pulled
  into the marker chain
* of 28 text spans, only the 3 U+2718 spans differ

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Bill Traynor <wmat@riscv.org>
@wmat
Bill Traynor (wmat) merged commit 91a2488 into main Sep 1, 2026
7 checks passed
Tariq Kurd (tariqkurd-repo) pushed a commit to riscv/riscv-cheri that referenced this pull request Sep 2, 2026
Supersedes #1204.

## Why

The PDF builds are failing on any PR that picks up the `docs-resources`
bump to `d93e7bf` ([failing
run](https://github.com/riscv/riscv-cheri/actions/runs/33456702369/job/99698095218?pr=1204)).
All four PDF targets fail with `Error 1` and no error message, only
warnings:

```
asciidoctor: WARNING: Could not locate the character `⚫' (⚫) in the following fonts: JetBrainsMono, M+ 1p Fallback, Noto Sans, Noto Emoji
asciidoctor: WARNING: Could not locate the character `✘' (✘) in the following fonts: body, M+ 1p Fallback, Noto Sans, Noto Emoji
```

There is no error — the Makefile passes `--failure-level=WARN`, which
promotes these to build failures.

`d93e7bf` repointed the `M+ 1p Fallback` theme entry from the copy of M+
1p in `docs-resources/fonts` to the copy bundled with Asciidoctor PDF,
to fix hard-break line height. The two copies have disjoint coverage —
the bundled one maps `U+000A` and more CJK, the local one maps ~1240
codepoints the bundled one lacks — so that change removed the only
source of `U+26AB` and `U+2718` in the chain.

## What this picks up

* **riscv/docs-resources#258** — moves the `disc` and `circle` list
markers off `U+26AB` onto `U+25CF`, which JetBrainsMono maps directly,
so the marker resolves in its own font instead of entering the fallback
chain.

* **riscv/docs-resources#259** — appends the local copy of M+ 1p to the
end of the fallback chain, restoring `U+2718`. Nothing is removed or
reordered: the bundled copy still comes first and still decides line
feed and CJK.

`U+2718` is used in the privileged integration table in
`src/cheri/riscv-priv-integration.adoc`. `U+2714` on the same rows kept
resolving, because the bundled copy happens to map it, so the pair
rendered inconsistently even before the build began to fail.

## Verification

Run locally against
`ghcr.io/riscv/riscv-docs-base-container-image:latest`, the image CI
uses:

* `make -j$(nproc)` — the same command the workflow runs — exits **0**
with **zero warnings**, building all 15 artifacts, including the four
PDFs that failed in the run above.
* Since the Makefile passes `--failure-level=WARN`, exit 0 is itself
proof that no warning was emitted.
* In the resulting 186-page `riscv-cheri.pdf`, all 19 check/cross glyphs
render in `mplus-1p-regular` (13 `✔`, 6 `✘`). The six `✘` were
missing-glyph boxes before.

## Note on #1204

#1204 bumps to `d93e7bf`, the commit that introduced the regression, so
it should be closed rather than merged.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Bill Traynor <wmat@riscv.org>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant