@flightdev/fonts 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/package.json +7 -1
package/README.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @flightdev/fonts
|
|
2
2
|
|
|
3
3
|
Font loading and optimization package.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install @
|
|
8
|
+
npm install @flightdev/fonts
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Quick Start
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
|
-
import { createFontLoader } from '@
|
|
15
|
-
import { googleFonts } from '@
|
|
14
|
+
import { createFontLoader } from '@flightdev/fonts';
|
|
15
|
+
import { googleFonts } from '@flightdev/fonts/google';
|
|
16
16
|
|
|
17
17
|
const fonts = createFontLoader({
|
|
18
18
|
adapter: googleFonts(),
|
|
@@ -33,7 +33,7 @@ document.documentElement.className = inter.className;
|
|
|
33
33
|
### Google Fonts
|
|
34
34
|
|
|
35
35
|
```typescript
|
|
36
|
-
import { googleFonts } from '@
|
|
36
|
+
import { googleFonts } from '@flightdev/fonts/google';
|
|
37
37
|
|
|
38
38
|
fonts.load('Roboto', {
|
|
39
39
|
weight: ['400', '700'],
|
|
@@ -44,7 +44,7 @@ fonts.load('Roboto', {
|
|
|
44
44
|
### Local Fonts
|
|
45
45
|
|
|
46
46
|
```typescript
|
|
47
|
-
import { localFonts } from '@
|
|
47
|
+
import { localFonts } from '@flightdev/fonts/local';
|
|
48
48
|
|
|
49
49
|
const myFont = await fonts.loadLocal('MyFont', {
|
|
50
50
|
src: [
|
|
@@ -58,7 +58,7 @@ const myFont = await fonts.loadLocal('MyFont', {
|
|
|
58
58
|
## React Components
|
|
59
59
|
|
|
60
60
|
```tsx
|
|
61
|
-
import { FontHead } from '@
|
|
61
|
+
import { FontHead } from '@flightdev/fonts/react';
|
|
62
62
|
|
|
63
63
|
function Layout({ children }) {
|
|
64
64
|
return (
|
|
@@ -88,7 +88,7 @@ For optimal performance, use the Vite plugin to automatically optimize fonts dur
|
|
|
88
88
|
|
|
89
89
|
```typescript
|
|
90
90
|
// vite.config.ts
|
|
91
|
-
import { fontOptimization } from '@
|
|
91
|
+
import { fontOptimization } from '@flightdev/fonts/vite';
|
|
92
92
|
|
|
93
93
|
export default defineConfig({
|
|
94
94
|
plugins: [
|
|
@@ -128,7 +128,7 @@ import {
|
|
|
128
128
|
codePointsToUnicodeRange,
|
|
129
129
|
detectRequiredSubsets,
|
|
130
130
|
generateFontFaceCSS,
|
|
131
|
-
} from '@
|
|
131
|
+
} from '@flightdev/fonts/subset';
|
|
132
132
|
|
|
133
133
|
// Get predefined ranges
|
|
134
134
|
const latinRange = UNICODE_RANGES.latin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flightdev/fonts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Agnostic font optimization with multiple adapter support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -55,6 +55,12 @@
|
|
|
55
55
|
"@types/react": "^19.0.6",
|
|
56
56
|
"typescript": "^5.7.2"
|
|
57
57
|
},
|
|
58
|
+
"homepage": "https://github.com/EliosLT/FlightDev",
|
|
59
|
+
"repository": {
|
|
60
|
+
"url": "https://github.com/EliosLT/FlightDev.git",
|
|
61
|
+
"directory": "packages/fonts",
|
|
62
|
+
"type": "git"
|
|
63
|
+
},
|
|
58
64
|
"scripts": {
|
|
59
65
|
"build": "tsc",
|
|
60
66
|
"dev": "tsc --watch"
|