fonts: vendor Inter Bold and Source Serif 4 Bold
Seventeen desktop call sites (and eight on Android) ask for weight 700, but only Regular/Medium/SemiBold were vendored, so the text system thickened a lighter face: the selected tab label read as smeared, and markdown **strong** in prose was synthetic too. Both faces come from the release archives the script already fetches; everything else re-vendored byte-identical. Which roles take Bold rather than SemiBold is still undecided, and is now a TODO. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8c0ba369a0
commit
780abf87c0
7 files changed
+42
-6
No files matched your search
@@ -203,6 +203,20 @@ here, since it isn't worth taking before it shows up in a profile.
|
||||
modalities stay correct meanwhile; Android passing `None` is what closing this looks
|
||||
like.
|
||||
|
||||
### Decide when the UI uses Bold and when SemiBold
|
||||
- **Description**: Both weights are now real faces on both modalities (Inter and
|
||||
Source Serif 4 Bold were vendored 2026-11, after the missing 700 face was found
|
||||
drawing the selected tab as a smeared synthetic bold). But nothing says which one a
|
||||
given role takes. On the desktop, 17 call sites ask for `FontWeight::BOLD` (selected
|
||||
tabs, modal titles, player controls, several headings) while Android's type ramp sets
|
||||
headlines and `titleLarge` in SemiBold, and individual screens pick either.
|
||||
- **Details**: The answer belongs in ADR 0024 as a weight-per-role table, alongside the
|
||||
typefaces themselves, and then in the token layer on each side, so a call site names a
|
||||
role rather than a weight. Judge it in `design/typeface-specimen/`, on real chrome, in
|
||||
both grounds: bold on a dark ground reads heavier than the same weight on a light one.
|
||||
Markdown `**strong**` in prose is its own case, since its weight is the author's, not
|
||||
the chrome's.
|
||||
|
||||
### Give the headless GUI a Vulkan driver that works from the devShell
|
||||
- **Description**: a `syn-gui` built in `nix develop` finds no Vulkan driver in the
|
||||
headless sway session and exits with "failed to initialize a GPU context". The host's
|
||||
|
||||
@@ -45,6 +45,7 @@ object Typeface {
|
||||
Font(R.font.inter_italic, FontWeight.Normal, FontStyle.Italic),
|
||||
Font(R.font.inter_medium, FontWeight.Medium),
|
||||
Font(R.font.inter_semibold, FontWeight.SemiBold),
|
||||
Font(R.font.inter_bold, FontWeight.Bold),
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -66,10 +67,11 @@ object Typeface {
|
||||
Font(R.font.source_serif_4_regular, FontWeight.Normal),
|
||||
Font(R.font.source_serif_4_italic, FontWeight.Normal, FontStyle.Italic),
|
||||
Font(R.font.source_serif_4_semibold, FontWeight.SemiBold),
|
||||
Font(R.font.source_serif_4_bold, FontWeight.Bold),
|
||||
)
|
||||
|
||||
/**
|
||||
* Built once and reused: assembling the family reads four font files, which is not something to
|
||||
* Built once and reused: assembling the family reads five font files, which is not something to
|
||||
* redo on every recomposition.
|
||||
*/
|
||||
@Volatile private var cachedSerifWithCjk: FontFamily? = null
|
||||
@@ -116,6 +118,11 @@ object Typeface {
|
||||
.setWeight(SEMIBOLD_WEIGHT)
|
||||
.build()
|
||||
)
|
||||
.addFont(
|
||||
PlatformFont.Builder(resources, R.font.source_serif_4_bold)
|
||||
.setWeight(BOLD_WEIGHT)
|
||||
.build()
|
||||
)
|
||||
.build()
|
||||
val cjk =
|
||||
PlatformFontFamily.Builder(
|
||||
@@ -135,6 +142,7 @@ object Typeface {
|
||||
}
|
||||
|
||||
private const val SEMIBOLD_WEIGHT = 600
|
||||
private const val BOLD_WEIGHT = 700
|
||||
private const val TAG = "Typeface"
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -105,8 +105,14 @@ weight ramp honest.
|
||||
Faces are matched by *typographic* family (`name` ID 16), not the legacy family
|
||||
(ID 1) — `fontdb` prefers ID 16 and falls back only when it is absent
|
||||
(`fontdb-0.23.0/src/lib.rs`). This matters because Inter's Medium and SemiBold statics
|
||||
carry legacy family names `"Inter Medium"` and `"Inter SemiBold"`; under ID 16 all four
|
||||
faces are `"Inter"`, so one family name resolves the whole weight ramp.
|
||||
carry legacy family names `"Inter Medium"` and `"Inter SemiBold"`; under ID 16 every
|
||||
face is `"Inter"`, so one family name resolves the whole weight ramp.
|
||||
|
||||
A weight the app asks for with no static face behind it is not an error anywhere: the
|
||||
text system thickens the nearest lighter face instead, and the result reads as smeared
|
||||
rather than bold. So the vendored ramp has to cover every weight a call site names. Bold
|
||||
(700) was missing for both Inter and Source Serif 4 until 2026-11, which is what made
|
||||
the desktop's selected tab label and markdown `**strong**` look wrong.
|
||||
|
||||
### Bundling rule: bundle everything the app names, except what Android guarantees
|
||||
|
||||
|
||||
@@ -172,6 +172,7 @@ const EMBEDDED_FONTS: &[(&str, &[u8])] = &[
|
||||
("Inter Regular", include_bytes!("../../../assets/fonts/inter_regular.ttf")),
|
||||
("Inter Medium", include_bytes!("../../../assets/fonts/inter_medium.ttf")),
|
||||
("Inter SemiBold", include_bytes!("../../../assets/fonts/inter_semibold.ttf")),
|
||||
("Inter Bold", include_bytes!("../../../assets/fonts/inter_bold.ttf")),
|
||||
("Inter Italic", include_bytes!("../../../assets/fonts/inter_italic.ttf")),
|
||||
("UDEV Gothic Regular", include_bytes!("../../../assets/fonts/udev_gothic_regular.ttf")),
|
||||
("UDEV Gothic Bold", include_bytes!("../../../assets/fonts/udev_gothic_bold.ttf")),
|
||||
@@ -181,6 +182,7 @@ const EMBEDDED_FONTS: &[(&str, &[u8])] = &[
|
||||
"Source Serif 4 Semibold",
|
||||
include_bytes!("../../../assets/fonts/source_serif_4_semibold.otf"),
|
||||
),
|
||||
("Source Serif 4 Bold", include_bytes!("../../../assets/fonts/source_serif_4_bold.otf")),
|
||||
(
|
||||
"Noto Sans CJK JP Regular",
|
||||
include_bytes!("../../../assets/fonts/noto_sans_cjk_jp_regular.otf"),
|
||||
|
||||
@@ -48,25 +48,31 @@ extract() { # archive member dest-name
|
||||
}
|
||||
|
||||
# --- Inter: the UI face. -----------------------------------------------------
|
||||
# Regular/Medium/SemiBold cover the UI ramp; Italic exists because Inter is a
|
||||
# Regular through Bold cover the UI ramp; Italic exists because Inter is a
|
||||
# selectable prose font for the notes preview, where emphasis needs a real
|
||||
# italic rather than a synthesised oblique.
|
||||
# italic rather than a synthesized oblique. Every weight the app asks for has
|
||||
# to be here: a weight with no face is drawn by thickening a lighter one, which
|
||||
# reads as smeared rather than bold (the selected tab label did, until Bold was
|
||||
# vendored).
|
||||
inter_zip="$workdir/inter.zip"
|
||||
fetch "https://github.com/rsms/inter/releases/download/v${INTER_VERSION}/Inter-${INTER_VERSION}.zip" "$inter_zip"
|
||||
extract "$inter_zip" "extras/ttf/Inter-Regular.ttf" "inter_regular.ttf"
|
||||
extract "$inter_zip" "extras/ttf/Inter-Medium.ttf" "inter_medium.ttf"
|
||||
extract "$inter_zip" "extras/ttf/Inter-SemiBold.ttf" "inter_semibold.ttf"
|
||||
extract "$inter_zip" "extras/ttf/Inter-Bold.ttf" "inter_bold.ttf"
|
||||
extract "$inter_zip" "extras/ttf/Inter-Italic.ttf" "inter_italic.ttf"
|
||||
extract "$inter_zip" "LICENSE.txt" "LICENSE-Inter.txt"
|
||||
|
||||
# --- Source Serif 4: the default prose face. ---------------------------------
|
||||
# The base optical size ("Text"), not SmText/Subhead/Display — the preview pane
|
||||
# sets prose at 15-18px, which is what the base cut is drawn for.
|
||||
# sets prose at 15-18px, which is what the base cut is drawn for. Bold is for
|
||||
# markdown's **strong**, which asks for 700.
|
||||
serif_zip="$workdir/source-serif.zip"
|
||||
fetch "https://github.com/adobe-fonts/source-serif/releases/download/${SOURCE_SERIF_VERSION}/source-serif-${SOURCE_SERIF_PKG}_Desktop.zip" "$serif_zip"
|
||||
extract "$serif_zip" "source-serif-${SOURCE_SERIF_PKG}_Desktop/OTF/SourceSerif4-Regular.otf" "source_serif_4_regular.otf"
|
||||
extract "$serif_zip" "source-serif-${SOURCE_SERIF_PKG}_Desktop/OTF/SourceSerif4-It.otf" "source_serif_4_italic.otf"
|
||||
extract "$serif_zip" "source-serif-${SOURCE_SERIF_PKG}_Desktop/OTF/SourceSerif4-Semibold.otf" "source_serif_4_semibold.otf"
|
||||
extract "$serif_zip" "source-serif-${SOURCE_SERIF_PKG}_Desktop/OTF/SourceSerif4-Bold.otf" "source_serif_4_bold.otf"
|
||||
extract "$serif_zip" "source-serif-${SOURCE_SERIF_PKG}_Desktop/LICENSE.md" "LICENSE-SourceSerif4.md"
|
||||
|
||||
# --- UDEV Gothic: the monospace face. ----------------------------------------
|
||||
|
||||
Reference in new issue
Block a user