Skip to content

Embed Andika in BloomPUBs made for RAB apps (BL-17007) - #8461

Draft
andrew-polk wants to merge 6 commits into
masterfrom
BL-17007-rab-andika
Draft

andrew-polk wants to merge 6 commits into
masterfrom
BL-17007-rab-andika

Conversation

@andrew-polk

@andrew-polk andrew-polk commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem

In apps built on Publish > Apps (Reading App Builder), text in Andika shows in the phone's own font. A reader sees a two-story "a" instead of Andika's single-story one. Other fonts work. A tester reported it on 6.5.101 Beta.

Cause

BloomPUBs never embed Andika, because Bloom Reader and other hosts supply it to bloom-player. A RAB app doesn't:

  • It ships Andika's files under host/fonts/Andika-Regular.woff2 and similar names, but bloom-player asks for host/fonts/Andika, so it never finds them (sillsdev/app-builders#2510).
  • RAB apps have no internet permission, so bloom-player's last fallback (downloading the font from bloomlibrary.org) fails even when the phone is online.

Status: a stopgap

The real fix belongs in Reading App Builder (sillsdev/app-builders#2510). We've decided to ship this Bloom-side stopgap until it arrives. After it merges to master, it also goes to Version6.5 in a separate PR.

What the PR does

  • BloomPUBs made for an app now embed Andika like any other font: only the faces the book's text uses, with the usual fonts.css rules. Other BloomPUBs (Bloom Reader, the library, USB/Wi-Fi) are unchanged.
  • Text set in "Andika New Basic", the font Andika replaced, gets the same treatment. Bloom Reader answers requests for that font with Andika, but an app can't, so in an app's BloomPUB the book's references to it are rewritten to Andika by the rewrite Bloom already uses for fonts it can't embed.
  • The rewrite Bloom uses to replace a font it can't embed now also catches a font name in double quotes, or in quotes in a book's own text styles. Before, such references kept the old font. This applies to every ePUB and BloomPUB, not just apps.
  • A comment at the pinned RAB version says to remove this once Bloom moves to a RAB that fixes Move non-xml files to subfolders in epubs (BL-6037) #2510.

An earlier version of this branch, which shipped one copy of Andika per app, showed Andika on a phone. This final version hasn't been on a phone yet. Its APK holds only the faces the book uses (Regular and Bold for the test book), and the book's own Andika rules come last in fonts.css, so they win.

Risk Evaluation

Low. Most of the change sits behind a flag that only the app path sets. When it isn't set, EmbedFonts behaves exactly as before. The exception is the font-replacement rewrite (FixCssReferencesForBadFonts, FixXmlDomReferencesForBadFonts), which every ePUB and BloomPUB runs when a book uses a font Bloom can't embed. It now also matches quoted names, and treats the font name as literal text rather than a pattern. When it is set, Andika goes through the same embedding code every other font already uses. Bloom's font lookup already includes the fonts Bloom serves from DistFiles/fonts, the same route ABeeZee takes.

Ecosystem Impact

  • Apps built outside Bloom: not fixed. A BloomPUB saved from the BloomPUB tab and added to RAB by hand still has no Andika. Only RAB's fix covers that.
  • RAB apps: each book that uses Andika carries the faces it needs (about 0.27 MB each). That's the same per-book cost as any other embedded font.
  • Other BloomPUBs, Bloom Reader, bloom-player, ePUB, PDF: unchanged.
  • When RAB fixes Move non-xml files to subfolders in epubs (BL-6037) #2510: an app would carry Andika twice until we remove this. Nothing breaks.
  • Localization: no new strings. Dependencies: none changed.

E2E Coverage

No end-to-end test builds an app, because that needs RAB and a Gradle build. The opt-in RabRealBuildTests real-build test passed on Andrew's machine. New unit tests check that EmbedFonts embeds Andika, and points Andika New Basic text at it, only when asked.

Notion Test Suite

Two existing manual test cases now check Andika and Charis SIL in the built app on an offline phone (6.6 runs). Both are manual (no automation).

Preflight report: https://bloombooks.github.io/dev-process-artifacts/deciders/bloomdesktop-bl-17007-rab-andika.html

Ref: https://issues.bloomlibrary.org/youtrack/issue/BL-17007

🤖 Generated with Claude Code

Devin review


This change is Reviewable

andrew-polk and others added 4 commits October 9, 2026 14:15
BloomPUBs don't embed Andika, and RAB apps neither serve it under the names bloom-player requests nor allow bloom-player's online fallback, so Andika text showed in the phone's font. Bloom now lists Andika's four faces in the project's .appDef and copies them into its fonts folder; RAB then declares Andika in every book's fonts.css.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replaces the previous commit's per-app copy of Andika. BloomPUBs leave Andika out because Bloom Reader and other hosts supply it, but a RAB app neither serves it under the names bloom-player requests nor allows bloom-player's online fallback, so Andika text showed in the phone's font. BloomPUBs made for an app now embed the Andika faces the book uses, like any other font.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread src/BloomExe/Publish/BloomPub/BloomPubMaker.cs
Comment thread src/BloomExe/Publish/Rab/RabProjectService.cs
@andrew-polk

Copy link
Copy Markdown
Contributor Author

[Claude Opus 5.5 from Andrew Polk's machine during preflight] Consulted Devin on 2026-10-09 up to commit 7f96c5e. It raised one bug (Andika New Basic text still uses the phone's font in apps; left open for the developer's decision) and one flag to investigate (cached BloomPUBs bypassing the new flag; not an issue, since the cache is cleared each time the Apps screen opens). Both have their own review threads. No informational items.

Bloom Reader answers requests for Andika New Basic with Andika, but a
Reading App Builder app has nothing that does. So when a BloomPUB is made
for an app, text in Andika New Basic now gets the matching Andika faces,
and the book's references to Andika New Basic (the language stylesheets,
user-modified styles and inline styles) are rewritten to Andika using the
existing missing-font rewrite. Found by Devin on PR 8461.

Also logs a papercut: RabRealBuildTests cannot pass on a ReFS drive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread src/BloomExe/Publish/BloomPub/BloomPubMaker.cs
Comment thread src/BloomTests/Publish/BloomPub/BloomPubMakerTests.cs
Comment thread src/BloomExe/Publish/BloomPub/BloomPubMaker.cs
The rewrite that points a book's references to fonts we can't embed (and,
in app BloomPUBs, to Andika New Basic) at Andika matched only a bare or
single-quoted name in the stylesheets and only a bare name in the book's
own styles. A double-quoted name, or a quoted name in a user style, kept
the old font and fell back to the device font. Both helpers now accept a
bare, single-quoted or double-quoted name, escaped as a literal. Found by
Devin on PR 8461.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hatton

hatton commented Oct 10, 2026

Copy link
Copy Markdown
Member

[Claude Opus 5.5 from Hatton's machine during preflight] Consulted Devin on 2026-10-10 up to commit 9a8aa8b. Since the last log it found one new bug, that quoted "Andika New Basic" names were not rewritten. That is fixed in 9a8aa8b, and Devin now marks it resolved. It also raised two flags: one about the test was not an issue, and one about the out-of-date PR description was already fixed. The earlier Andika New Basic bug is fixed in 565f078. Each has its own resolved thread. No other findings.

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