@sushichan044/kg-core 0.11.2 → 0.12.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.
- package/README.md +19 -0
- package/dist/index.d.mts +344 -317
- package/dist/index.mjs +156 -5
- package/dist/{novel-composer-tcseYHc8.mjs → novel-composer-DNsKrJIP.mjs} +85 -41
- package/dist/plugin.d.mts +1 -1
- package/dist/plugin.mjs +5 -1
- package/dist/{presentation-kind-DnJkvxHU.d.mts → presentation-kind-B9FtjZvc.d.mts} +1026 -982
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -430,3 +430,22 @@ For proofreading, import `createSpaceAfterQuestionOrExclamationRule` from
|
|
|
430
430
|
`kg/space-after-question-or-exclamation` with the successful result's value.
|
|
431
431
|
An empty string adds nothing; built-in marks remain enabled. Each Unicode code
|
|
432
432
|
point is a separate symbol. Non-symbol characters are rejected.
|
|
433
|
+
|
|
434
|
+
## Font preparation
|
|
435
|
+
|
|
436
|
+
Parsing preserves the source independently of the selected font. Before composition,
|
|
437
|
+
call `prepareManuscriptForFont(parsed, fontPreset)`. Its `parsed` value contains the
|
|
438
|
+
prepared display text and annotations; `mapRange` maps existing parser diagnostics
|
|
439
|
+
into its grapheme coordinates while preserving source and display UTF-16 offsets.
|
|
440
|
+
Always prepare from the original parse when changing fonts.
|
|
441
|
+
|
|
442
|
+
`prepareTextForFont(text, fontPreset)` applies the same rules to standalone titles
|
|
443
|
+
and author names. `mincho` selects Rin Mincho and combines spacing kana voicing
|
|
444
|
+
marks; `genei-koburi` and `gothic` preserve them. Existing combining marks stay intact.
|
|
445
|
+
Preparation preserves notation, style and per-character ruby boundaries. The current
|
|
446
|
+
built-in transforms preserve UTF-16 length and do not normalize the whole source.
|
|
447
|
+
|
|
448
|
+
Font profiles declare ordered text transforms, measurement policy and OpenType
|
|
449
|
+
features. Add a profile and its browser assets to support another built-in font;
|
|
450
|
+
parsers remain independent of font selection. Browser shaping is provided by
|
|
451
|
+
`@sushichan044/kg-viewer/typography`; core remains synchronous and DOM independent.
|