@hozo/typography 0.1.0

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.
Files changed (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +162 -0
  3. package/dist/fonts-expo.d.ts +27 -0
  4. package/dist/fonts-expo.d.ts.map +1 -0
  5. package/dist/fonts-expo.js +63 -0
  6. package/dist/fonts-expo.js.map +1 -0
  7. package/dist/fonts-native.d.ts +28 -0
  8. package/dist/fonts-native.d.ts.map +1 -0
  9. package/dist/fonts-native.js +47 -0
  10. package/dist/fonts-native.js.map +1 -0
  11. package/dist/fonts.d.ts +62 -0
  12. package/dist/fonts.d.ts.map +1 -0
  13. package/dist/fonts.js +172 -0
  14. package/dist/fonts.js.map +1 -0
  15. package/dist/generated/ruby.d.ts +2 -0
  16. package/dist/generated/ruby.d.ts.map +1 -0
  17. package/dist/generated/ruby.js +2 -0
  18. package/dist/generated/ruby.js.map +1 -0
  19. package/dist/generated/ruby.native.d.ts +2 -0
  20. package/dist/generated/ruby.native.d.ts.map +1 -0
  21. package/dist/generated/ruby.native.js +2 -0
  22. package/dist/generated/ruby.native.js.map +1 -0
  23. package/dist/index.d.ts +36 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +62 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/index.native.d.ts +82 -0
  28. package/dist/index.native.d.ts.map +1 -0
  29. package/dist/index.native.js +136 -0
  30. package/dist/index.native.js.map +1 -0
  31. package/dist/ruby.native.d.ts +43 -0
  32. package/dist/ruby.native.d.ts.map +1 -0
  33. package/dist/ruby.native.js +50 -0
  34. package/dist/ruby.native.js.map +1 -0
  35. package/dist/text-size.d.ts +35 -0
  36. package/dist/text-size.d.ts.map +1 -0
  37. package/dist/text-size.js +40 -0
  38. package/dist/text-size.js.map +1 -0
  39. package/package.json +93 -0
  40. package/src/fonts-expo.ts +90 -0
  41. package/src/fonts-native.ts +85 -0
  42. package/src/fonts.ts +240 -0
  43. package/src/generated/ruby.native.ts +6 -0
  44. package/src/generated/ruby.ts +1 -0
  45. package/src/index.native.tsx +240 -0
  46. package/src/index.tsx +152 -0
  47. package/src/ruby.native.tsx +91 -0
  48. package/src/text-size.ts +41 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 iray-tno
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,162 @@
1
+ # @hozo/typography
2
+
3
+ Universal typography, semantic text formatting, relative text scaling, and accessible CJK ruby primitives for Hozo.
4
+
5
+ ```tsx
6
+ import {
7
+ Text,
8
+ Paragraph,
9
+ Heading,
10
+ Strong,
11
+ Emphasis,
12
+ Underline,
13
+ Strikethrough,
14
+ Del,
15
+ Sub,
16
+ Sup,
17
+ Code,
18
+ Small,
19
+ Mark,
20
+ NoBreak,
21
+ Ruby,
22
+ RubyText,
23
+ Link,
24
+ } from '@hozo/typography'
25
+
26
+ export function ArticlePreview() {
27
+ return (
28
+ <Paragraph>
29
+ <Heading level={2}>
30
+ <Ruby accessibilityLabel="かんじ">
31
+ 漢字<RubyText>かんじ</RubyText>
32
+ </Ruby>
33
+ </Heading>
34
+ <Strong>Bold importance</Strong> and <Emphasis>stress emphasis</Emphasis>.
35
+ Speed limit is <NoBreak>100 km/h</NoBreak>.
36
+ Read more at <Link href="/details" external>documentation</Link>.
37
+ </Paragraph>
38
+ )
39
+ }
40
+ ```
41
+
42
+ ## Component Catalog
43
+
44
+ ### 1. Structural Typography
45
+ - **`Heading`**: Document headings with `level={1 | 2 | 3 | 4 | 5 | 6}` (default `1`). Web lowers to `<h1>`–`<h6>`; Native lowers to `<Text accessibilityRole="header">`.
46
+ - **`Paragraph`**: Semantic prose paragraph. Web lowers to `<p>`; Native lowers to `<Text>`.
47
+ - **`Text`**: Foundational inline text container. Web lowers to `<span>`; Native lowers to `<Text>`.
48
+
49
+ ### 2. Semantic Inline Formatting
50
+ - **`Strong`**: High importance text. Web lowers to `<strong>`; Native lowers to `<Text>` with bold font weight.
51
+ - **`Emphasis`**: Stress emphasis text. Web lowers to `<em>`; Native lowers to `<Text>` with italic font style.
52
+ - **`Underline`**: Underlined text. Web lowers to `<u>`; Native lowers to `<Text>` with underline text decoration.
53
+ - **`Strikethrough` / `Del`**: Strikethrough / deleted text. Web lowers to `<s>`; Native lowers to `<Text>` with line-through text decoration.
54
+ - **`Sub` / `Sup`**: Subscript and superscript text. Web lowers to `<sub>` and `<sup>`; Native applies relative typography scaling and vertical alignments.
55
+ - **`Code`**: Inline computer code. Web lowers to `<code>`; Native applies monospace font family.
56
+ - **`Small`**: Side-comments / small print. Web lowers to `<small>`; Native lowers with reduced relative font size ratio.
57
+ - **`Mark`**: Highlighted / marked text. Web lowers to `<mark>`; Native applies highlight background color.
58
+ - **`NoBreak`**: Inline text with nowrap protection. Web lowers with `white-space: nowrap`; Native automatically converts ASCII spaces to non-breaking Unicode spaces (`\u00A0`).
59
+
60
+ ### 3. Accessible CJK Ruby
61
+ - **`Ruby` / `RubyText`**: Phonetic CJK annotations (furigana). Accessible via `RubyText` or `Ruby.RubyText`. Web lowers to standard `<ruby>` and `<rt>`. Native provides visual furigana while allowing parent `accessibilityLabel` annotations to suppress duplicate speech output on screen readers (VoiceOver & TalkBack).
62
+
63
+ ### 4. Universal Links
64
+ - **`Link`**: Accessible cross-platform hyperlink. Supports `href`, `target`, `rel`, `external`, and `onPress`. Web lowers to `<a href="...">`; Native lowers to an accessible Pressable text with link role.
65
+
66
+ ## Features
67
+
68
+ - **Semantic Web HTML**: Direct compiler lowering to real HTML5 typography and text-level semantics, completely free of `react-native-web`.
69
+ - **Zero Runtime Foundation**: Primitives compile away at build time, with pure React fallbacks when running uncompiled.
70
+ - **Relative Typography Scaling**: Built-in support for proportional text sizing (`text-sm`, `text-lg`, etc.) and parent-relative ratio calculations that stay synchronized between CSS and React Native styles.
71
+ ## Font assets
72
+
73
+ Font selection (`fontFamily`) and font availability are separate. Define the latter once without
74
+ registering anything at module import time:
75
+
76
+ ```ts
77
+ import {
78
+ createFontAvailability,
79
+ createFontFaceCss,
80
+ defineFonts,
81
+ fontFamily,
82
+ } from '@hozo/typography/fonts'
83
+
84
+ export const fonts = defineFonts({
85
+ body: {
86
+ family: 'Inter',
87
+ nativeFamily: { ios: 'InterVariable', android: 'inter' },
88
+ faces: [{
89
+ sources: {
90
+ web: [{ url: new URL('./Inter.woff2', import.meta.url).href, format: 'woff2' }],
91
+ ios: './assets/Inter.ttf',
92
+ android: './assets/Inter.ttf'
93
+ },
94
+ weight: '100 900'
95
+ }]
96
+ }
97
+ })
98
+
99
+ createFontFaceCss(fonts) // deterministic CSS for the Web build
100
+ fontFamily(fonts, 'body', 'ios') // "InterVariable"
101
+ ```
102
+
103
+ Pass the generated CSS to Hozo's Vite, TanStack Start, Storybook, Next, or Metro integration. It is
104
+ written once into the project-wide base stylesheet and loaded before generated utilities:
105
+
106
+ ```ts
107
+ hozo({
108
+ fontFaceCss: createFontFaceCss(fonts),
109
+ fontAvailability: createFontAvailability(fonts)
110
+ })
111
+ ```
112
+
113
+ `fontAvailability` is metadata only. It lets the compiler warn when a literal managed family uses
114
+ a platform or weight/style combination the manifest definitely does not provide. Unknown and
115
+ dynamic families are left alone because they may be system fonts or host-managed loaders.
116
+
117
+ Mark a platform as `external` when `next/font`, global CSS, Expo startup code, or native asset
118
+ linking already owns it. Such entries generate no duplicate registration and have no runtime cost.
119
+
120
+ For Expo, derive the options consumed by its official `expo-font` config plugin from the same
121
+ manifest. Hozo does not install or wrap Expo:
122
+
123
+ ```ts
124
+ // app.config.ts
125
+ import { createExpoFontOptions } from '@hozo/typography/fonts/expo'
126
+ import { fonts } from './fonts'
127
+
128
+ export default {
129
+ expo: {
130
+ plugins: [['expo-font', createExpoFontOptions(fonts)]]
131
+ }
132
+ }
133
+ ```
134
+
135
+ iOS receives its font file list; Android receives named XML families with explicit weight/style
136
+ faces. Variable-weight and oblique Android faces are refused because Expo's Android configuration
137
+ cannot represent them without silently changing their meaning.
138
+
139
+ For a bare React Native app, Hozo leaves native-project mutation to the app but makes the required
140
+ registration set explicit and testable:
141
+
142
+ ```ts
143
+ import { createNativeFontPlan } from '@hozo/typography/fonts/native'
144
+ import { fonts } from './fonts'
145
+
146
+ const iosFonts = createNativeFontPlan(fonts, 'ios')
147
+ const androidFonts = createNativeFontPlan(fonts, 'android')
148
+ ```
149
+
150
+ Register every entry in `files` before React renders, using the native asset-linking mechanism your
151
+ app already owns. `families` gives the corresponding `fontFamily`, weight, and style descriptors;
152
+ it is suitable for a small project generator or a CI assertion. The helper only describes the
153
+ plan—it never edits Xcode, Gradle, Info.plist, or Android resources—and omits platforms marked
154
+ `external` so an existing loader remains the single owner.
155
+
156
+ <!-- generated: package-footer -->
157
+
158
+ ---
159
+
160
+ Part of [Hozo](https://iray-tno.github.io/hozo/), a Rust-powered universal UI compiler and accessibility-first layer for React Native. Most applications install [`@hozo/core`](https://www.npmjs.com/package/@hozo/core) and one build integration; see [Getting started](https://github.com/iray-tno/hozo#getting-started). Source and issues: [github.com/iray-tno/hozo](https://github.com/iray-tno/hozo).
161
+
162
+ <!-- /generated: package-footer -->
@@ -0,0 +1,27 @@
1
+ import { type FontManifest } from './fonts.ts';
2
+ export interface ExpoAndroidFontDefinition {
3
+ path: string;
4
+ weight: number;
5
+ style?: 'normal' | 'italic';
6
+ }
7
+ export interface ExpoAndroidFontFamily {
8
+ fontFamily: string;
9
+ fontDefinitions: ExpoAndroidFontDefinition[];
10
+ }
11
+ /** The public option shape accepted by Expo's `expo-font` config plugin. */
12
+ export interface ExpoFontPluginOptions {
13
+ ios?: {
14
+ fonts: string[];
15
+ };
16
+ android?: {
17
+ fonts: ExpoAndroidFontFamily[];
18
+ };
19
+ }
20
+ /**
21
+ * Derives options for Expo's official `expo-font` config plugin.
22
+ *
23
+ * This function does not import Expo. Keep `expo-font` in the application and
24
+ * pass the returned value as its plugin options from `app.config.ts`.
25
+ */
26
+ export declare function createExpoFontOptions(manifest: FontManifest): ExpoFontPluginOptions;
27
+ //# sourceMappingURL=fonts-expo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fonts-expo.d.ts","sourceRoot":"","sources":["../src/fonts-expo.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EAGlB,MAAM,YAAY,CAAA;AAEnB,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;CAC5B;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,EAAE,yBAAyB,EAAE,CAAA;CAC7C;AAED,4EAA4E;AAC5E,MAAM,WAAW,qBAAqB;IACpC,GAAG,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAA;IACzB,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,qBAAqB,EAAE,CAAA;KAAE,CAAA;CAC7C;AAuBD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,YAAY,GAAG,qBAAqB,CAqCnF"}
@@ -0,0 +1,63 @@
1
+ import { defineFonts, } from './fonts.js';
2
+ function isExternal(definition, platform) {
3
+ return definition.external === true || definition.external?.includes(platform) === true;
4
+ }
5
+ function androidWeight(weight, id) {
6
+ if (weight === undefined || weight === 'normal')
7
+ return 400;
8
+ if (weight === 'bold')
9
+ return 700;
10
+ if (typeof weight === 'number')
11
+ return weight;
12
+ throw new TypeError(`Font ${JSON.stringify(id)} uses variable weight ${JSON.stringify(weight)}; Expo Android XML needs one static face per weight`);
13
+ }
14
+ function androidStyle(style, id) {
15
+ if (style === undefined || style === 'normal')
16
+ return 'normal';
17
+ if (style === 'italic')
18
+ return 'italic';
19
+ throw new TypeError(`Font ${JSON.stringify(id)} uses oblique style; Expo Android XML supports normal or italic`);
20
+ }
21
+ /**
22
+ * Derives options for Expo's official `expo-font` config plugin.
23
+ *
24
+ * This function does not import Expo. Keep `expo-font` in the application and
25
+ * pass the returned value as its plugin options from `app.config.ts`.
26
+ */
27
+ export function createExpoFontOptions(manifest) {
28
+ defineFonts(manifest);
29
+ const ios = new Set();
30
+ const android = new Map();
31
+ for (const [id, definition] of Object.entries(manifest)) {
32
+ for (const face of definition.faces ?? []) {
33
+ if (!isExternal(definition, 'ios') && face.sources.ios !== undefined) {
34
+ ios.add(face.sources.ios);
35
+ }
36
+ if (isExternal(definition, 'android') || face.sources.android === undefined)
37
+ continue;
38
+ const family = definition.nativeFamily?.android ?? definition.family;
39
+ const font = {
40
+ path: face.sources.android,
41
+ weight: androidWeight(face.weight, id),
42
+ style: androidStyle(face.style, id),
43
+ };
44
+ const definitions = android.get(family) ?? new Map();
45
+ definitions.set(JSON.stringify(font), font);
46
+ android.set(family, definitions);
47
+ }
48
+ }
49
+ return {
50
+ ...(ios.size === 0 ? {} : { ios: { fonts: [...ios] } }),
51
+ ...(android.size === 0
52
+ ? {}
53
+ : {
54
+ android: {
55
+ fonts: [...android].map(([fontFamily, definitions]) => ({
56
+ fontFamily,
57
+ fontDefinitions: [...definitions.values()],
58
+ })),
59
+ },
60
+ }),
61
+ };
62
+ }
63
+ //# sourceMappingURL=fonts-expo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fonts-expo.js","sourceRoot":"","sources":["../src/fonts-expo.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,GAKZ,MAAM,YAAY,CAAA;AAmBnB,SAAS,UAAU,CAAC,UAAgC,EAAE,QAA2B;IAC/E,OAAO,UAAU,CAAC,QAAQ,KAAK,IAAI,IAAI,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAA;AACzF,CAAC;AAED,SAAS,aAAa,CAAC,MAA8B,EAAE,EAAU;IAC/D,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,QAAQ;QAAE,OAAO,GAAG,CAAA;IAC3D,IAAI,MAAM,KAAK,MAAM;QAAE,OAAO,GAAG,CAAA;IACjC,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAA;IAC7C,MAAM,IAAI,SAAS,CACjB,QAAQ,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,yBAAyB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,qDAAqD,CAC/H,CAAA;AACH,CAAC;AAED,SAAS,YAAY,CAAC,KAA4B,EAAE,EAAU;IAC5D,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAA;IAC9D,IAAI,KAAK,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAA;IACvC,MAAM,IAAI,SAAS,CACjB,QAAQ,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,iEAAiE,CAC5F,CAAA;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UA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ACL,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,EAAE,EAAE,CAAC;QACvD,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC;YACpB,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC;gBACE,OAAO,EAAE;oBACP,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC;wBACtD,UAAU;wBACV,eAAe,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC;qBAC3C,CAAC,CAAC;iBACJ;aACF,CAAC;KACP,CAAA;AACH,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { type FontManifest, type FontStyle } from './fonts.js';
2
+ export type NativeFontPlatform = 'ios' | 'android';
3
+ export interface NativeFontFacePlan {
4
+ /** Project-relative path that the native project must register before React renders. */
5
+ path: string;
6
+ /** The descriptor authored in the shared manifest, with aliases canonicalized. */
7
+ weight: number | `${number} ${number}`;
8
+ style: FontStyle;
9
+ }
10
+ export interface NativeFontFamilyPlan {
11
+ /** Stable manifest key, useful to generators and validation tooling. */
12
+ id: string;
13
+ /** The value to use as React Native's `fontFamily`. */
14
+ family: string;
15
+ faces: NativeFontFacePlan[];
16
+ }
17
+ export interface NativeFontPlan {
18
+ platform: NativeFontPlatform;
19
+ /** Deduplicated files that must be registered by the host project. */
20
+ files: string[];
21
+ families: NativeFontFamilyPlan[];
22
+ }
23
+ /**
24
+ * Produces a deterministic description of the assets a bare React Native host must register.
25
+ * It deliberately performs no filesystem or native-project mutation.
26
+ */
27
+ export declare function createNativeFontPlan(manifest: FontManifest, platform: NativeFontPlatform): NativeFontPlan;
28
+ //# sourceMappingURL=fonts-native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fonts-native.d.ts","sourceRoot":"","sources":["../src/fonts-native.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,SAAS,EAGf,MAAM,YAAY,CAAA;AAEnB,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,SAAS,CAAA;AAElD,MAAM,WAAW,kBAAkB;IACjC,wFAAwF;IACxF,IAAI,EAAE,MAAM,CAAA;IACZ,kFAAkF;IAClF,MAAM,EAAE,MAAM,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,CAAA;IACtC,KAAK,EAAE,SAAS,CAAA;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAA;IACV,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,kBAAkB,EAAE,CAAA;CAC5B;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,sEAAsE;IACtE,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,QAAQ,EAAE,oBAAoB,EAAE,CAAA;CACjC;AAeD;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,kBAAkB,GAC3B,cAAc,CA+BhB"}
@@ -0,0 +1,47 @@
1
+ import { defineFonts, fontFamily, } from './fonts.js';
2
+ function canonicalWeight(weight) {
3
+ if (weight === undefined || weight === 'normal')
4
+ return 400;
5
+ if (weight === 'bold')
6
+ return 700;
7
+ return weight;
8
+ }
9
+ function isExternal(external, platform) {
10
+ return external === true || external?.includes(platform) === true;
11
+ }
12
+ /**
13
+ * Produces a deterministic description of the assets a bare React Native host must register.
14
+ * It deliberately performs no filesystem or native-project mutation.
15
+ */
16
+ export function createNativeFontPlan(manifest, platform) {
17
+ defineFonts(manifest);
18
+ const files = new Set();
19
+ const families = [];
20
+ for (const [id, definition] of Object.entries(manifest)) {
21
+ if (isExternal(definition.external, platform))
22
+ continue;
23
+ const seenFaces = new Set();
24
+ const faces = [];
25
+ for (const face of definition.faces ?? []) {
26
+ const path = face.sources[platform];
27
+ if (path === undefined)
28
+ continue;
29
+ const planned = {
30
+ path: path.trim(),
31
+ weight: canonicalWeight(face.weight),
32
+ style: face.style ?? 'normal',
33
+ };
34
+ const key = JSON.stringify(planned);
35
+ if (seenFaces.has(key))
36
+ continue;
37
+ seenFaces.add(key);
38
+ files.add(planned.path);
39
+ faces.push(planned);
40
+ }
41
+ if (faces.length > 0) {
42
+ families.push({ id, family: fontFamily(manifest, id, platform), faces });
43
+ }
44
+ }
45
+ return { platform, files: [...files], families };
46
+ }
47
+ //# sourceMappingURL=fonts-native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fonts-native.js","sourceRoot":"","sources":["../src/fonts-native.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAIX,UAAU,GACX,MAAM,YAAY,CAAA;AA2BnB,SAAS,eAAe,CAAC,MAA8B;IACrD,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,QAAQ;QAAE,OAAO,GAAG,CAAA;IAC3D,IAAI,MAAM,KAAK,MAAM;QAAE,OAAO,GAAG,CAAA;IACjC,OAAO,MAAM,CAAA;AACf,CAAC;AAED,SAAS,UAAU,CACjB,QAAoE,EACpE,QAA4B;IAE5B,OAAO,QAAQ,KAAK,IAAI,IAAI,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAA;AACnE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAClC,QAAsB,EACtB,QAA4B;IAE5B,WAAW,CAAC,QAAQ,CAAC,CAAA;IACrB,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAA;IAC/B,MAAM,QAAQ,GAA2B,EAAE,CAAA;IAE3C,KAAK,MAAM,CAAC,EAAE,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;Q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ic' | 'oblique';
3
+ export type FontDisplay = 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
4
+ export type FontFormat = 'woff2' | 'woff' | 'truetype' | 'opentype';
5
+ export type FontWeight = number | 'normal' | 'bold' | `${number} ${number}`;
6
+ export interface WebFontSource {
7
+ /** A URL already resolved by the host bundler, or one valid from the emitted stylesheet. */
8
+ url: string;
9
+ format?: FontFormat;
10
+ }
11
+ export interface FontFaceSources {
12
+ web?: readonly WebFontSource[];
13
+ /** Project-relative file path used by Expo or a bare iOS project. */
14
+ ios?: string;
15
+ /** Project-relative file path used by Expo or a bare Android project. */
16
+ android?: string;
17
+ }
18
+ export interface FontFaceDefinition {
19
+ sources: FontFaceSources;
20
+ weight?: FontWeight;
21
+ style?: FontStyle;
22
+ display?: FontDisplay;
23
+ unicodeRange?: string | readonly string[];
24
+ }
25
+ export interface FontFamilyDefinition {
26
+ /** CSS family name. It is also the Native fallback when no platform name is supplied. */
27
+ family: string;
28
+ /** Native family/PostScript names when they differ from the logical Web family. */
29
+ nativeFamily?: {
30
+ ios?: string;
31
+ android?: string;
32
+ };
33
+ faces?: readonly FontFaceDefinition[];
34
+ /** Platforms whose font availability is owned by the host, such as next/font or linked assets. */
35
+ external?: true | readonly FontPlatform[];
36
+ }
37
+ export type FontManifest = Readonly<Record<string, FontFamilyDefinition>>;
38
+ export interface FontAvailability {
39
+ families: Array<{
40
+ id: string;
41
+ names: Record<FontPlatform, string>;
42
+ external: FontPlatform[];
43
+ faces: Array<{
44
+ platforms: FontPlatform[];
45
+ weightFrom: number;
46
+ weightTo: number;
47
+ style: FontStyle;
48
+ }>;
49
+ }>;
50
+ }
51
+ /**
52
+ * Validates a font manifest while preserving its exact logical-family keys for inference.
53
+ * Calling it does not register or load anything.
54
+ */
55
+ export declare function defineFonts<const T extends FontManifest>(manifest: T): T;
56
+ /** Resolves one logical family to the name authored in a platform style. */
57
+ export declare function fontFamily(manifest: FontManifest, id: string, platform: FontPlatform): string | undefined;
58
+ /** Creates the small serializable registry used by Hozo's conservative compiler diagnostics. */
59
+ export declare function createFontAvailability(manifest: FontManifest): FontAvailability;
60
+ /** Creates deterministic, deduplicated `@font-face` CSS for Web-managed faces. */
61
+ export declare function createFontFaceCss(manifest: FontManifest): string;
62
+ //# sourceMappingURL=fonts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../src/fonts.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,KAAK,GAAG,SAAS,CAAA;AACpD,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;AACvD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAA;AAC7E,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAA;AACnE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,CAAA;AAE3E,MAAM,WAAW,aAAa;IAC5B,4FAA4F;IAC5F,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,UAAU,CAAA;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,EAAE,SAAS,aAAa,EAAE,CAAA;IAC9B,qEAAqE;IACrE,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,eAAe,CAAA;IACxB,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAA;CAC1C;AAED,MAAM,WAAW,oBAAoB;I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 @@
1
+ function externalPlatforms(value) {
2
+ return new Set(value === true ? ['web', 'ios', 'android'] : (value ?? []));
3
+ }
4
+ function printable(value, label) {
5
+ const trimmed = value.trim();
6
+ const hasControlCharacter = [...trimmed].some((character) => {
7
+ const code = character.charCodeAt(0);
8
+ return code < 32 || code === 127;
9
+ });
10
+ if (trimmed.length === 0 || hasControlCharacter) {
11
+ throw new TypeError(`${label} must be a non-empty printable string`);
12
+ }
13
+ return trimmed;
14
+ }
15
+ function normalizedWeight(weight) {
16
+ if (weight === undefined)
17
+ return '400';
18
+ if (weight === 'normal')
19
+ return '400';
20
+ if (weight === 'bold')
21
+ return '700';
22
+ if (typeof weight === 'number') {
23
+ if (!Number.isInteger(weight) || weight < 1 || weight > 1000) {
24
+ throw new TypeError(`Font weight ${weight} must be an integer from 1 through 1000`);
25
+ }
26
+ return String(weight);
27
+ }
28
+ const match = /^(\d+) (\d+)$/.exec(weight);
29
+ if (!match)
30
+ throw new TypeError(`Invalid variable font weight range ${JSON.stringify(weight)}`);
31
+ const from = Number(match[1]);
32
+ const to = Number(match[2]);
33
+ if (from < 1 || to > 1000 || from >= to) {
34
+ throw new TypeError(`Variable font weight range ${JSON.stringify(weight)} must increase within 1..1000`);
35
+ }
36
+ return `${from} ${to}`;
37
+ }
38
+ function ranges(value) {
39
+ const values = typeof value === 'string' ? [value] : (value ?? []);
40
+ return values.map((range) => {
41
+ const trimmed = range.trim();
42
+ if (!/^U\+[0-9A-F?]+(?:-[0-9A-F]+)?$/i.test(trimmed)) {
43
+ throw new TypeError(`Invalid Unicode range ${JSON.stringify(range)}`);
44
+ }
45
+ return trimmed.toUpperCase();
46
+ });
47
+ }
48
+ function validateFace(id, face, external) {
49
+ normalizedWeight(face.weight);
50
+ const sources = face.sources;
51
+ const web = sources.web ?? [];
52
+ if (external.has('web') && web.length > 0) {
53
+ throw new TypeError(`Font ${JSON.stringify(id)} is externally managed on Web but also has Web sources`);
54
+ }
55
+ if (external.has('ios') && sources.ios !== undefined) {
56
+ throw new TypeError(`Font ${JSON.stringify(id)} is externally managed on iOS but also has an iOS source`);
57
+ }
58
+ if (external.has('android') && sources.android !== undefined) {
59
+ throw new TypeError(`Font ${JSON.stringify(id)} is externally managed on Android but also has an Android source`);
60
+ }
61
+ for (const source of web)
62
+ printable(source.url, `Web source for font ${JSON.stringify(id)}`);
63
+ if (sources.ios !== undefined)
64
+ printable(sources.ios, `iOS source for font ${JSON.stringify(id)}`);
65
+ if (sources.android !== undefined) {
66
+ printable(sources.android, `Android source for font ${JSON.stringify(id)}`);
67
+ }
68
+ ranges(face.unicodeRange);
69
+ if (web.length === 0 && sources.ios === undefined && sources.android === undefined) {
70
+ throw new TypeError(`Font ${JSON.stringify(id)} has a face with no source`);
71
+ }
72
+ }
73
+ /**
74
+ * Validates a font manifest while preserving its exact logical-family keys for inference.
75
+ * Calling it does not register or load anything.
76
+ */
77
+ export function defineFonts(manifest) {
78
+ if (Object.keys(manifest).length === 0)
79
+ throw new TypeError('A font manifest cannot be empty');
80
+ for (const [id, definition] of Object.entries(manifest)) {
81
+ if (!/^[A-Za-z][A-Za-z0-9_-]*$/.test(id)) {
82
+ throw new TypeError(`Invalid logical font identifier ${JSON.stringify(id)}`);
83
+ }
84
+ printable(definition.family, `Family name for font ${JSON.stringify(id)}`);
85
+ if (definition.nativeFamily?.ios !== undefined) {
86
+ printable(definition.nativeFamily.ios, `iOS family for font ${JSON.stringify(id)}`);
87
+ }
88
+ if (definition.nativeFamily?.android !== undefined) {
89
+ printable(definition.nativeFamily.android, `Android family for font ${JSON.stringify(id)}`);
90
+ }
91
+ const external = externalPlatforms(definition.external);
92
+ if ((definition.faces?.length ?? 0) === 0 && external.size === 0) {
93
+ throw new TypeError(`Font ${JSON.stringify(id)} needs a face or an explicitly external platform`);
94
+ }
95
+ for (const face of definition.faces ?? [])
96
+ validateFace(id, face, external);
97
+ }
98
+ return manifest;
99
+ }
100
+ /** Resolves one logical family to the name authored in a platform style. */
101
+ export function fontFamily(manifest, id, platform) {
102
+ const definition = manifest[id];
103
+ if (!definition)
104
+ return undefined;
105
+ if (platform === 'web')
106
+ return definition.family;
107
+ return definition.nativeFamily?.[platform] ?? definition.family;
108
+ }
109
+ function weightRange(weight) {
110
+ const normalized = normalizedWeight(weight);
111
+ const [from, to = from] = normalized.split(' ').map(Number);
112
+ return [from, to];
113
+ }
114
+ /** Creates the small serializable registry used by Hozo's conservative compiler diagnostics. */
115
+ export function createFontAvailability(manifest) {
116
+ defineFonts(manifest);
117
+ return {
118
+ families: Object.entries(manifest).map(([id, definition]) => ({
119
+ id,
120
+ names: {
121
+ web: definition.family,
122
+ ios: definition.nativeFamily?.ios ?? definition.family,
123
+ android: definition.nativeFamily?.android ?? definition.family,
124
+ },
125
+ external: [...externalPlatforms(definition.external)],
126
+ faces: (definition.faces ?? []).map((face) => {
127
+ const [weightFrom, weightTo] = weightRange(face.weight);
128
+ return {
129
+ platforms: ['web', 'ios', 'android'].filter((platform) => platform === 'web'
130
+ ? (face.sources.web?.length ?? 0) > 0
131
+ : face.sources[platform] !== undefined),
132
+ weightFrom,
133
+ weightTo,
134
+ style: face.style ?? 'normal',
135
+ };
136
+ }),
137
+ })),
138
+ };
139
+ }
140
+ function quoted(value) {
141
+ return `"${value.replaceAll('\\', '\\\\').replaceAll('"', '\\"')}"`;
142
+ }
143
+ /** Creates deterministic, deduplicated `@font-face` CSS for Web-managed faces. */
144
+ export function createFontFaceCss(manifest) {
145
+ defineFonts(manifest);
146
+ const rules = new Set();
147
+ for (const definition of Object.values(manifest)) {
148
+ if (externalPlatforms(definition.external).has('web'))
149
+ continue;
150
+ for (const face of definition.faces ?? []) {
151
+ const sources = face.sources.web ?? [];
152
+ if (sources.length === 0)
153
+ continue;
154
+ const src = sources
155
+ .map(({ url, format }) => `url(${quoted(url)})${format ? ` format(${quoted(format)})` : ''}`)
156
+ .join(', ');
157
+ const descriptors = [
158
+ ` font-family: ${quoted(definition.family)};`,
159
+ ` src: ${src};`,
160
+ ` font-style: ${face.style ?? 'normal'};`,
161
+ ` font-weight: ${normalizedWeight(face.weight)};`,
162
+ ` font-display: ${face.display ?? 'swap'};`,
163
+ ];
164
+ const unicode = ranges(face.unicodeRange);
165
+ if (unicode.length > 0)
166
+ descriptors.push(` unicode-range: ${unicode.join(', ')};`);
167
+ rules.add(`@font-face {\n${descriptors.join('\n')}\n}`);
168
+ }
169
+ }
170
+ return rules.size === 0 ? '' : `${[...rules].join('\n\n')}\n`;
171
+ }
172
+ //# sourceMappingURL=fonts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fonts.js","sourceRoot":"","sources":["../src/fonts.ts"],"names":[],"mappings":"AAsDA,SAAS,iBAAiB,CAAC,KAAuC;IAChE,OAAO,IAAI,GAAG,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAA;AAC5E,CAAC;AAED,SAAS,SAAS,CAAC,KAAa,EAAE,KAAa;IAC7C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IAC5B,MAAM,mBAAmB,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE;QAC1D,MAAM,IAAI,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;QACpC,OAAO,IAAI,GAAG,EAAE,IAAI,IAAI,KAAK,GAAG,CAAA;IAClC,CAAC,CAAC,CAAA;IACF,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,mBAAmB,EAAE,CAAC;QAChD,MAAM,IAAI,SAAS,CAAC,GAAG,KAAK,uCAAuC,CAAC,CAAA;IACtE,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,SAAS,gBAAgB,CAAC,MAA8B;IACtD,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,KAAK,CAAA;IACtC,IAAI,MAA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AAiB,IAAI,CAAC,KAAK,IAAI,QAAQ,GAAG;gBAC1C,kBAAkB,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG;gBAClD,mBAAmB,IAAI,CAAC,OAAO,IAAI,MAAM,GAAG;aAC7C,CAAA;YACD,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;YACzC,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;gBAAE,WAAW,CAAC,IAAI,CAAC,oBAAoB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACnF,KAAK,CAAC,GAAG,CAAC,iBAAiB,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACzD,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAA;AAC/D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Ruby as HozoRuby, RubyText as HozoRubyText } from '../index.tsx';
2
+ //# sourceMappingURL=ruby.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ruby.d.ts","sourceRoot":"","sources":["../../src/generated/ruby.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,cAAc,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { Ruby as HozoRuby, RubyText as HozoRubyText } from '../index.js';
2
+ //# sourceMappingURL=ruby.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ruby.js","sourceRoot":"","sources":["../../src/generated/ruby.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,aAAc,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { HozoRuby, type HozoRubyProps, HozoRubyText, type HozoRubyTextProps, } from '../ruby.native.tsx';
2
+ //# sourceMappingURL=ruby.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ruby.native.d.ts","sourceRoot":"","sources":["../../src/generated/ruby.native.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,KAAK,aAAa,EAClB,YAAY,EACZ,KAAK,iBAAiB,GACvB,MAAM,oBAAoB,CAAA"}