Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions website/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ under that bar through `src/components/docs-shell.tsx`. Blog and changelog pages
`src/components/figures.module.css` (see the `blog-figures` skill). Components use semantic
tokens only, so light and dark differ in the token layer alone.

The three Latin font families are bundled under [`src/app/fonts/`](src/app/fonts/README.md)
and loaded with `next/font/local`. Font compilation needs no network access. The font
directory records their pinned upstream sources, checksums, conversion procedure and licenses.

## Validation

Run from `website/`:
Expand All @@ -35,6 +39,9 @@ pnpm test
pnpm build
```

`pnpm test` includes an actual Next.js build of the site's font configuration with HTTP
requests disabled, then checks that the static export contains the referenced font files.

Static output is written to `website/out/`.

## Content sources
Expand Down
35 changes: 24 additions & 11 deletions website/src/app/fonts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,40 @@
* limitations under the License.
*/

import { Fraunces, IBM_Plex_Sans, JetBrains_Mono } from 'next/font/google';
import localFont from 'next/font/local';
import './fonts/fallbacks.css';

// Sunbeam type: Fraunces for page and section titles, IBM Plex Sans for
// text, JetBrains Mono for code. next/font self-hosts them in the export.
const display = Fraunces({
subsets: ['latin'],
axes: ['opsz', 'SOFT'],
// text, JetBrains Mono for code. Vendored files keep builds independent of Google Fonts.
const display = localFont({
src: './fonts/fraunces/fraunces.woff2',
weight: '100 900',
style: 'normal',
adjustFontFallback: false,
fallback: ['PowerContext Fraunces Fallback'],
variable: '--font-latin-display',
display: 'swap',
});

const sans = IBM_Plex_Sans({
subsets: ['latin'],
weight: ['400', '500', '600'],
const sans = localFont({
src: [
{ path: './fonts/ibm-plex-sans/ibm-plex-sans.woff2', weight: '400', style: 'normal' },
{ path: './fonts/ibm-plex-sans/ibm-plex-sans.woff2', weight: '500', style: 'normal' },
{ path: './fonts/ibm-plex-sans/ibm-plex-sans.woff2', weight: '600', style: 'normal' },
],
adjustFontFallback: false,
fallback: ['PowerContext IBM Plex Sans Fallback'],
variable: '--font-latin-sans',
display: 'swap',
});

const mono = JetBrains_Mono({
subsets: ['latin'],
weight: ['400', '500'],
const mono = localFont({
src: [
{ path: './fonts/jetbrains-mono/jetbrains-mono.woff2', weight: '400', style: 'normal' },
{ path: './fonts/jetbrains-mono/jetbrains-mono.woff2', weight: '500', style: 'normal' },
],
adjustFontFallback: false,
fallback: ['PowerContext JetBrains Mono Fallback'],
variable: '--font-latin-mono',
display: 'swap',
});
Expand Down
90 changes: 90 additions & 0 deletions website/src/app/fonts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Website fonts

These are complete normal-style variable fonts from
[`google/fonts` at `38f49ace70adb7c6cfa5953562eba3fd59a01cb7`](https://github.com/google/fonts/tree/38f49ace70adb7c6cfa5953562eba3fd59a01cb7).
They are served locally so website builds do not fetch fonts. No glyphs, languages,
variation axes, named instances, or font naming records were removed or changed.
The conversion does not subset or instantiate the fonts.

`../fonts.ts` retains the existing CSS variables and declared weights. `fallbacks.css`
preserves the fallback metrics previously emitted by Next.js 16.4.1's Google font
loader. Calculating new fallback metrics from Fraunces' default weight of 900 would
enlarge its fallback even when the page uses weight 400. Review these metrics when
updating font versions.

| Family | Immutable source | Local WOFF2 | TTF bytes | WOFF2 bytes |
| --- | --- | --- | ---: | ---: |
| Fraunces | [TTF](https://github.com/google/fonts/blob/38f49ace70adb7c6cfa5953562eba3fd59a01cb7/ofl/fraunces/Fraunces%5BSOFT%2CWONK%2Copsz%2Cwght%5D.ttf) | [fraunces.woff2](fraunces/fraunces.woff2) | 360440 | 198788 |
| IBM Plex Sans | [TTF](https://github.com/google/fonts/blob/38f49ace70adb7c6cfa5953562eba3fd59a01cb7/ofl/ibmplexsans/IBMPlexSans%5Bwdth%2Cwght%5D.ttf) | [ibm-plex-sans.woff2](ibm-plex-sans/ibm-plex-sans.woff2) | 537244 | 236616 |
| JetBrains Mono | [TTF](https://github.com/google/fonts/blob/38f49ace70adb7c6cfa5953562eba3fd59a01cb7/ofl/jetbrainsmono/JetBrainsMono%5Bwght%5D.ttf) | [jetbrains-mono.woff2](jetbrains-mono/jetbrains-mono.woff2) | 187208 | 78656 |

The three WOFF2 files total 514060 bytes and are preloaded. This preserves complete
character coverage and adds about 322 KB to the former Latin-subset preload of
192304 bytes. Their source variation ranges and defaults are preserved:

| Family | Axis | Minimum | Default | Maximum |
| --- | --- | ---: | ---: | ---: |
| Fraunces | `opsz` | 9 | 9 | 144 |
| Fraunces | `wght` | 100 | 900 | 900 |
| Fraunces | `SOFT` | 0 | 0 | 100 |
| Fraunces | `WONK` | 0 | 1 | 1 |
| IBM Plex Sans | `wght` | 100 | 400 | 700 |
| IBM Plex Sans | `wdth` | 75 | 100 | 100 |
| JetBrains Mono | `wght` | 100 | 400 | 800 |

## Conversion and verification

Conversion uses FontTools 4.69.1 and Brotli 1.2.1. For each downloaded source TTF,
run the following command, substituting its source and destination paths:

```sh
uv run --no-project --with fonttools==4.69.1 --with brotli==1.2.1 python - source.ttf output.woff2 <<'PY'
import sys
from fontTools.ttLib import woff2

woff2.compress(sys.argv[1], sys.argv[2], transform_tables=set())
PY
```

`woff2.compress` opens the TTF with `recalcBBoxes=False` and
`recalcTimestamp=False`. The empty transform set disables glyph, location, and
metrics table transformations. FontTools performs the WOFF2 container conversion:
it updates `head.checkSumAdjustment`, sets bit 11 of `head.flags` to mark a
lossless conversion, and removes the empty eight-byte `DSIG` tables from Fraunces
and JetBrains Mono. Those tables contain zero signatures; IBM Plex Sans has no
`DSIG` table.

Verification compared every decompressed SFNT table with its source bytes. All
tables match byte for byte after accounting only for the `head` fields and empty
`DSIG` removal above, including all glyphs, mappings, metrics, names, variation
data, and timestamps. Fraunces retains 698 glyphs and 624 mapped code points;
IBM Plex Sans retains 1025 glyphs and 891 mapped code points; JetBrains Mono
retains 1179 glyphs and 976 mapped code points.

### SHA-256

| Family | File | SHA-256 |
| --- | --- | --- |
| Fraunces | Source TTF | `177ff6c0f14e5550a3c624247cd1189611d4eb65d000b14944c63d967958abbb` |
| Fraunces | Local WOFF2 | `0b50f9cb68316dd386713b7be9c90deea56c5621307db877ae64a455452994fd` |
| IBM Plex Sans | Source TTF | `3b031aa4216174205bd8471f88a49b91f093169e9e87bd5262242bc5967fe2e3` |
| IBM Plex Sans | Local WOFF2 | `e291b60bbb1859d657bb5ce619ac7bb72f66b65eaad569ca1248ce668f04361c` |
| JetBrains Mono | Source TTF | `48715a42ec242c21e9f02692891e147d022299a52e48d5e413e1a942193ffeda` |
| JetBrains Mono | Local WOFF2 | `7acb7f8cb869509e3f8ba737c9ea1126c911c76ecf552c3c2ef9934ab0823c8e` |

## Licenses and updates

All three fonts use the SIL Open Font License 1.1. Their copyright notices and
license texts come from the same pinned commit, with their wording preserved.
Line endings use LF and trailing whitespace is removed:

- Fraunces: [local license](fraunces/LICENSE), [upstream OFL.txt](https://github.com/google/fonts/blob/38f49ace70adb7c6cfa5953562eba3fd59a01cb7/ofl/fraunces/OFL.txt).
- IBM Plex Sans: [local license](ibm-plex-sans/LICENSE), [upstream OFL.txt](https://github.com/google/fonts/blob/38f49ace70adb7c6cfa5953562eba3fd59a01cb7/ofl/ibmplexsans/OFL.txt). Preserve the reserved font name and original naming records.
- JetBrains Mono: [local license](jetbrains-mono/LICENSE), [upstream OFL.txt](https://github.com/google/fonts/blob/38f49ace70adb7c6cfa5953562eba3fd59a01cb7/ofl/jetbrainsmono/OFL.txt).

To update, choose an immutable upstream commit and download each complete normal
variable TTF and its accompanying `OFL.txt`. Re-run the pinned conversion without
subsetting, instantiation, renaming, or axis changes. Verify the decompressed
tables against the source, review any differences beyond the container changes
listed above, and update the assets, licenses, source links, sizes, axes, and
hashes together. Run the website checks and visually inspect the affected pages.
45 changes: 45 additions & 0 deletions website/src/app/fonts/fallbacks.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright (c) 2026 OceanBase.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/* Preserve Next 16.4.1's Google-font fallback metrics while local fonts load.
* Deriving these from a variable font's default axes would change title wrapping.
*/
@font-face {
font-family: 'PowerContext Fraunces Fallback';
src: local('Times New Roman');
ascent-override: 84.71%;
descent-override: 22.09%;
line-gap-override: 0%;
size-adjust: 115.45%;
}

@font-face {
font-family: 'PowerContext IBM Plex Sans Fallback';
src: local('Arial');
ascent-override: 101.32%;
descent-override: 27.18%;
line-gap-override: 0%;
size-adjust: 101.17%;
}

@font-face {
font-family: 'PowerContext JetBrains Mono Fallback';
src: local('Arial');
ascent-override: 75.79%;
descent-override: 22.29%;
line-gap-override: 0%;
size-adjust: 134.59%;
}
93 changes: 93 additions & 0 deletions website/src/app/fonts/fraunces/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Copyright 2018 The Fraunces Project Authors (https://github.com/undercasetype/Fraunces)

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file added website/src/app/fonts/fraunces/fraunces.woff2
Binary file not shown.
93 changes: 93 additions & 0 deletions website/src/app/fonts/ibm-plex-sans/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Copyright © 2017 IBM Corp. with Reserved Font Name "Plex"

This Font Software is licensed under the SIL Open Font License, Version 1.1.

This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file not shown.
Loading