svm: a metafile's text depends on fonts the browser does not have, and combining marks land in the wrong place
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 28/100
- Type d'issue
- Fonctionnalité
- Clarté
- À clarifier
- Activité
- Calme
- Stack technique
- cpp, html
- Domaine
- documentation, frontend
Piste de recherche
Reproduce the issue with translate "test/data/input/odr-private/odt/Vektoranalysis Zusammenfassung.odt" /tmp/va, then open /tmp/va/document.html in a browser without OpenSymbol. Read the SVM translation path and the existing internal/font machinery mentioned in the issue. The work is not yet defined: maintainers must choose documentation, supplied fonts, or geometry before implementation can be considered done.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Split out of #772, which is closed. Not a regression — this predates the whole
#779–#793 stack and is unchanged by it.
Symptom
A metafile drawn by StarMath puts a vector arrow over a variable. In the
browser the arrow sits up and to the left of the letter it belongs to.
In odr-private/odt/Vektoranalysis Zusammenfassung.odt, 600 of its 1032
embedded metafiles are affected — 1022 arrows in one document.
What the translator emits
The arrow is U+20D7 COMBINING RIGHT ARROW ABOVE, written as its own <text>
at the position the metafile gives, exactly as the metafile draws it:
<text x="106" y="1085" style="font-family:OpenSymbol;font-size:423;">⃗</text>
<text x="106" y="1058" style="font-family:Times New Roman;font-size:423;">a</text>
That markup is correct, and renders correctly when OpenSymbol is
present. The arrow only goes astray when it is not.
Cause
A combining mark has zero advance and its outline is authored to the left of
the origin, so that it lands back over the character before it. StarMath
positions the glyph assuming OpenSymbol's own authoring. Every other font
implements U+20D7 as a proper combining mark — which is why it lands
somewhere else.
The font is the whole story. Measured, same markup, one font each:
| font | placement |
|---|---|
| OpenSymbol | correct, over the letter |
| Arial Unicode MS | correct |
| serif, sans-serif, Apple Symbols, STIX Two Math, Lucida Grande, Menlo, DejaVu Sans, Symbola, Segoe UI Symbol | all displaced up-and-left |
On macOS, LibreOffice's bundled fonts live inside the application bundle and
are not installed system-wide, so a browser never sees OpenSymbol even on a
machine that has LibreOffice.
What does not work
All measured in Chrome against the real OpenSymbol, not reasoned about:
- A generic fallback (
font-family:'OpenSymbol',serif) — no effect.
Browsers do per-glyph fallback for a missing codepoint regardless of the
stack. - Naming other symbol fonts — no effect, per the table above.
font-feature-settings: 'mark' 0, 'mkmk' 0— no effect, which tells us
the offset comes from the glyph outline and not from GPOS mark attachment.
There is no CSS property that reaches it.- A base character (
before the mark) — worse: the mark combines
with the space and the arrow disappears. - Merging the mark into the run of the letter it belongs to — worse: the
letter's font (Times New Roman) has noU+20D7, so it renders as tofu; and
forcing the mark to OpenSymbol with a nested<tspan>breaks the shaping
and puts the arrow beside the letter.
So there is nothing to fix in the markup. The lever is which font the browser
has.
Not vendoring the font
Embedding a subset of OpenSymbol via @font-face would fix it, and the
machinery exists (internal/font, cff/sfnt subsetting, already used for pdf).
We do not want to vendor the font, so this is recorded as the option that
was considered and declined, not as the plan.
What is left to decide
- Document it as a known limitation of svm output, which is honest and cheap:
the rendering is faithful only where the named fonts are installed, and
combining marks are the visible case rather than a special one. - Or let the embedder supply fonts, so an application that ships OpenSymbol
(the Android and iOS apps could) gets correct output while a bare browser
does not. - Or draw the mark ourselves as geometry for the handful of marks that matter,
which trades a font dependency for a positioning one — we would have to
decide the offset the font currently decides.
Reproducing
translate "test/data/input/odr-private/odt/Vektoranalysis Zusammenfassung.odt" /tmp/va
then open /tmp/va/document.html in a browser without OpenSymbol installed.
The formulas' vector arrows are displaced; installing OpenSymbol (or rendering
in LibreOffice, whose player is right) places them correctly.
- Langage dominant
- C++
- Étoiles
- 41
- Forks
- 10
- Merge moyen
- 10 h 36 min
- PR mergées (30 j)
- 335
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de opendocument-app/OpenDocument.core
-
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
opendocument-app/OpenDocument.core#1281 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 3/5 1-2 jours Accessibilité débutants 57/100
opendocument-app/OpenDocument.core#1280 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 42/100
opendocument-app/OpenDocument.core#1279 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
opendocument-app/OpenDocument.core#1278 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
opendocument-app/OpenDocument.core#1221 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de opendocument-app/OpenDocument.core
Issues similaires
-
`BLMPOP` with COUNT 0 or numkeys 0 hangsPeut-être pris @ggyuchive l’a pris aujourd’hui. Ouvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
needs triage
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
gObjectFullbrightAlphaMaskProgram in newview/llviewershadermgr.cpp is defined but never initializedOuvertebug triage
Difficulté 1/5 Moins d'une heure Accessibilité débutants 78/100
secondlife/viewer#6620 ·
Les mainteneurs répondent en général sous 1 jour
-
bug core p3
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
RunanywhereAI/runanywhere-sdks#1258 ·
Les mainteneurs répondent en général sous 1 jour
-
ripwire-router skill: stale language list (15 vs 26 supported; Elixir/PHP/Kotlin wrongly listed as unsupported)Peut-être pris @joyful-ii-V-I l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 80/100
redhat-et/ripwire#521 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour