fix: rename the typeface inside the files, not only in the stylesheet - #190
Merged
Conversation
- Pretendard is OFL 1.1 with a Reserved Font Name and clause 3 bars a modified version from presenting it; a subset is a modified version - the only rename was `@font-face`, which names the file rather than the font, so every shipped subset still called itself "Pretendard Variable" in its family, full name, PostScript name and unique id - `FAMILY` was a label on a return value and was never passed anywhere; `subset-font` has no option to rename, only one for which name ids to keep - add `scripts/font-rename.mjs`, which rebuilds the `name` table between subsetting and compression, and take the woff2 step through fontverter - keep name ids 13 and 14, so the licence and its url travel inside the font as well as beside it; harfbuzz drops both by default - leave the copyright, trademark and licence records alone: the restriction is on the name presented, not on the credit carried - add a gate check that reads the built files back, since a constant in the script is the evidence that was trusted last time - correct two statements in SECURITY.md: the skin stores two values in localStorage rather than one, and a heading that already carries an id keeps it rather than having one derived
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.
Found by auditing the package rather than the source. The shipped fonts named
themselves:
Pretendard is OFL 1.1 with a Reserved Font Name. Clause 3 bars a modified
version from carrying that name as the one presented to users, and a subset is a
modified version. Three releases went out this way.
Why it slipped
Everything around it said the rename had happened.
scripts/font.mjshadFAMILY = "Quiet Sans"; its comment said "The family is renamed";THIRD-PARTY-NOTICES.mdsaid the rename was required and done. The one thingthat had actually changed was the
@font-facedeclaration — which names thefile CSS loads, not the font inside it.
FAMILYwas only ever a label on the returned object. It was never passed tosubsetFont, and could not have been:subset-fonthas no rename option, onlypreserveNameIdsfor which records to keep.The fix
scripts/font-rename.mjsrebuilds thenametable between subsetting andcompression. The subset is taken uncompressed, renamed, then put back to woff2
through
fontverter— whichsubset-fontalready uses internally for the sameconversion, now declared as a direct dependency since the build calls it.
Renamed: family, full name, PostScript name, unique id, typographic/WWS
families, and the PostScript name of all nine named instances.
Not renamed: copyright, trademark, licence, licence url. The restriction is on
the name the font presents, not the credit it carries — stripping "Pretendard"
out of the copyright line would break the licence in the course of complying
with it. Name ids 13 and 14 are now preserved too, so the licence travels inside
the font as well as beside it; harfbuzz drops both by default.
Validation
node scripts/check.mjs— 26 checks, passed.New check, the typeface ships under its own name, reads the built files back
rather than trusting the script — a constant in the script is exactly the
evidence that failed last time. Proved to fail by rebuilding the font the old
way and running the gate against it:
The rename changes nothing else. Old and new subsets of the same text,
compared table by table: every table is byte-identical except
nameandhead,and
headdiffers only incheckSumAdjustment, which this recomputes. Glyphcount, unitsPerEm, the
wghtaxis (45–930, default 400) and all nine namedinstances are unchanged.
Rendering checked in the browser against the shipped
@font-facedeclarations:the face applies (523.2px against a 580.7px serif fallback), the Latin weight
axis is live (400→700 widens 523.2→548.2), Hangul renders in Quiet Sans rather
than a system fallback (426.8px, against Malgun Gothic 475.2), and synthesised
Hangul bold still thickens — 1.57× the ink at 700.
Also in here
Two statements in
SECURITY.mdthat the code did not support:localStoragevalue; there are two,quiet-themeandquiet-cat-openwhen the heading has none. An id written into a post by hand is used as it
stands and reaches an
hrefunescaped — author content on a single-authorblog, so left as it is, but now written down accurately.