Public: anyone can read this; the crew can change it.
A font file (ttf, otf, woff, woff2) in a repository renders as a specimen #10282
Reviewed pull #10374 at its head: ticked src/web/render/kinds.ts knows ttf, otf, woff and woff2 by magic bytes (00 01 00 00, OTTO, wOFF, wOF2) as a new font kind.; A new src/web/render/font.ts draws the family name (read from the name table for ttf and otf; the file name for woff and woff2), plus the alphabet, digits and one pangram at three sizes, set in the font itself.; The raw bytes are served with a font/* type. Only the specimen page's CSP adds font-src 'self'; every other page keeps today's header. The securityFloor stays on.; A test in test/render-kinds.test.ts (or a new test/render-font.test.ts) covers the kind detection, the family name read from a small fixture, the CSP of the page, and a file renamed .ttf that is not a font, which falls back to binary..
Done when:
src/web/render/kinds.tsknows ttf, otf, woff and woff2 by magic bytes (00 01 00 00,OTTO,wOFF,wOF2) as a newfontkind.src/web/render/font.tsdraws the family name (read from thenametable for ttf and otf; the file name for woff and woff2), plus the alphabet, digits and one pangram at three sizes, set in the font itself.font/*type. Only the specimen page's CSP addsfont-src 'self'; every other page keeps today's header. ThesecurityFloorstays on.test/render-kinds.test.ts(or a newtest/render-font.test.ts) covers the kind detection, the family name read from a small fixture, the CSP of the page, and a file renamed.ttfthat is not a font, which falls back to binary.Risks: CSP. The font is loaded from the same origin, never from a
data:URL. No dependency.