@sushichan044/kg-core 0.10.1 → 0.11.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 CHANGED
@@ -150,6 +150,24 @@ tate-chu-yoko unit. Each render unit carries its selected `presentation` as a
150
150
  string. A `CombinedGlyphUnit` renders the two digits together; the composer owns
151
151
  that decision, so renderers do not compare source group ranges.
152
152
 
153
+ ASCII sentences are recognized before individual words are classified. A continuous
154
+ stretch of ASCII letters, digits, punctuation, and spaces containing a letter and
155
+ multiple alphanumeric groups separated by spaces or punctuation renders sideways.
156
+ Japanese characters, fullwidth spaces, and newlines end that context. Thus `I love you`,
157
+ `This is a Web novel`, `I'm happy!`, and `STR 10` keep their initials, abbreviations,
158
+ numbers, and punctuation sideways. Standalone `I`, `BGM`, and `Web` retain their
159
+ upright presentation, and standalone `12` still forms a tate-chu-yoko unit.
160
+ Standalone dotted abbreviations whose parts match the upright abbreviation rule,
161
+ such as `U.S.` and `Ph.D.`, keep their letters upright and their periods in the
162
+ existing mixed presentation. In a sentence such as `I live in the U.S.`, the
163
+ abbreviation and its periods render sideways with the surrounding words.
164
+
165
+ Sentences can wrap between words. Words, including attached punctuation,
166
+ apostrophes, and hyphens, stay together; ASCII spaces retain
167
+ their source positions and supply line-break opportunities. Ruby and inline styling
168
+ do not interrupt sentence recognition. Non-ASCII Western text keeps the existing
169
+ presentation rules.
170
+
153
171
  An upright Western character sets solid against the kana or kanji beside it rather than
154
172
  taking the quarter em 3.2.6 puts around a sideways run, following JLReq 3.2.4: it classes
155
173
  with kanji, the same way 3.2.5 classes a tate-chu-yoko run. `QR` and `URL` set upright by
@@ -168,7 +186,7 @@ const composer = createNovelComposer({ measurer: logicalRunMeasurer });
168
186
  ```
169
187
 
170
188
  `MeasurementRequest` includes `text`, `kind` (`base` or `ruby`), `presentation`,
171
- `fontPreset`, body `fontSizePt`, `writingMode`, and `scale`. A provider returns
189
+ `fontPreset`, body `fontSizeQ`, `writingMode`, and `scale`. A provider returns
172
190
  measurements in body em and applies `scale` once: `1` for base text, `0.5` for ruby.
173
191
  Measured widths exclude punctuation box adjustments, pair spacing, hanging, and
174
192
  ruby expansion.
@@ -240,6 +258,41 @@ failure carries exactly one error from a discriminated union, so callers can
240
258
  as typed fields; `describe` renders one for display. Invalid settings and
241
259
  plugin output fail explicitly; values are never clamped or partially trusted.
242
260
 
261
+ ## Physical page settings
262
+
263
+ `NovelCompositionSettings` combines `flow`, `appearance`, `page`, and `offsets`.
264
+ `appearance.fontSizeQ` specifies the body size in Q (1Q = 0.25mm).
265
+ `ManuscriptPageSettings` specifies `lineGapMm`, `stageGapMm`, `topMm`, `bottomMm`,
266
+ `innerMm` (binding edge), and `outerMm` (fore edge). Line gap is the space between
267
+ body cells; line pitch is `fontSizeQ / 4 + lineGapMm`.
268
+
269
+ A5 is fixed at 12.7Q, 27 characters per line, 23 lines per stage, and two stages.
270
+ Its line gap is 1.825mm, stage gap 10mm, top margin 12mm, bottom margin 16.55mm,
271
+ inner margin 21.825mm, and outer margin 13mm. `NovelCompositionSettings.defaults`
272
+ contains this format. Typeface and reserved lines remain configurable.
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,
276
+ `ManuscriptPageSettings.centered(flow, appearance)` computes millimetre settings
277
+ with half-cell line gaps and two-cell stage gaps. These helpers calculate values;
278
+ validate the result before persisting or rendering an oversized grid.
279
+
280
+ Custom non-A5 page settings can provide explicit millimetre gaps and margins.
281
+ The settings schema checks that text dimensions plus margins equal the paper
282
+ size within 0.000001mm. Gaps and margins must be nonnegative, and the line gap
283
+ must accommodate the existing half-size annotation area. A mismatch returns
284
+ `InvalidSettings` through `composeManuscript`, including unused space:
285
+
286
+ ```text
287
+ height = stages × charactersPerLine × (fontSizeQ / 4) + (stages - 1) × stageGapMm
288
+ width = linesPerStage × (fontSizeQ / 4) + (linesPerStage - 1) × lineGapMm
289
+ ```
290
+
291
+ The public settings and measurement contracts use Q and millimetres only for
292
+ physical sizes. Body-relative `Em` coordinates and flow counts remain logical
293
+ units. Point-based settings and previous persisted preference versions have no
294
+ adapter or migration.
295
+
243
296
  ## Source mapping and render units
244
297
 
245
298
  Source and display ranges are zero-based, end-exclusive UTF-16 offsets.
@@ -282,7 +335,7 @@ Emphasis placements have a half-em inline extent centered on their render unit.
282
335
  Brackets, commas, and full stops receive no marks. Ruby and nonempty emphasis
283
336
  must fit the fixed half-em right-side area without colliding. Core may choose
284
337
  another line break; an impossible combination returns `ComposerRejected` with
285
- a reason. Body pitch, source ranges, and persisted settings remain unchanged.
338
+ a reason. Annotation placement preserves body pitch and source ranges.
286
339
  Actual font shaping, selectable sides, sidelines, and mixed sizes remain deferred.
287
340
 
288
341
  Diagnostics include one-based source line and column positions, so renderers do
@@ -297,8 +350,9 @@ plugin entry replaces `InlineMeasureRequest`, `InlineMeasurement`,
297
350
  `InlineMeasurer`, and `logicalInlineMeasurer` with the run measurement contracts
298
351
  above. `createNovelComposer({ measurer })` keeps its option name but requires the
299
352
  new request and discriminated result. Ruby `readingGraphemes` becomes
300
- `readingItems`; decoration positions move into core output. Persisted settings
301
- and parser/proofreading entrypoints are unchanged.
353
+ `readingItems`; decoration positions move into core output. Parser/proofreading
354
+ entrypoints remain unchanged. Previous persisted settings are ignored without
355
+ migration.
302
356
 
303
357
  ## Proofreading rules
304
358
 
@@ -0,0 +1,9 @@
1
+ //#region src/internal/describe-cause.ts
2
+ /**
3
+ * Renders an unknown throwable for display, without assuming it is an Error.
4
+ */
5
+ function describeCause(cause) {
6
+ return cause instanceof Error ? cause.message : String(cause);
7
+ }
8
+ //#endregion
9
+ export { describeCause as t };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as ManuscriptResult, c as DiagnosticSeverity, d as ManuscriptRangeInput, i as ParsedManuscript, l as DiagnosticOrigin, n as ValidationIssue, o as ManuscriptDiagnostic, r as NamespacedId, s as ManuscriptDiagnosticInput, t as ComposedManuscript, u as ManuscriptRange } from "./composed-manuscript-C0f3mxKs.mjs";
2
- import { d as ManuscriptComposer, f as ManuscriptParser, i as novelComposer, l as NovelLayout, n as NovelComposedManuscript, t as PresentationKind, u as NovelCompositionSettings } from "./presentation-kind-BwIZFSZS.mjs";
2
+ import { d as PaperSizeId, f as ManuscriptComposer, i as novelComposer, l as NovelLayout, n as NovelComposedManuscript, p as ManuscriptParser, t as PresentationKind, u as NovelCompositionSettings } from "./presentation-kind-BCQndPoK.mjs";
3
3
  import * as v from "valibot";
4
4
  //#region src/parser/parse-error.d.ts
5
5
  /**
@@ -1813,11 +1813,11 @@ export declare const ManuscriptOffsets: {
1813
1813
  //#region src/appearance/appearance-settings.d.ts
1814
1814
  declare const ManuscriptAppearanceSettingsSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
1815
1815
  readonly paperSize: v.PicklistSchema<["a4", "a5", "a6", "jis-b5", "jis-b6", "shinsho"], undefined>;
1816
- readonly fontSizePt: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 6, undefined>, v.MaxValueAction<number, 24, undefined>, v.MultipleOfAction<number, 0.5, undefined>]>;
1816
+ readonly fontSizeQ: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, number, undefined>]>;
1817
1817
  readonly fontPreset: v.PicklistSchema<["mincho", "gothic"], undefined>;
1818
1818
  }, undefined>, v.ReadonlyAction<{
1819
1819
  paperSize: "a4" | "a5" | "a6" | "jis-b5" | "jis-b6" | "shinsho";
1820
- fontSizePt: number;
1820
+ fontSizeQ: number;
1821
1821
  fontPreset: "gothic" | "mincho";
1822
1822
  }>]>;
1823
1823
  /**
@@ -1827,94 +1827,128 @@ export type ManuscriptAppearanceSettings = v.InferOutput<typeof ManuscriptAppear
1827
1827
  export declare const ManuscriptAppearanceSettings: {
1828
1828
  readonly schema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
1829
1829
  readonly paperSize: v.PicklistSchema<["a4", "a5", "a6", "jis-b5", "jis-b6", "shinsho"], undefined>;
1830
- readonly fontSizePt: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 6, undefined>, v.MaxValueAction<number, 24, undefined>, v.MultipleOfAction<number, 0.5, undefined>]>;
1830
+ readonly fontSizeQ: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, number, undefined>]>;
1831
1831
  readonly fontPreset: v.PicklistSchema<["mincho", "gothic"], undefined>;
1832
1832
  }, undefined>, v.ReadonlyAction<{
1833
1833
  paperSize: "a4" | "a5" | "a6" | "jis-b5" | "jis-b6" | "shinsho";
1834
- fontSizePt: number;
1834
+ fontSizeQ: number;
1835
1835
  fontPreset: "gothic" | "mincho";
1836
1836
  }>]>;
1837
1837
  readonly defaults: {
1838
1838
  readonly paperSize: "a5";
1839
- readonly fontSizePt: 9;
1839
+ readonly fontSizeQ: 12.7;
1840
1840
  readonly fontPreset: "mincho";
1841
1841
  };
1842
1842
  };
1843
1843
  //#endregion
1844
- //#region src/appearance/paper-size-id.d.ts
1845
- declare const PaperSizeIdSchema: v.PicklistSchema<["a4", "a5", "a6", "jis-b5", "jis-b6", "shinsho"], undefined>;
1846
- /**
1847
- * ISO A sizes, the JIS B series (which is not the ISO B series), and the two trim sizes Japanese
1848
- * publishing names rather than measures: A6 is the 文庫本 and `shinsho` the 新書判.
1849
- */
1850
- export type PaperSizeId = v.InferOutput<typeof PaperSizeIdSchema>;
1851
- export declare const PaperSizeId: {
1852
- readonly schema: v.PicklistSchema<["a4", "a5", "a6", "jis-b5", "jis-b6", "shinsho"], undefined>;
1853
- readonly is: (value: unknown) => value is PaperSizeId;
1844
+ //#region src/composer/page-settings.d.ts
1845
+ declare const ManuscriptPageSettingsSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
1846
+ readonly lineGapMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1847
+ readonly stageGapMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1848
+ readonly topMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1849
+ readonly bottomMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1850
+ readonly innerMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1851
+ readonly outerMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1852
+ }, undefined>, v.ReadonlyAction<{
1853
+ lineGapMm: number;
1854
+ stageGapMm: number;
1855
+ topMm: number;
1856
+ bottomMm: number;
1857
+ innerMm: number;
1858
+ outerMm: number;
1859
+ }>]>;
1860
+ export type ManuscriptPageSettings = v.InferOutput<typeof ManuscriptPageSettingsSchema>;
1861
+ export declare const ManuscriptPageSettings: {
1862
+ readonly schema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
1863
+ readonly lineGapMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1864
+ readonly stageGapMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1865
+ readonly topMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1866
+ readonly bottomMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1867
+ readonly innerMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1868
+ readonly outerMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1869
+ }, undefined>, v.ReadonlyAction<{
1870
+ lineGapMm: number;
1871
+ stageGapMm: number;
1872
+ topMm: number;
1873
+ bottomMm: number;
1874
+ innerMm: number;
1875
+ outerMm: number;
1876
+ }>]>;
1877
+ readonly defaults: {
1878
+ readonly lineGapMm: 1.825;
1879
+ readonly stageGapMm: 10;
1880
+ readonly topMm: 12;
1881
+ readonly bottomMm: 16.55;
1882
+ readonly innerMm: 21.825;
1883
+ readonly outerMm: 13;
1884
+ };
1885
+ /**
1886
+ * Centre a non-A5 text grid using half-cell line gaps and two-cell stage gaps.
1887
+ */
1888
+ readonly centered: (flow: NovelFlowSettings, appearance: ManuscriptAppearanceSettings) => ManuscriptPageSettings;
1854
1889
  };
1855
1890
  //#endregion
1856
1891
  //#region src/composer/manuscript-geometry.d.ts
1857
1892
  declare const ManuscriptGeometrySchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
1893
+ readonly lineGapMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1894
+ readonly stageGapMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1895
+ readonly topMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1896
+ readonly bottomMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1897
+ readonly innerMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1898
+ readonly outerMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1858
1899
  readonly paperWidthMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1859
1900
  readonly paperHeightMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1860
1901
  readonly cellSizeMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1861
- readonly lineGapMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1862
- readonly fontSizePt: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 6, undefined>, v.MaxValueAction<number, 24, undefined>, v.MultipleOfAction<number, 0.5, undefined>]>;
1902
+ readonly fontSizeQ: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, number, undefined>]>;
1863
1903
  readonly contentWidthMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1864
1904
  readonly contentHeightMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1865
- readonly marginInlineMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>;
1866
- readonly marginBlockMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>;
1867
- readonly fitsPaper: v.BooleanSchema<undefined>;
1868
1905
  }, undefined>, v.ReadonlyAction<{
1906
+ lineGapMm: number;
1907
+ stageGapMm: number;
1908
+ topMm: number;
1909
+ bottomMm: number;
1910
+ innerMm: number;
1911
+ outerMm: number;
1869
1912
  paperWidthMm: number;
1870
1913
  paperHeightMm: number;
1871
1914
  cellSizeMm: number;
1872
- lineGapMm: number;
1873
- fontSizePt: number;
1915
+ fontSizeQ: number;
1874
1916
  contentWidthMm: number;
1875
1917
  contentHeightMm: number;
1876
- marginInlineMm: number;
1877
- marginBlockMm: number;
1878
- fitsPaper: boolean;
1879
1918
  }>]>;
1880
1919
  /**
1881
- * Physical millimetres for one page, derived from the text flow and appearance settings. The
1882
- * content box is the 基本版面 — the text area a Japanese page format is designed around — and it is
1883
- * centred on the paper, so the margins fall out of the paper size rather than being chosen.
1884
- *
1885
- * `fitsPaper` is false when the requested grid is larger than the paper. The geometry is still
1886
- * returned in full so a caller can show what overflowed instead of being handed nothing.
1920
+ * Physical page dimensions. The renderer mirrors inner and outer margins on alternate pages.
1887
1921
  */
1888
1922
  export type ManuscriptGeometry = v.InferOutput<typeof ManuscriptGeometrySchema>;
1889
1923
  export declare const ManuscriptGeometry: {
1890
1924
  readonly schema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
1925
+ readonly lineGapMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1926
+ readonly stageGapMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1927
+ readonly topMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1928
+ readonly bottomMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1929
+ readonly innerMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1930
+ readonly outerMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1891
1931
  readonly paperWidthMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1892
1932
  readonly paperHeightMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1893
1933
  readonly cellSizeMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1894
- readonly lineGapMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1895
- readonly fontSizePt: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 6, undefined>, v.MaxValueAction<number, 24, undefined>, v.MultipleOfAction<number, 0.5, undefined>]>;
1934
+ readonly fontSizeQ: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, number, undefined>]>;
1896
1935
  readonly contentWidthMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1897
1936
  readonly contentHeightMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1898
- readonly marginInlineMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>;
1899
- readonly marginBlockMm: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>]>;
1900
- readonly fitsPaper: v.BooleanSchema<undefined>;
1901
1937
  }, undefined>, v.ReadonlyAction<{
1938
+ lineGapMm: number;
1939
+ stageGapMm: number;
1940
+ topMm: number;
1941
+ bottomMm: number;
1942
+ innerMm: number;
1943
+ outerMm: number;
1902
1944
  paperWidthMm: number;
1903
1945
  paperHeightMm: number;
1904
1946
  cellSizeMm: number;
1905
- lineGapMm: number;
1906
- fontSizePt: number;
1947
+ fontSizeQ: number;
1907
1948
  contentWidthMm: number;
1908
1949
  contentHeightMm: number;
1909
- marginInlineMm: number;
1910
- marginBlockMm: number;
1911
- fitsPaper: boolean;
1912
1950
  }>]>;
1913
- readonly of: (flow: NovelFlowSettings, appearance: ManuscriptAppearanceSettings) => ManuscriptGeometry;
1914
- /**
1915
- * The largest step-aligned point size whose text area still fits the paper.
1916
- */
1917
- readonly maxFontSizePt: (flow: NovelFlowSettings, paperSizeId: PaperSizeId) => number;
1951
+ readonly of: (flow: NovelFlowSettings, appearance: ManuscriptAppearanceSettings, page: ManuscriptPageSettings) => ManuscriptGeometry;
1918
1952
  };
1919
1953
  //#endregion
1920
1954
  //#region src/appearance/font-preset-id.d.ts
@@ -1944,20 +1978,15 @@ export declare const FontPreset: {
1944
1978
  }>[];
1945
1979
  };
1946
1980
  //#endregion
1947
- //#region src/appearance/font-size-pt.d.ts
1948
- declare const FontSizePtSchema: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 6, undefined>, v.MaxValueAction<number, 24, undefined>, v.MultipleOfAction<number, 0.5, undefined>]>;
1981
+ //#region src/appearance/font-size-q.d.ts
1982
+ declare const FontSizeQSchema: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, number, undefined>]>;
1949
1983
  /**
1950
- * A manuscript cell pitch in points, constrained to the steps the settings UI can express.
1984
+ * A body font size in quarter millimetres: 1Q = 0.25mm.
1951
1985
  */
1952
- export type FontSizePt = v.InferOutput<typeof FontSizePtSchema>;
1953
- export declare const FontSizePt: {
1954
- readonly schema: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 6, undefined>, v.MaxValueAction<number, 24, undefined>, v.MultipleOfAction<number, 0.5, undefined>]>;
1955
- readonly range: {
1956
- readonly min: 6;
1957
- readonly max: 24;
1958
- readonly step: 0.5;
1959
- };
1960
- readonly is: (value: unknown) => value is FontSizePt;
1986
+ export type FontSizeQ = v.InferOutput<typeof FontSizeQSchema>;
1987
+ export declare const FontSizeQ: {
1988
+ readonly schema: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, number, undefined>]>;
1989
+ readonly is: (value: unknown) => value is FontSizeQ;
1961
1990
  };
1962
1991
  //#endregion
1963
1992
  //#region src/appearance/paper-size.d.ts
@@ -34169,4 +34198,4 @@ declare const TextRange: {
34169
34198
  }>, "range end must not precede its start">]>;
34170
34199
  };
34171
34200
  //#endregion
34172
- export { type AnnotationPlacement, type BoldAnnotation, type CombinedGlyphUnit, type ComposeManuscriptOptions, type ComposedAnnotationFragment, type ComposedGlue, type ComposedKern, type ComposedManuscript, type CompositionStatistics, type DiagnosticOrigin, type DiagnosticSeverity, type DisplayRange, type EmphasisAnnotation, type GraphemeRange, type InlineSpan, type ItalicAnnotation, type LineBreakResult, type LineOffset, type ManuscriptAnnotation, ManuscriptDiagnostic, type ManuscriptDiagnosticInput, ManuscriptRange, type ManuscriptRangeInput, ManuscriptResult, type NovelComposedManuscript, NovelCompositionSettings, type NovelLayout, type NovelLine, type NovelPage, type NovelStage, type ParseManuscriptOptions, type ParsedGrapheme, type ParsedManuscript, type PositionedInlineItem, type PresentationKind, type RubyAnnotation, type RubyKind, type RubyReading, type SingleGlyphUnit, type SourcePlacement, type SourcePosition, type SourceRange, type SuppressedInlineItem, type TextRange, novelComposer };
34201
+ export { type AnnotationPlacement, type BoldAnnotation, type CombinedGlyphUnit, type ComposeManuscriptOptions, type ComposedAnnotationFragment, type ComposedGlue, type ComposedKern, type ComposedManuscript, type CompositionStatistics, type DiagnosticOrigin, type DiagnosticSeverity, type DisplayRange, type EmphasisAnnotation, type GraphemeRange, type InlineSpan, type ItalicAnnotation, type LineBreakResult, type LineOffset, type ManuscriptAnnotation, ManuscriptDiagnostic, type ManuscriptDiagnosticInput, ManuscriptRange, type ManuscriptRangeInput, ManuscriptResult, type NovelComposedManuscript, NovelCompositionSettings, type NovelLayout, type NovelLine, type NovelPage, type NovelStage, PaperSizeId, type ParseManuscriptOptions, type ParsedGrapheme, type ParsedManuscript, type PositionedInlineItem, type PresentationKind, type RubyAnnotation, type RubyKind, type RubyReading, type SingleGlyphUnit, type SourcePlacement, type SourcePosition, type SourceRange, type SuppressedInlineItem, type TextRange, novelComposer };
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { c as graphemeSegmenter, d as ManuscriptDiagnostic, l as ValidationIssue, m as ManuscriptRange, p as NamespacedId, u as ManuscriptResult, v as readonlyObject } from "./question-or-exclamation-spacing-Cp3eOGlA.mjs";
2
- import { a as PaperSize, d as ManuscriptOffsets, f as ManuscriptAppearanceSettings, g as ParsedManuscript, h as FontPresetId, i as ManuscriptGeometry, l as NovelCompositionSettings, m as FontSizePt, n as novelComposer, p as PaperSizeId, u as NovelFlowSettings } from "./novel-composer-D_orH6ET.mjs";
3
- import { n as assertNever, t as describeCause } from "./describe-cause-BV8mZ3Um.mjs";
1
+ import { c as assertNever, d as ManuscriptResult, f as ManuscriptDiagnostic, h as ManuscriptRange, l as graphemeSegmenter, m as NamespacedId, u as ValidationIssue, y as readonlyObject } from "./question-or-exclamation-spacing-C5cFLeKr.mjs";
2
+ import { _ as ParsedManuscript, c as NovelFlowSettings, d as ManuscriptPageSettings, f as PaperSize, g as FontPresetId, h as FontSizeQ, l as ManuscriptOffsets, m as PaperSizeId, n as novelComposer, p as ManuscriptAppearanceSettings, s as NovelCompositionSettings, u as ManuscriptGeometry } from "./novel-composer-z0cv8OHb.mjs";
3
+ import { t as describeCause } from "./describe-cause-SABI_1ex.mjs";
4
4
  import * as v from "valibot";
5
5
  const Rejection = { schema: readonlyObject({ reason: v.string() }) };
6
6
  //#endregion
@@ -615,4 +615,4 @@ const FontPreset = {
615
615
  all: Object.values(FONT_PRESETS)
616
616
  };
617
617
  //#endregion
618
- export { ComposeError, FontPreset, FontPresetId, FontSizePt, ManuscriptAppearanceSettings, ManuscriptDiagnostic, ManuscriptGeometry, ManuscriptOffsets, ManuscriptRange, ManuscriptResult, NovelCompositionSettings, NovelFlowSettings, PaperSize, PaperSizeId, ParseError, composeManuscript, kakuyomuParser, novelComposer, parseManuscript, pixivParser, plainTextParser };
618
+ export { ComposeError, FontPreset, FontPresetId, FontSizeQ, ManuscriptAppearanceSettings, ManuscriptDiagnostic, ManuscriptGeometry, ManuscriptOffsets, ManuscriptPageSettings, ManuscriptRange, ManuscriptResult, NovelCompositionSettings, NovelFlowSettings, PaperSize, PaperSizeId, ParseError, composeManuscript, kakuyomuParser, novelComposer, parseManuscript, pixivParser, plainTextParser };
package/dist/lint.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as readonlyArray, a as CLOSING_BRACKETS, c as graphemeSegmenter, d as ManuscriptDiagnostic, f as DiagnosticSeverity, l as ValidationIssue, m as ManuscriptRange, n as leadingSpaces, o as OPENING_BRACKETS, p as NamespacedId, s as characterClass, t as questionOrExclamationSpacings, u as ManuscriptResult, v as readonlyObject } from "./question-or-exclamation-spacing-Cp3eOGlA.mjs";
2
- import { n as assertNever, t as describeCause } from "./describe-cause-BV8mZ3Um.mjs";
1
+ import { a as CLOSING_BRACKETS, c as assertNever, d as ManuscriptResult, f as ManuscriptDiagnostic, h as ManuscriptRange, l as graphemeSegmenter, m as NamespacedId, n as leadingSpaces, o as OPENING_BRACKETS, p as DiagnosticSeverity, s as characterClass, t as questionOrExclamationSpacings, u as ValidationIssue, v as readonlyArray, y as readonlyObject } from "./question-or-exclamation-spacing-C5cFLeKr.mjs";
2
+ import { t as describeCause } from "./describe-cause-SABI_1ex.mjs";
3
3
  import * as v from "valibot";
4
4
  //#region src/proofreading/invalid-rule-options.ts
5
5
  const InvalidRuleOptions = { describe: (error) => `ルール ${error.ruleId} のオプション "${error.option}" が不正です: ${error.issues.map(({ message }) => message).join(", ")}` };