Skip to content

Take the OFL fonts of wicket-examples out of the source tree - #1934

Merged
dashorst merged 2 commits into
masterfrom
examples-fonts-1846
Nov 15, 2026
Merged

dashorst merged 2 commits into
masterfrom
examples-fonts-1846

Conversation

@dashorst

Copy link
Copy Markdown
Contributor

The OFL fonts of wicket-examples are out of the source tree, so a source release made with git archive contains no font software any more. Together with #1896 this leaves no font files in the repository. Source Sans Pro, Source Code Pro and League Gothic are under the SIL OFL 1.1, which the ASF puts in Category B: allowed in a built artifact, not in a source release. Part of #1846.

Two commits:

  • Outline the examples logo and drop League Gothic. logo-apachewicket-examples-white.svg, the only logo in use (WicketExampleHeader, HomePageHeader), had League Gothic base64-embedded. Its two <text> elements are now paths, drawn from that same font with its kerning at the same size and position, and each keeps its word as aria-label. The three other logo SVGs with the embedded font (apachewicket7.svg, logo-apachewicket-tungsten.svg, logo-apachewicket-white.svg) were referenced by nothing and are deleted, as is fonts/league-gothic/.
  • Take the examples' text and code fonts from webjars at build time. A maven-dependency-plugin:unpack execution in generate-resources, the same approach as Take the reference guide's fonts from webjars at build time #1896, puts the woff2 files the stylesheets use into target/classes/org/apache/wicket/examples/fonts/, each family with its licence as LICENSE-<family>.txt. The new fonts.css (Apache licence) declares them with @font-face and replaces the old kits' stylesheets. The fonts directory, its .rat-excludes line and the SIL OFL section of LICENSE go.

Visible changes

  • Code font: Source Code Pro becomes JetBrains Mono (fontsource__jetbrains-mono:5.3.0), because no Source Code Pro webjar exists on Maven Central. It is the code font of the guide and the site. Code looks wider, with a taller x-height.
  • Text font: still Source Sans Pro, but version 2.045 (fontsource__source-sans-pro:5.2.5) instead of the 1.033 Font Squirrel kit from 2012. Text sits about 2px lower per block and sets slightly tighter, so the odd line wraps differently.
  • Logo: unchanged. At 3× in Chromium, 180 of 374,400 pixels differ, all on glyph edges where text and a filled path anti-alias differently.
  • Fallback: without the fonts (an IDE run, or a build that hasn't unpacked them), text falls back to Segoe UI, Myriad Pro, Ubuntu, Noto Sans, Helvetica Neue or Arial, and code to the guide's monospace stack.

For review

  • Core: the unpack-fonts execution in wicket-examples/pom.xml, fonts.css and the four font stacks in style.css.
  • Mechanical: the deleted fonts and SVGs, .rat-excludes, LICENSE, and the removed woff/ttf resource includes.
  • Licensing: the examples war is not in the binary distribution, which copies only jars, so LICENSE-binary is unchanged. The war carries each font's licence next to the files, and the OFL needs no NOTICE entry.

Tested

  • git ls-tree -r --name-only HEAD | grep -iE '\.(woff2?|ttf|otf|eot)$' returns nothing.
  • mvn -N apache-rat:check and mvn clean verify -Pjs-test are green.
  • The examples ran with jetty:run and the pages were checked in headless Chromium: home, forminput, bean-validation and navomatic, before and after. The loaded faces are Source Sans Pro 300/400/700 and JetBrains Mono 300, and the woff2 files are served as font/woff2. With the woff2 requests blocked, the pages fall back cleanly.

Backports: wicket-11.x and wicket-10.x get their own PRs.

🤖 Generated with Claude Code

League Gothic is under the SIL Open Font License, which the ASF puts in
Category B: it may ship in a built artifact, but not in a source
release. release.sh builds the source release with git archive, so the
font went into it twice: as the files in
wicket-examples/.../examples/fonts/league-gothic/, and base64-embedded
as an @font-face data URI in four logo SVGs.

Only logo-apachewicket-examples-white.svg is used, by
WicketExampleHeader and HomePageHeader. Its two text elements, WICKET
and EXAMPLES, are now paths: the glyph outlines of the embedded League
Gothic 1.560, shaped with its kerning at the same size and position.
Outlines are artwork, not font software, so no OFL work remains in the
file. Rendered at three times the size in Chromium, 180 of 374,400
pixels differ, all on glyph edges where hinted text and a filled path
anti-alias differently. Each path keeps its word as aria-label.

apachewicket7.svg, logo-apachewicket-tungsten.svg and
logo-apachewicket-white.svg are referenced by nothing and are removed,
as is the league-gothic directory, whose stylesheet no page loaded.
LICENSE no longer lists League Gothic.

GitHub issue #1846

Generated-by: Claude Code (Claude Opus 5.5)
Source Sans Pro and Source Code Pro are under the SIL Open Font
License, which the ASF puts in Category B: they may ship in the
examples war, but not in a source release. release.sh builds the source
release with git archive, so the 54 files in
wicket-examples/.../examples/fonts/ went into it.

The examples pom now unpacks the fonts from the fontsource webjars into
target/classes/org/apache/wicket/examples/fonts/ in generate-resources,
the way the guide profile does since #1896: only the woff2 files the
stylesheets use, each family with its licence as
LICENSE-<family>.txt. fonts.css, under the Apache License, declares
them with @font-face and replaces the two stylesheets of the old font
kits, whose eot, svg, ttf and woff formats served browsers Wicket no
longer supports. The fonts directory goes, and with it its line in
.rat-excludes, the pom's resource includes for woff and ttf files and
the SIL Open Font License section of LICENSE, which listed nothing
else. The examples war is not part of the binary distribution, which
copies only jars, so LICENSE-binary is unchanged; the war carries the
licences next to the fonts. The OFL asks for no NOTICE entry.

The text font stays Source Sans Pro, but in version 2.045 from
fontsource:5.2.5 instead of the 1.033 Font Squirrel kit. The design is
the same; the newer cut sits about two pixels lower in its line box and
sets slightly tighter, so the odd line wraps differently. Weights 200,
300, 400 and 700 are kept, with italics for 300 to 700.

The code font changes from Source Code Pro to JetBrains Mono
(fontsource:5.3.0, weights 300, 400 and 700), because no webjar of
Source Code Pro exists on Maven Central. JetBrains Mono is the code
font of the reference guide and the site, and its webjar is the one the
guide already uses. Code in the examples looks visibly different: wider
letterforms, taller x-height.

The font stacks fall back to system faces for a build or an IDE run
without the fonts: Segoe UI, Myriad Pro, Ubuntu, Noto Sans, Helvetica
Neue and Arial for the text, and the guide's monospace stack for code.

GitHub issue #1846

Generated-by: Claude Code (Claude Opus 5.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant