Repository navigation
Add per-canvas SVG text rendering - #69
Merged
Merged
Conversation
Add a JobServices.Svg flag (128) and a /svg/v1/{n}/{**id} Search API
endpoint that returns an SVG of a canvas's line text, positioned over
the canvas for selectable-text overlays. The text-augmented Manifest
links it from each spatial canvas's "rendering" property.
Canvas dimensions are now recorded on Image (ProtoMember 4/5) for the
SVG viewBox, falling back to the stored Manifest for older indexes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
donaldgray
force-pushed
the
feature/svgRendering
branch
from
October 20, 2026 16:24
5c5cb03 to
10c6e34
Compare
donaldgray
marked this pull request as ready for review
October 21, 2026 15:12
JackLewis-digirati
approved these changes
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #68
Adds an SVG text rendering per canvas, linked from each canvas's
renderingproperty in the text-augmented Manifest, similar to wellcomecollection/iiif-builder#256.JobServices.Svgflag (128); the endpoint and itsrenderinglink are only available when the flag is enabledGET /svg/v1/{n}/{**id}returnsimage/svg+xml: one invisible, selectable<text>element per line, stretched over the line's bounding box, with aviewBoxmatching the canvasrenderinglink added only to image canvases (not audio/video) that have at least one word; existingrenderingentries are kept and duplicates skippedImage(ProtoMember4/5) for theviewBox; indexes built before this change fall back to the stored ManifestSvgis requesteddocs/search-api.md,docs/builder-api.mdPdf/TextAugmented/Annotationsas 8/16/32, but the enum has them as 16/32/8 - updated.Existing problem, not fixed here:
Search,PdforSvgis on, so a job withAnnotationsalone gets 404s from those pages.Caution
Known limitation: hyphenated words in SVG overlay
The SVG builds each line from the search index's words. When ALTO splits a word across two lines (e.g. "pro-" / "posal"), the index merges it into a single word ("proposal") on the first line, keeping only the first part's bounding box. As a result:
Punctuation-only tokens (e.g. "—", "&", "§") are also not included, as they aren't added to the index.
On the plus side, copy/pasting across a line break gives the whole word ("proposal") rather than two fragments.
This is acceptable for now. Fixing it would mean storing the physical line layout from the ALTO alongside (or separately from) the search index - increasing storage size.
🤖 Generated with Claude Code