furifont 0.1.2 → 0.2.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 (57) hide show
  1. package/dist/cli.mjs +1 -1
  2. package/dist/client/200.html +1 -1
  3. package/dist/client/404.html +1 -1
  4. package/dist/client/_nuxt/5JUjClMv.js +3 -0
  5. package/dist/client/_nuxt/B8uEzYfq.js +1 -0
  6. package/dist/client/_nuxt/BGvM1Idk.js +2 -0
  7. package/dist/client/_nuxt/BI2Q9Enf.js +1 -0
  8. package/dist/client/_nuxt/{DA1XwGcq.js → Bo7DzF0m.js} +1 -1
  9. package/dist/client/_nuxt/CkUAspOr.js +3 -0
  10. package/dist/client/_nuxt/Ckc75SSp.js +1 -0
  11. package/dist/client/_nuxt/D4ezFGbh.js +2 -0
  12. package/dist/client/_nuxt/{CQTZHv-y.js → D8T7CxEJ.js} +1 -1
  13. package/dist/client/_nuxt/{Bs3Pv9Qv.js → DBjETv8r.js} +1 -1
  14. package/dist/client/_nuxt/IB1Ryazr.js +3 -0
  15. package/dist/client/_nuxt/IYM3Ipyg.js +1 -0
  16. package/dist/client/_nuxt/{C4NVi0HP.js → OTZjk4e0.js} +2 -2
  17. package/dist/client/_nuxt/OoUlbf8J.js +1 -0
  18. package/dist/client/_nuxt/Sgj54NgJ.js +3 -0
  19. package/dist/client/_nuxt/{Bc3GUY-S.js → VtV-OZNb.js} +2 -2
  20. package/dist/client/_nuxt/builds/latest.json +1 -1
  21. package/dist/client/_nuxt/builds/meta/0a20d338-7497-4d3f-82e8-9f5ae0d7be3d.json +1 -0
  22. package/dist/client/_nuxt/{entry.CsCxOCYm.css → entry.z8A6-8bZ.css} +1 -1
  23. package/dist/client/customize/index.html +1 -1
  24. package/dist/client/furifont.user.js +2 -2
  25. package/dist/client/index.html +1 -1
  26. package/dist/client/reference/index.html +1 -1
  27. package/dist/client/version.json +1 -1
  28. package/dist/{config-BgEXAgR6.mjs → config-B9fOD9wc.mjs} +1 -1
  29. package/dist/devframe.mjs +2 -2
  30. package/dist/index.d.mts +3 -1
  31. package/dist/index.mjs +2 -2
  32. package/dist/{studio-DLNpk_rE.mjs → studio-IpmE7PF6.mjs} +1 -1
  33. package/package.json +5 -5
  34. package/dist/client/_nuxt/AmQakyTh.js +0 -1
  35. package/dist/client/_nuxt/BDNMzG2s.js +0 -1
  36. package/dist/client/_nuxt/CC4_XjFP.js +0 -3
  37. package/dist/client/_nuxt/CEWHii-_.js +0 -3
  38. package/dist/client/_nuxt/CEo6aVYN.js +0 -1
  39. package/dist/client/_nuxt/CRzLMJPS.js +0 -1
  40. package/dist/client/_nuxt/Cg7TlFyt.js +0 -1
  41. package/dist/client/_nuxt/DGhFAXuQ.js +0 -1
  42. package/dist/client/_nuxt/DLl_pn_F.js +0 -58
  43. package/dist/client/_nuxt/DSYkQlQa.js +0 -1
  44. package/dist/client/_nuxt/DT7XmrQw.js +0 -132
  45. package/dist/client/_nuxt/DTC_KzWZ.js +0 -79
  46. package/dist/client/_nuxt/DhRy_lmV.js +0 -1
  47. package/dist/client/_nuxt/DmOlRIb5.js +0 -2
  48. package/dist/client/_nuxt/DmlUWPPW.js +0 -3
  49. package/dist/client/_nuxt/Dz56DRZ7.js +0 -59
  50. package/dist/client/_nuxt/HB7Qu17x.js +0 -1
  51. package/dist/client/_nuxt/JRbXhaR6.js +0 -1
  52. package/dist/client/_nuxt/builds/meta/1bd12827-b513-45af-9638-872afc8faff4.json +0 -1
  53. package/dist/client/_nuxt/g9q6jbAq.js +0 -1
  54. package/dist/client/_nuxt/jjE7wdAL.js +0 -1
  55. package/dist/client/_nuxt/nNFr3PcB.js +0 -2
  56. package/dist/client/_nuxt/nQF5Cd64.js +0 -3
  57. package/dist/client/docs/index.html +0 -1
@@ -1,132 +0,0 @@
1
- var e=`# Use on your website
2
-
3
- Furifont is a normal web font. Load it with \`@font-face\`, set it on your Japanese text, and the ruby shows. Your HTML does not change: no \`<ruby>\` tags and no JavaScript.
4
-
5
- ## Load the font
6
-
7
- Download the \`.woff2\` files from the [latest release](https://github.com/antfu/furifont/releases/latest) and put them with your site's other files. The variable font (\`VF.woff2\`) has every weight in one file:
8
-
9
- \`\`\`css
10
- @font-face {
11
- font-family: 'Furifont Sans';
12
- src: url('/fonts/FurifontSansVF.woff2') format('woff2');
13
- font-weight: 250 900;
14
- font-display: swap;
15
- }
16
- \`\`\`
17
-
18
- The name in \`font-family\` is yours to choose. The other families are \`FurifontSansRomaji\`, \`FurifontSerif\` and \`FurifontSerifRomaji\`.
19
-
20
- Each font has thousands of words, so a variable font is about 6 MB. Serve it with a long cache time, so the browser downloads it only once.
21
-
22
- To try Furifont without hosting the files, you can load them from this site. These URLs always serve the latest release:
23
-
24
- \`\`\`css
25
- @font-face {
26
- font-family: 'Furifont Sans';
27
- src: url('https://furifont.antfu.me/fonts/FurifontSansVF.woff2') format('woff2');
28
- font-weight: 250 900;
29
- }
30
- \`\`\`
31
-
32
- ## Set it on your text
33
-
34
- \`\`\`css
35
- :lang(ja) {
36
- font-family: 'Furifont Sans', sans-serif;
37
- line-height: 1.8;
38
- }
39
- \`\`\`
40
-
41
- ::docs-example{text="今日は日本語の勉強をします。"}
42
- ::
43
-
44
- **Give the lines room.** The ruby is drawn above the kanji, inside the line. With a \`line-height\` under 1.6, the ruby of one line touches the line above it.
45
-
46
- **Keep your Latin font.** Put your own font first. It sets the Latin letters, and the browser takes the kanji and kana from Furifont:
47
-
48
- \`\`\`css
49
- body {
50
- font-family: Inter, 'Furifont Sans', sans-serif;
51
- }
52
- \`\`\`
53
-
54
- **Align with other fonts.** Furifont makes its line taller at the top, to make room for the ruby. Next to icons or other fonts, its text can then sit a little low. These descriptors put the kanji in the middle of the line, the way this site does:
55
-
56
- \`\`\`css
57
- @font-face {
58
- font-family: 'Furifont Sans';
59
- src: url('/fonts/FurifontSansVF.woff2') format('woff2');
60
- font-weight: 250 900;
61
- ascent-override: 88%;
62
- descent-override: 12%;
63
- line-gap-override: 0%;
64
- }
65
- \`\`\`
66
-
67
- ## CSS controls
68
-
69
- ### Turn the ruby off
70
-
71
- Stylistic set 1 (\`ss01\`) shows the plain kanji. Use it where ruby gets in the way, such as headings, buttons or tables:
72
-
73
- \`\`\`css
74
- h1, button {
75
- font-feature-settings: 'ss01';
76
- }
77
- \`\`\`
78
-
79
- ::docs-example{text="今日は日本語の勉強をします。" css="font-feature-settings: 'ss01'"}
80
- ::
81
-
82
- If your page already has \`<ruby>\` markup, turn Furifont's ruby off inside it, so the text does not get ruby twice:
83
-
84
- \`\`\`css
85
- ruby {
86
- font-feature-settings: 'ss01';
87
- }
88
- \`\`\`
89
-
90
- ### Weight
91
-
92
- The variable font has every weight from 250 (ExtraLight) to 900 (Heavy). The ruby follows the weight of the kanji:
93
-
94
- \`\`\`css
95
- .light { font-weight: 250; }
96
- .heavy { font-weight: 900; }
97
- \`\`\`
98
-
99
- ::docs-example{text="日本語の勉強" css="font-weight: 250"}
100
- ::
101
-
102
- ::docs-example{text="日本語の勉強" css="font-weight: 900"}
103
- ::
104
-
105
- ### Size
106
-
107
- The ruby is part of the font, so it scales with \`font-size\`. Nothing else needs to change.
108
-
109
- ### Choose a reading
110
-
111
- Furifont shows the most common reading of each word. To show another one, set \`salt\` (stylistic alternates) on a \`<span>\` around the word. \`'salt' 2\` shows reading 2:
112
-
113
- \`\`\`html
114
- <span style="font-feature-settings: 'salt' 2">市場</span>
115
- \`\`\`
116
-
117
- ::docs-example{text="市場"}
118
- ::
119
-
120
- ::docs-example{text="市場" css="font-feature-settings: 'salt' 2"}
121
- ::
122
-
123
- The span must hold the whole word, and only that word. \`salt\` acts on the first kanji of the run of kanji in the span.
124
-
125
- \`font-feature-settings\` replaces the whole list from the parent. To keep the ruby off and choose a reading at the same time, write both in one declaration.
126
-
127
- To choose a reading in the text itself, use a variation selector. See [Choose a reading](/docs/readings), which also tells where to find the reading numbers of each word.
128
-
129
- ## Okurigana
130
-
131
- A browser shapes kanji and kana apart, so the font never sees the okurigana after a kanji. It cannot tell 来る from 来ない. To show the right reading there, wrap the kanji in a \`salt\` span as above. The [bookmarklet and the userscript](/#any-page) do this for you on any page.
132
- `;export{e as default};