CI: catch tofu and wrong-glyph regressions — check that emitted fonts survive OTS and that the pdf output paints the right glyphs
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start with the test job in .github/workflows/build_test.yml, alongside the existing html-tidy and compare-html steps, and inspect test/scripts/ for how checks are run locally. The proposal calls for OTS validation of emitted font blobs and an allow-listed PDF text comparison; first decide which checks and oracle approach to implement. Done means deterministic CI checks fail on the described regressions and can also be run locally.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Embedded-font regressions in the pdf output have shipped repeatedly and were
always found by eye, never by CI:
- #613 — TrueType subsets without a
nametable: OTS rejects the font, the
@font-faceis dropped, every PUA glyph renders as tofu. - #660 — three at once: a
CFFName INDEX holding a space makes OTS discard
the table; passing OpenType Layout / device-metric tables through verbatim
makes one malformed table reject the whole font; and a leaked PUA cmap made
the second output of a document paint whole runs with the wrong glyphs. - #702 — subset producers name glyphs
gidNNNNN, which no glyph list
translates, so those runs fell through to code-as-GID and painted unrelated
glyphs. - #749, #752, #753 — the same family of "the text is there, it just isn't the
right shapes / isn't where it should be".
Two distinct failure modes, both invisible to the current pipeline:
- The browser refuses the font.
font_is_usable
(src/odr/internal/html/pdf_file.cpp:2773) only probes that our own encode
path does not throw. Whether OTS — the sanitizer in every browser, far
stricter than FreeType or fontTools — accepts the bytes we then emit is
never checked anywhere. - The font loads but paints the wrong glyphs. Nothing compares the shapes
actually painted against what the page says the text is.
build-test does render the corpus, but the comparison is against
test/data/reference-output, which is regenerated wholesale from our own
output — a bug that is already in the reference is invisible, and #660 in fact
sat there. The pdf views also screenshot nondeterministically (a control run
flaps ~1/60 files), so a genuine small regression is easy to wave off as noise.
Proposal
Two cheap, deterministic checks. Neither needs the reference output, so neither
can be papered over by regenerating it.
1. Every emitted font must survive OTS
After odr_test writes build/test/output/**, extract every
data:font/...;base64 blob from the generated html and run ots-sanitize over
it (pip install opentype-sanitizer ships the binary; it is what I reach for
by hand every time one of these lands). Any ERROR fails the job, and the
message names the exact rejection reason.
This is seconds of runtime, no browser, no flakiness, and it catches #613 and
two thirds of #660 directly.
Worth considering as the stronger version: pull ots in as a test-only conan
dependency and assert it inside odr_test, over the corpus in
test/src/internal/font/. That turns it into a unit-level guard on
SfntFont::write / cff::wrap_to_otf rather than a post-pass over html, and
it fails on the developer's machine before the push.
2. The glyphs painted must be the glyphs meant
For the pdf corpus, take the text an oracle extracts from the source pdf
(gs -sDEVICE=txtwrite, or pdftotext) and compare it against the text of the
generated html, normalised for whitespace. That is the check that would have
caught the PUA-cmap leak in #660 and the gidNNNNN fallthrough in #702: the
page still renders, the layout is unchanged, only the shapes are wrong — and
because we re-encode to the PUA, the html's text is the thing that stays
correct while the glyphs drift, so a text-level oracle sees the divergence the
screenshot comparison shrugs at.
Start with a small allow-listed set of pdf files with a stable expected text,
rather than the whole corpus, so the check is meaningful before it is complete.
A cheaper complement, if the browser is already up: assert in-page that
document.fonts reports every declared face loaded and that no run measures
at the fallback's advance — that catches "the font was dropped" from the other
side, without an oracle.
Where it goes
test job in .github/workflows/build_test.yml, next to the existing
html-tidy / compare-html steps, and mirrored in a script under
test/scripts/ so it is runnable locally the same way.
- Ngôn ngữ chính
- C++
- Star
- 41
- Fork
- 10
- Merge trung bình
- 12 giờ 4 phút
- Pull request đã merge (30 ngày)
- 297
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của opendocument-app/OpenDocument.core
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
opendocument-app/OpenDocument.core#1211 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
opendocument-app/OpenDocument.core#1210 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
opendocument-app/OpenDocument.core#1209 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
opendocument-app/OpenDocument.core#1208 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
opendocument-app/OpenDocument.core#1207 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của opendocument-app/OpenDocument.core
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
justcallmekoko/ESP32Marauder#1635 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
3.7.6-dev commit 80481ea - files not centered when resolution differs and zoom = "pixel-to-pixel"Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
grizzlypeak3d/DJV#931 ·
-
bug 🔥 pharesee
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug tooling
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100