Skip to content

Commit 5c5ba8b

Browse files
authored
docs: add CDN hosting instructions and improve usage examples (#26)
* feat: add a "CDN Hosted" section * feat: add "Using the Font" section Include note about using italic/oblique variants
1 parent 5084859 commit 5c5ba8b

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

README.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ brew install --cask font-server-mono
2020

2121
## Usage
2222

23+
### Self Hosted
24+
2325
Add the downloaded font files to your website's public/static directory. The examples below use a `/fonts/` prefix, but you can adjust this path to match your project structure.
2426

2527
Copy the below snippet into your CSS file:
@@ -46,14 +48,54 @@ Copy the below snippet into your CSS file:
4648
font-style: oblique;
4749
font-display: swap;
4850
}
51+
```
52+
53+
### CDN Hosted
54+
55+
ServerMono is also available through the [jsDelivr CDN](https://cdn.jsdelivr.net/gh/internet-development/www-server-mono/public/fonts/), so that you can use the fonts with downloading and hosting them yourself.
56+
57+
Copy the below snippet into your CSS file:
58+
59+
```css
60+
/* Regular weight - used for normal text */
61+
@font-face {
62+
font-family: 'ServerMono';
63+
src: url('https://cdn.jsdelivr.net/gh/internet-development/www-server-mono/public/fonts/ServerMono-Regular.woff2') format('woff2'), /* Best compression, modern browsers */
64+
url('https://cdn.jsdelivr.net/gh/internet-development/www-server-mono/public/fonts/ServerMono-Regular.woff') format('woff'), /* Good compression, wider support */
65+
url('https://cdn.jsdelivr.net/gh/internet-development/www-server-mono/public/fonts/ServerMono-Regular.otf') format('opentype'); /* Largest files, universal support */
66+
font-weight: normal;
67+
font-style: normal;
68+
font-display: swap;
69+
}
4970

71+
/* Slanted variant - used for italic/oblique text */
72+
@font-face {
73+
font-family: 'ServerMono';
74+
src: url('https://cdn.jsdelivr.net/gh/internet-development/www-server-mono/public/fonts/ServerMono-RegularSlanted.woff2') format('woff2'),
75+
url('https://cdn.jsdelivr.net/gh/internet-development/www-server-mono/public/fonts/ServerMono-RegularSlanted.woff') format('woff'),
76+
url('https://cdn.jsdelivr.net/gh/internet-development/www-server-mono/public/fonts/ServerMono-RegularSlanted.otf') format('opentype');
77+
font-weight: normal;
78+
font-style: oblique;
79+
font-display: swap;
80+
}
5081
```
5182

83+
### Using the Font
84+
5285
Then you can use it across your entire site like so:
5386

5487
```css
5588
:root {
56-
font-family: 'ServerMono', monospace;
89+
font-family: 'ServerMono', monospace;
90+
}
91+
```
92+
93+
To use the slanted version, set the font style to either `oblique` or `italic`:
94+
95+
```css
96+
p {
97+
font-family: 'ServerMono', monospace;
98+
font-style: 'oblique';
5799
}
58100
```
59101

0 commit comments

Comments
 (0)