-
Notifications
You must be signed in to change notification settings - Fork 18
docs: add Bitcount Prop Single font template from befailproof.ai #390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f3e2a3d
docs: add Bitcount Prop Single font template from befailproof.ai
nk-ag 3011736
docs: add CHANGELOG entry for Bitcount font template (#390)
nk-ag cb9cc5f
docs: add preview.html demo for Bitcount font template
nk-ag 8acb241
fix: use semantic headings in Bitcount preview demo
nk-ag 29c2d81
fix(bitcount-font): bundle static instance to fix dots-on-phones
nk-ag 5d941ba
Merge remote-tracking branch 'origin/main' into bitcount-font-template
nk-ag ceb3410
docs: merge duplicate ### Docs subsections under 0.0.11-beta.3
nk-ag 050e0b9
chore(bitcount-font): drop preview.html, document bundled static woff2
nk-ag File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # Bitcount Prop Single — font template | ||
|
|
||
| The title / wordmark treatment from **befailproof.ai**, packaged so you can drop | ||
| the exact same look into any project. | ||
|
|
||
| **Fine-tuned instance:** `font-variation-settings: "wght" 417, "ELSH" 55` (slnt 0), | ||
| horizontally squished `scaleX(0.9)`, `letter-spacing: 0.08em`, lowercase. All four | ||
| are exposed as knobs in `bitcount.css`. | ||
|
|
||
| ## Files | ||
| - `bitcount.css` — the reusable `.bitcount-title` class + tunable `:root` knobs, plus a self-host `@font-face`. Framework-agnostic. | ||
| - `bitcount-prop-single.woff2` — self-hosted static instance with `wght 417` + `ELSH 55` baked in (no runtime variable-axis dependency, renders correctly on every device including phones). | ||
| - `fonts.ts.example` — Next.js `next/font/google` loader (rename to `fonts.ts`). Matches how befailproof.ai loads it. | ||
|
|
||
| ## Use it | ||
|
|
||
| ### Next.js | ||
| 1. Rename `fonts.ts.example` → `fonts.ts`, import `bitcount` in your root layout, add `bitcount.variable` to `<html>`. | ||
| 2. Import `bitcount.css` and **delete its `@font-face` block** (next/font already provides `--font-bitcount`). | ||
| 3. Add `class="bitcount-title"` to headings / wordmarks. | ||
|
|
||
| ### Anywhere else | ||
| 1. Copy `bitcount.css` + the bundled `bitcount-prop-single.woff2` into your project (keep them in the same folder so the relative `url(...)` in `@font-face` resolves). | ||
| 2. Import `bitcount.css`, add `class="bitcount-title"` to your headings / wordmarks. | ||
|
|
||
| > **Why a bundled static woff2?** Google Fonts' CDN serves a static default-instance of Bitcount Prop Single to many mobile user-agents, so `font-variation-settings: "ELSH" 55` silently no-ops on phones and the title renders as round dots instead of rounded squares. Self-hosting an already-instanced woff2 avoids that. | ||
|
|
||
| ## Tuning knobs (`:root` in `bitcount.css`) | ||
| | Variable | Default | Effect | | ||
| |---|---|---| | ||
| | `--title-scale` | `0.9` | title size multiplier | | ||
| | `--title-squish` | `0.9` | horizontal `scaleX` squish | | ||
| | `--title-tracking` | `0.08em` | letter-spacing | | ||
|
|
||
| To re-tune the glyph shape itself, change `"wght"` / `"ELSH"` in the | ||
| `font-variation-settings` of `.bitcount-title`. | ||
|
|
||
| ## Provenance | ||
| Recovered from the befailproof.ai web platform (PR #374). Axis values verified | ||
| against the final iteration of that work (earlier passes used wght 413/414 and | ||
| ELSH 51.4 before settling on **417 / 55**). The exact `--title-scale` application | ||
| and the fallback stack are reconstructed from the session — adapt to your project. |
Binary file not shown.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| /* ===================================================================== | ||
| Bitcount Prop Single — title / wordmark treatment | ||
| Source: befailproof.ai (recovered from web platform PR #374) | ||
|
|
||
| Fine-tuned instance: wght 417, ELSH 55 (slnt default 0). ELSH is | ||
| Bitcount's "Element Shape" axis: 55 = rounded squares; the font's | ||
| default 0 = round dots. | ||
|
|
||
| THIS FOLDER SHIPS A SELF-HOSTED STATIC INSTANCE | ||
| (bitcount-prop-single.woff2 — wght 417 + ELSH 55 baked in). That is the | ||
| reliable path: it renders the rounded-square shape on every device, | ||
| phones included, with no dependency on variable-axis support. | ||
|
|
||
| Why not the Google Fonts CDN? Google serves a STATIC default-instance | ||
| file to many mobile user-agents, so `font-variation-settings: "ELSH" 55` | ||
| silently no-ops there and you get the default round dots. Self-hosting | ||
| (or next/font, which also self-hosts) avoids that. See fonts.ts.example. | ||
| ===================================================================== */ | ||
|
|
||
| /* Self-hosted static instance — rounded squares baked in (no runtime axis needed). */ | ||
| @font-face { | ||
| font-family: "Bitcount Prop Single"; | ||
| src: url("./bitcount-prop-single.woff2") format("woff2"); | ||
| font-weight: 400; /* instanced at wght 417 */ | ||
| font-display: swap; | ||
| } | ||
|
|
||
| :root { | ||
| --font-bitcount: "Bitcount Prop Single"; | ||
| --font-display: var(--font-bitcount), "VT323", ui-monospace, monospace; | ||
|
|
||
| /* fine-tuned knobs from befailproof.ai. Shape/weight are baked into the | ||
| bundled woff2; these three control layout. */ | ||
| --title-scale: 0.9; /* title size multiplier */ | ||
| --title-squish: 0.9; /* horizontal scaleX squish */ | ||
| --title-tracking: 0.08em; /* letter-spacing */ | ||
| } | ||
|
|
||
| .bitcount-title { | ||
| font-family: var(--font-display); | ||
| /* No-op on the bundled static font (shape is baked in); applies the same | ||
| instance if you swap in the VARIABLE font instead, e.g. via next/font. */ | ||
| font-variation-settings: "wght" 417, "ELSH" 55; | ||
| letter-spacing: var(--title-tracking); | ||
| text-transform: lowercase; | ||
| transform: scaleX(var(--title-squish)); | ||
| transform-origin: left center; | ||
| font-size: calc(1em * var(--title-scale)); | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| // Bitcount Prop Single — Next.js loader (next/font/google). | ||
| // Rename to `fonts.ts`. Exposes the `--font-bitcount` CSS variable that | ||
| // bitcount.css consumes. `axes: ['ELSH']` opts into the Element Shape axis | ||
| // (wght is variable by default); the specific instance (wght 417, ELSH 55) | ||
| // is pinned in bitcount.css via font-variation-settings, not here. | ||
| // | ||
| // Shipped as `.ts.example` so this repo's tsc/eslint skip it. Rename on use. | ||
| import { Bitcount_Prop_Single } from 'next/font/google'; | ||
|
|
||
| export const bitcount = Bitcount_Prop_Single({ | ||
| subsets: ['latin'], | ||
| axes: ['ELSH'], | ||
| variable: '--font-bitcount', | ||
| display: 'swap', | ||
| }); | ||
|
|
||
| // In your root layout: | ||
| // import { bitcount } from './fonts'; | ||
| // export default function RootLayout({ children }: { children: React.ReactNode }) { | ||
| // return <html className={bitcount.variable}>{children}</html>; | ||
| // } | ||
| // | ||
| // Then anything with class="bitcount-title" picks up the tuned treatment. |
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.
Uh oh!
There was an error while loading. Please reload this page.