@sushichan044/kg-core 0.11.1 → 0.11.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 CHANGED
@@ -271,13 +271,17 @@ Its line gap is 1.825mm, stage gap 10mm, top margin 12mm, bottom margin 16.55mm,
271
271
  inner margin 21.825mm, and outer margin 13mm. `NovelCompositionSettings.defaults`
272
272
  contains this format. Typeface and reserved lines remain configurable.
273
273
 
274
- `NovelCompositionSettings.forPaper(paperSize, settings)` selects the fixed A5
275
- format or centres the current grid on another paper size. For non-A5 formats,
274
+ A6 is fixed at 12Q, 41 characters per line, 17 lines, and one stage. Its line
275
+ gap is 7H (1.75mm), giving a 19H (4.75mm) line pitch, with 12.5mm
276
+ top/bottom margins, a 16mm inner margin, and a 10mm outer margin.
277
+
278
+ `NovelCompositionSettings.forPaper(paperSize, settings)` selects the fixed A5 or A6
279
+ format or centres the current grid on another paper size. For other formats,
276
280
  `ManuscriptPageSettings.centered(flow, appearance)` computes millimetre settings
277
281
  with half-cell line gaps and two-cell stage gaps. These helpers calculate values;
278
282
  validate the result before persisting or rendering an oversized grid.
279
283
 
280
- Custom non-A5 page settings can provide explicit millimetre gaps and margins.
284
+ Custom page settings on other paper sizes can provide explicit millimetre gaps and margins.
281
285
  The settings schema checks that text dimensions plus margins equal the paper
282
286
  size within 0.000001mm. Gaps and margins must be nonnegative, and the line gap
283
287
  must accommodate the existing half-size annotation area. A mismatch returns
@@ -406,3 +410,42 @@ does not include polyfills.
406
410
  ## License
407
411
 
408
412
  MIT
413
+
414
+ ## Sentence-ending symbols
415
+
416
+ `♡`, `♪`, and `☆` follow the same line-breaking and separator-space rules as
417
+ Japanese question and exclamation marks. Each symbol remains a separate cell.
418
+ Set `additionalSentenceEndingMarks` on composition settings to add Unicode symbols:
419
+
420
+ ```ts
421
+ const settings = {
422
+ ...NovelCompositionSettings.defaults,
423
+ additionalSentenceEndingMarks: "★",
424
+ };
425
+ ```
426
+
427
+ For proofreading, import `createSpaceAfterQuestionOrExclamationRule` from
428
+ `@sushichan044/kg-core/lint` and pass the same option. The factory returns a
429
+ `ManuscriptResult`. Replace the default rule with ID
430
+ `kg/space-after-question-or-exclamation` with the successful result's value.
431
+ An empty string adds nothing; built-in marks remain enabled. Each Unicode code
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.