postext 1.29.1 → 1.30.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/dist/__tests__/arabicLocale.test.js +5 -5
- package/dist/__tests__/arabicLocale.test.js.map +1 -1
- package/dist/__tests__/bundle/balloonPlacementPin.test.js +5 -4
- package/dist/__tests__/bundle/balloonPlacementPin.test.js.map +1 -1
- package/dist/__tests__/bundle/cjkRulesPin.test.js +8 -6
- package/dist/__tests__/bundle/cjkRulesPin.test.js.map +1 -1
- package/dist/__tests__/bundle/designOverflowPin.test.js +1 -1
- package/dist/__tests__/bundle/flowColumnsPin.test.js +4 -3
- package/dist/__tests__/bundle/flowColumnsPin.test.js.map +1 -1
- package/dist/__tests__/bundle/gridBalancingPin.test.js +5 -4
- package/dist/__tests__/bundle/gridBalancingPin.test.js.map +1 -1
- package/dist/__tests__/bundle/gridBreakRulesPin.test.js +14 -10
- package/dist/__tests__/bundle/gridBreakRulesPin.test.js.map +1 -1
- package/dist/__tests__/bundle/indexGroupSplitPin.test.js +4 -3
- package/dist/__tests__/bundle/indexGroupSplitPin.test.js.map +1 -1
- package/dist/__tests__/bundle/looseOrderPin.test.js +5 -4
- package/dist/__tests__/bundle/looseOrderPin.test.js.map +1 -1
- package/dist/__tests__/bundle/refLabelBreaksPin.test.js +5 -4
- package/dist/__tests__/bundle/refLabelBreaksPin.test.js.map +1 -1
- package/dist/__tests__/bundle/scriptContextPin.test.js +6 -5
- package/dist/__tests__/bundle/scriptContextPin.test.js.map +1 -1
- package/dist/__tests__/bundle/shapingLanguagePin.test.js +142 -46
- package/dist/__tests__/bundle/shapingLanguagePin.test.js.map +1 -1
- package/dist/__tests__/bundle/taskBoxPin.test.js +1 -1
- package/dist/__tests__/bundle/trailingStepPin.test.js +4 -3
- package/dist/__tests__/bundle/trailingStepPin.test.js.map +1 -1
- package/dist/__tests__/bundle/wideFloatStretchPin.test.js +4 -3
- package/dist/__tests__/bundle/wideFloatStretchPin.test.js.map +1 -1
- package/dist/__tests__/bundle.test.js +1 -1
- package/dist/__tests__/cellText.test.d.ts +2 -0
- package/dist/__tests__/cellText.test.d.ts.map +1 -0
- package/dist/__tests__/cellText.test.js +281 -0
- package/dist/__tests__/cellText.test.js.map +1 -0
- package/dist/__tests__/chineseLocale.test.js +24 -7
- package/dist/__tests__/chineseLocale.test.js.map +1 -1
- package/dist/__tests__/cjk/japaneseHtml.test.js +3 -3
- package/dist/__tests__/cjk/japaneseHtml.test.js.map +1 -1
- package/dist/__tests__/cjk/japaneseRuby.test.js +1 -1
- package/dist/__tests__/cjk/japaneseRuby.test.js.map +1 -1
- package/dist/__tests__/cjk/japaneseSegmentLanguage.test.js +3 -3
- package/dist/__tests__/cjk/japaneseSegmentLanguage.test.js.map +1 -1
- package/dist/__tests__/codeBlocks.test.js +1 -1
- package/dist/__tests__/contextState.test.d.ts +2 -0
- package/dist/__tests__/contextState.test.d.ts.map +1 -0
- package/dist/__tests__/contextState.test.js +478 -0
- package/dist/__tests__/contextState.test.js.map +1 -0
- package/dist/__tests__/contextText.test.d.ts +2 -0
- package/dist/__tests__/contextText.test.d.ts.map +1 -0
- package/dist/__tests__/contextText.test.js +371 -0
- package/dist/__tests__/contextText.test.js.map +1 -0
- package/dist/__tests__/design/designTextRender.test.js +8 -1
- package/dist/__tests__/design/designTextRender.test.js.map +1 -1
- package/dist/__tests__/exports.test.js +6 -0
- package/dist/__tests__/exports.test.js.map +1 -1
- package/dist/__tests__/fontUsage.test.js +40 -0
- package/dist/__tests__/fontUsage.test.js.map +1 -1
- package/dist/__tests__/hardBreaks.test.js +1 -1
- package/dist/__tests__/headingInlineMarks.test.js +1 -1
- package/dist/__tests__/html-backend.test.js +6 -2
- package/dist/__tests__/html-backend.test.js.map +1 -1
- package/dist/__tests__/japaneseNotes.test.js +4 -2
- package/dist/__tests__/japaneseNotes.test.js.map +1 -1
- package/dist/__tests__/lineEndPieces.test.d.ts +2 -0
- package/dist/__tests__/lineEndPieces.test.d.ts.map +1 -0
- package/dist/__tests__/lineEndPieces.test.js +374 -0
- package/dist/__tests__/lineEndPieces.test.js.map +1 -0
- package/dist/__tests__/mathSizeMigration.test.js +2 -2
- package/dist/__tests__/pipeline/calloutInlineResourceGap.test.js +1 -1
- package/dist/__tests__/pipeline/calloutSplitMinLinesChild.test.js +1 -1
- package/dist/__tests__/pipeline/colonListRoom.test.js +1 -1
- package/dist/__tests__/pipeline/compoundBreaks.test.js +1 -1
- package/dist/__tests__/pipeline/dashBreaks.test.js +1 -1
- package/dist/__tests__/pipeline/headingSplitOrphans.test.js +1 -1
- package/dist/__tests__/pipeline/inlineFigureSpace.test.js +1 -1
- package/dist/__tests__/pipeline/paragraphContainerTail.test.js +1 -1
- package/dist/__tests__/pipeline/raggedOptimal.test.js +1 -1
- package/dist/__tests__/plainGeminateHead.test.d.ts +2 -0
- package/dist/__tests__/plainGeminateHead.test.d.ts.map +1 -0
- package/dist/__tests__/plainGeminateHead.test.js +92 -0
- package/dist/__tests__/plainGeminateHead.test.js.map +1 -0
- package/dist/__tests__/presets/showcaseShapingLanguage.test.d.ts +2 -0
- package/dist/__tests__/presets/showcaseShapingLanguage.test.d.ts.map +1 -0
- package/dist/__tests__/presets/showcaseShapingLanguage.test.js +52 -0
- package/dist/__tests__/presets/showcaseShapingLanguage.test.js.map +1 -0
- package/dist/__tests__/reshapedTracking.test.d.ts +2 -0
- package/dist/__tests__/reshapedTracking.test.d.ts.map +1 -0
- package/dist/__tests__/reshapedTracking.test.js +358 -0
- package/dist/__tests__/reshapedTracking.test.js.map +1 -0
- package/dist/__tests__/rtl/designRunsPainted.test.d.ts +2 -0
- package/dist/__tests__/rtl/designRunsPainted.test.d.ts.map +1 -0
- package/dist/__tests__/rtl/designRunsPainted.test.js +184 -0
- package/dist/__tests__/rtl/designRunsPainted.test.js.map +1 -0
- package/dist/__tests__/rtl/designTextPaint.test.js +5 -1
- package/dist/__tests__/rtl/designTextPaint.test.js.map +1 -1
- package/dist/__tests__/rtl/htmlRtl.test.js +3 -3
- package/dist/__tests__/rtl/htmlRtl.test.js.map +1 -1
- package/dist/__tests__/rtl/listMarkerDirection.test.js +28 -28
- package/dist/__tests__/rtl/listMarkerDirection.test.js.map +1 -1
- package/dist/__tests__/rtl/tocNumberPainted.test.d.ts +2 -0
- package/dist/__tests__/rtl/tocNumberPainted.test.d.ts.map +1 -0
- package/dist/__tests__/rtl/tocNumberPainted.test.js +113 -0
- package/dist/__tests__/rtl/tocNumberPainted.test.js.map +1 -0
- package/dist/__tests__/scriptContext.test.js +141 -1
- package/dist/__tests__/scriptContext.test.js.map +1 -1
- package/dist/__tests__/shapingLanguage.test.js +60 -43
- package/dist/__tests__/shapingLanguage.test.js.map +1 -1
- package/dist/__tests__/trackedLetters.test.d.ts +2 -0
- package/dist/__tests__/trackedLetters.test.d.ts.map +1 -0
- package/dist/__tests__/trackedLetters.test.js +380 -0
- package/dist/__tests__/trackedLetters.test.js.map +1 -0
- package/dist/__tests__/trackedLigatures.test.js +23 -10
- package/dist/__tests__/trackedLigatures.test.js.map +1 -1
- package/dist/__tests__/verseLines.test.js +1 -1
- package/dist/__tests__/wordCacheOrder.test.d.ts +2 -0
- package/dist/__tests__/wordCacheOrder.test.d.ts.map +1 -0
- package/dist/__tests__/wordCacheOrder.test.js +352 -0
- package/dist/__tests__/wordCacheOrder.test.js.map +1 -0
- package/dist/__tests__/wordPieces.test.d.ts +2 -0
- package/dist/__tests__/wordPieces.test.d.ts.map +1 -0
- package/dist/__tests__/wordPieces.test.js +762 -0
- package/dist/__tests__/wordPieces.test.js.map +1 -0
- package/dist/bidi.d.ts +12 -0
- package/dist/bidi.d.ts.map +1 -1
- package/dist/bidi.js +23 -0
- package/dist/bidi.js.map +1 -1
- package/dist/bundle/configVersion.d.ts +49 -23
- package/dist/bundle/configVersion.d.ts.map +1 -1
- package/dist/bundle/configVersion.js +54 -25
- package/dist/bundle/configVersion.js.map +1 -1
- package/dist/canvas-backend/annotations.d.ts.map +1 -1
- package/dist/canvas-backend/annotations.js +8 -7
- package/dist/canvas-backend/annotations.js.map +1 -1
- package/dist/canvas-backend/blockRender.d.ts.map +1 -1
- package/dist/canvas-backend/blockRender.js +81 -47
- package/dist/canvas-backend/blockRender.js.map +1 -1
- package/dist/canvas-backend/cellText.d.ts +12 -0
- package/dist/canvas-backend/cellText.d.ts.map +1 -0
- package/dist/canvas-backend/cellText.js +114 -0
- package/dist/canvas-backend/cellText.js.map +1 -0
- package/dist/canvas-backend/chip.d.ts.map +1 -1
- package/dist/canvas-backend/chip.js +12 -9
- package/dist/canvas-backend/chip.js.map +1 -1
- package/dist/canvas-backend/comic.d.ts.map +1 -1
- package/dist/canvas-backend/comic.js +9 -8
- package/dist/canvas-backend/comic.js.map +1 -1
- package/dist/canvas-backend/contextState.d.ts +69 -0
- package/dist/canvas-backend/contextState.d.ts.map +1 -0
- package/dist/canvas-backend/contextState.js +96 -0
- package/dist/canvas-backend/contextState.js.map +1 -0
- package/dist/canvas-backend/contextText.d.ts +76 -0
- package/dist/canvas-backend/contextText.d.ts.map +1 -0
- package/dist/canvas-backend/contextText.js +102 -0
- package/dist/canvas-backend/contextText.js.map +1 -0
- package/dist/canvas-backend/decorations.d.ts.map +1 -1
- package/dist/canvas-backend/decorations.js +11 -10
- package/dist/canvas-backend/decorations.js.map +1 -1
- package/dist/canvas-backend/headerFooter.d.ts.map +1 -1
- package/dist/canvas-backend/headerFooter.js +23 -15
- package/dist/canvas-backend/headerFooter.js.map +1 -1
- package/dist/canvas-backend/index.d.ts.map +1 -1
- package/dist/canvas-backend/index.js +41 -17
- package/dist/canvas-backend/index.js.map +1 -1
- package/dist/canvas-backend/mirrorFrame.d.ts.map +1 -1
- package/dist/canvas-backend/mirrorFrame.js +5 -4
- package/dist/canvas-backend/mirrorFrame.js.map +1 -1
- package/dist/canvas-backend/renderResourceBlock.d.ts.map +1 -1
- package/dist/canvas-backend/renderResourceBlock.js +36 -29
- package/dist/canvas-backend/renderResourceBlock.js.map +1 -1
- package/dist/canvas-backend/runDirection.d.ts.map +1 -1
- package/dist/canvas-backend/runDirection.js +9 -5
- package/dist/canvas-backend/runDirection.js.map +1 -1
- package/dist/canvas-backend/scriptText.d.ts.map +1 -1
- package/dist/canvas-backend/scriptText.js +11 -9
- package/dist/canvas-backend/scriptText.js.map +1 -1
- package/dist/canvas-backend/segmentText.d.ts.map +1 -1
- package/dist/canvas-backend/segmentText.js +18 -5
- package/dist/canvas-backend/segmentText.js.map +1 -1
- package/dist/canvas-backend/swatch.d.ts.map +1 -1
- package/dist/canvas-backend/swatch.js +3 -2
- package/dist/canvas-backend/swatch.js.map +1 -1
- package/dist/canvas-backend/trackedText.d.ts +75 -1
- package/dist/canvas-backend/trackedText.d.ts.map +1 -1
- package/dist/canvas-backend/trackedText.js +192 -28
- package/dist/canvas-backend/trackedText.js.map +1 -1
- package/dist/canvas-backend/verticalText.d.ts +12 -2
- package/dist/canvas-backend/verticalText.d.ts.map +1 -1
- package/dist/canvas-backend/verticalText.js +64 -38
- package/dist/canvas-backend/verticalText.js.map +1 -1
- package/dist/canvas-backend/wordPieces.d.ts +31 -0
- package/dist/canvas-backend/wordPieces.d.ts.map +1 -0
- package/dist/canvas-backend/wordPieces.js +132 -0
- package/dist/canvas-backend/wordPieces.js.map +1 -0
- package/dist/canvas-backend/wordRuns.d.ts +13 -1
- package/dist/canvas-backend/wordRuns.d.ts.map +1 -1
- package/dist/canvas-backend/wordRuns.js +38 -23
- package/dist/canvas-backend/wordRuns.js.map +1 -1
- package/dist/comics/lettering/__tests__/fitAsPainted.test.d.ts +2 -0
- package/dist/comics/lettering/__tests__/fitAsPainted.test.d.ts.map +1 -0
- package/dist/comics/lettering/__tests__/fitAsPainted.test.js +97 -0
- package/dist/comics/lettering/__tests__/fitAsPainted.test.js.map +1 -0
- package/dist/comics/lettering/shape-text.d.ts.map +1 -1
- package/dist/comics/lettering/shape-text.js +39 -11
- package/dist/comics/lettering/shape-text.js.map +1 -1
- package/dist/defaults/bodyText.d.ts.map +1 -1
- package/dist/defaults/bodyText.js +6 -5
- package/dist/defaults/bodyText.js.map +1 -1
- package/dist/design/bidiText.d.ts +45 -6
- package/dist/design/bidiText.d.ts.map +1 -1
- package/dist/design/bidiText.js +78 -10
- package/dist/design/bidiText.js.map +1 -1
- package/dist/design/cjkText.d.ts +3 -0
- package/dist/design/cjkText.d.ts.map +1 -1
- package/dist/design/cjkText.js +1 -1
- package/dist/design/cjkText.js.map +1 -1
- package/dist/design/layout.d.ts.map +1 -1
- package/dist/design/layout.js +36 -5
- package/dist/design/layout.js.map +1 -1
- package/dist/design/richText.d.ts +9 -1
- package/dist/design/richText.d.ts.map +1 -1
- package/dist/design/richText.js +8 -2
- package/dist/design/richText.js.map +1 -1
- package/dist/fonts/usage.d.ts +2 -0
- package/dist/fonts/usage.d.ts.map +1 -1
- package/dist/fonts/usage.js +18 -0
- package/dist/fonts/usage.js.map +1 -1
- package/dist/html-backend.d.ts.map +1 -1
- package/dist/html-backend.js +664 -84
- package/dist/html-backend.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/knuthPlass/breakpoints.d.ts.map +1 -1
- package/dist/knuthPlass/breakpoints.js +4 -2
- package/dist/knuthPlass/breakpoints.js.map +1 -1
- package/dist/knuthPlass/pretextAdapter.d.ts +6 -3
- package/dist/knuthPlass/pretextAdapter.d.ts.map +1 -1
- package/dist/knuthPlass/pretextAdapter.js +11 -3
- package/dist/knuthPlass/pretextAdapter.js.map +1 -1
- package/dist/knuthPlass/richAdapter.d.ts +13 -1
- package/dist/knuthPlass/richAdapter.d.ts.map +1 -1
- package/dist/knuthPlass/richAdapter.js +53 -5
- package/dist/knuthPlass/richAdapter.js.map +1 -1
- package/dist/knuthPlass/tracking.d.ts.map +1 -1
- package/dist/knuthPlass/tracking.js +3 -2
- package/dist/knuthPlass/tracking.js.map +1 -1
- package/dist/knuthPlass/types.d.ts +6 -0
- package/dist/knuthPlass/types.d.ts.map +1 -1
- package/dist/locale.d.ts +25 -18
- package/dist/locale.d.ts.map +1 -1
- package/dist/locale.js +27 -20
- package/dist/locale.js.map +1 -1
- package/dist/looseLines.d.ts.map +1 -1
- package/dist/looseLines.js +3 -2
- package/dist/looseLines.js.map +1 -1
- package/dist/measure/canvas.d.ts +21 -0
- package/dist/measure/canvas.d.ts.map +1 -1
- package/dist/measure/canvas.js +165 -85
- package/dist/measure/canvas.js.map +1 -1
- package/dist/measure/cjkCompose.d.ts.map +1 -1
- package/dist/measure/cjkCompose.js +31 -5
- package/dist/measure/cjkCompose.js.map +1 -1
- package/dist/measure/plain.d.ts.map +1 -1
- package/dist/measure/plain.js +31 -6
- package/dist/measure/plain.js.map +1 -1
- package/dist/measure/pretextLanguage.d.ts.map +1 -1
- package/dist/measure/pretextLanguage.js +49 -7
- package/dist/measure/pretextLanguage.js.map +1 -1
- package/dist/measure/rich.d.ts +18 -1
- package/dist/measure/rich.d.ts.map +1 -1
- package/dist/measure/rich.js +200 -29
- package/dist/measure/rich.js.map +1 -1
- package/dist/measure/script.d.ts +17 -1
- package/dist/measure/script.d.ts.map +1 -1
- package/dist/measure/script.js +17 -1
- package/dist/measure/script.js.map +1 -1
- package/dist/measure/trackedLigatures.d.ts +59 -0
- package/dist/measure/trackedLigatures.d.ts.map +1 -0
- package/dist/measure/trackedLigatures.js +144 -0
- package/dist/measure/trackedLigatures.js.map +1 -0
- package/dist/pipeline/build.d.ts.map +1 -1
- package/dist/pipeline/build.js +4 -3
- package/dist/pipeline/build.js.map +1 -1
- package/dist/pipeline/calloutLayout.d.ts.map +1 -1
- package/dist/pipeline/calloutLayout.js +26 -7
- package/dist/pipeline/calloutLayout.js.map +1 -1
- package/dist/pipeline/lists.d.ts +13 -4
- package/dist/pipeline/lists.d.ts.map +1 -1
- package/dist/pipeline/lists.js +49 -12
- package/dist/pipeline/lists.js.map +1 -1
- package/dist/pipeline/toc.d.ts.map +1 -1
- package/dist/pipeline/toc.js +33 -9
- package/dist/pipeline/toc.js.map +1 -1
- package/dist/types.d.ts +35 -22
- package/dist/types.d.ts.map +1 -1
- package/dist/wordPieces.d.ts +120 -0
- package/dist/wordPieces.d.ts.map +1 -0
- package/dist/wordPieces.js +319 -0
- package/dist/wordPieces.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { joiningScriptIn } from '../measure/joining';
|
|
2
2
|
import { paintRunInDirection, runPaintOrder } from './runDirection';
|
|
3
|
+
import { letterSpacingOf, restoreContext, saveContext, setLetterSpacing } from './contextState';
|
|
4
|
+
import { fillContextText } from './contextText';
|
|
3
5
|
/** Trace a rounded rect (radius already clamped to half the box). */
|
|
4
6
|
function roundedRectPath(ctx, x, y, w, h, r) {
|
|
5
7
|
ctx.beginPath();
|
|
@@ -25,7 +27,7 @@ export function paintChip(ctx, chip, x, baseline, inkFor) {
|
|
|
25
27
|
const bx = x + chip.marginLeft;
|
|
26
28
|
const top = baseline - chip.ascent;
|
|
27
29
|
const h = chip.ascent + chip.descent;
|
|
28
|
-
ctx
|
|
30
|
+
saveContext(ctx);
|
|
29
31
|
if (chip.background) {
|
|
30
32
|
roundedRectPath(ctx, bx, top, chip.boxWidth, h, chip.borderRadius);
|
|
31
33
|
ctx.fillStyle = chip.background;
|
|
@@ -41,23 +43,24 @@ export function paintChip(ctx, chip, x, baseline, inkFor) {
|
|
|
41
43
|
ctx.textBaseline = 'alphabetic';
|
|
42
44
|
let tx = bx + chip.borderWidth + chip.paddingX;
|
|
43
45
|
// The block's tracking, which a run of a joining script (measured
|
|
44
|
-
// untracked, `measure/joining.ts`) is painted without.
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
// untracked, `measure/joining.ts`) is painted without. It is asked of
|
|
47
|
+
// the backend, not of the context: read here, inside the state just
|
|
48
|
+
// saved, `ctx.letterSpacing` is `""` (see `contextState.ts`).
|
|
49
|
+
const spacing = letterSpacingOf(ctx);
|
|
47
50
|
// The runs in the chip's paint order, each in its own direction.
|
|
48
51
|
for (const i of runPaintOrder(chip.order, chip.runs.length)) {
|
|
49
52
|
const run = chip.runs[i];
|
|
50
53
|
ctx.font = run.fontString;
|
|
51
54
|
ctx.fillStyle = chip.color ?? inkFor(run);
|
|
52
|
-
const untracked =
|
|
55
|
+
const untracked = spacing !== 0 && joiningScriptIn(run.text);
|
|
53
56
|
if (untracked)
|
|
54
|
-
ctx
|
|
57
|
+
setLetterSpacing(ctx, 0);
|
|
55
58
|
const runX = tx;
|
|
56
|
-
paintRunInDirection(ctx, run.rtl, () => ctx
|
|
59
|
+
paintRunInDirection(ctx, run.rtl, () => fillContextText(ctx, run.text, runX, baseline + (run.baselineShift ?? 0)), run.text);
|
|
57
60
|
if (untracked)
|
|
58
|
-
ctx
|
|
61
|
+
setLetterSpacing(ctx, spacing);
|
|
59
62
|
tx += run.width;
|
|
60
63
|
}
|
|
61
|
-
ctx
|
|
64
|
+
restoreContext(ctx);
|
|
62
65
|
}
|
|
63
66
|
//# sourceMappingURL=chip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip.js","sourceRoot":"","sources":["../../src/canvas-backend/chip.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"chip.js","sourceRoot":"","sources":["../../src/canvas-backend/chip.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,qEAAqE;AACrE,SAAS,eAAe,CAAC,GAA6B,EA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E,CAAC;QAC1B,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC;QAC1B,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC;QAC1C,MAAM,SAAS,GAAG,OAAO,KAAK,CAAC,IAAI,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC7D,IAAI,SAAS;YAAE,gBAAgB,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACxC,MAAM,IAAI,GAAG,EAAE,CAAC;QAChB,mBAAmB,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,GAAG,CAAC,GAAG,CAAC,aAAa,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;QAC7H,IAAI,SAAS;YAAE,gBAAgB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAC9C,EAAE,IAAI,GAAG,CAAC,KAAK,CAAC;IAClB,CAAC;IACD,cAAc,CAAC,GAAG,CAAC,CAAC;AACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comic.d.ts","sourceRoot":"","sources":["../../src/canvas-backend/comic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAe,eAAe,EAAE,YAAY,EAAE,aAAa,EAAsB,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"comic.d.ts","sourceRoot":"","sources":["../../src/canvas-backend/comic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAe,eAAe,EAAE,YAAY,EAAE,aAAa,EAAsB,MAAM,QAAQ,CAAC;AAM5G,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEjE;sCACsC;AACtC,wBAAgB,cAAc,CAAC,GAAG,EAAE,wBAAwB,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC,GAAG,IAAI,CAsB7H;AAaD;;qEAEqE;AACrE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,wBAAwB,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,GAAE,MAAM,GAAG,IAAW,EAAE,GAAG,UAAO,GAAG,IAAI,CAkCpI;AAED;;kDAEkD;AAClD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,wBAAwB,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,GAAE,MAAM,GAAG,IAAW,GAAG,IAAI,CAGxH;AAED;kDACkD;AAClD,wBAAgB,cAAc,CAAC,GAAG,EAAE,wBAAwB,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAuB7E;AAqDD;;8BAE8B;AAC9B,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,wBAAwB,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI,CAYhG;AAED;;qCAEqC;AACrC,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,wBAAwB,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI,CAG5F;AAED,gEAAgE;AAChE,wBAAgB,eAAe,CAAC,GAAG,EAAE,wBAAwB,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,GAAE,MAAM,GAAG,IAAW,GAAG,IAAI,CAGtH"}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
import { drawResourceImage } from './renderResourceBlock';
|
|
12
12
|
import { renderTextBlock } from './headerFooter';
|
|
13
13
|
import { comicBalloonMatrix, comicRoughBorder } from '../comics/paint';
|
|
14
|
+
import { restoreContext, saveContext } from './contextState';
|
|
14
15
|
export { roughOutline, comicRoughBorder } from '../comics/paint';
|
|
15
16
|
/** Trace a panel's outline as the current path: its polygon, or a rounded
|
|
16
17
|
* rectangle when it has a radius. */
|
|
@@ -43,18 +44,18 @@ function drawArt(ctx, art, inkHex) {
|
|
|
43
44
|
const { box } = art;
|
|
44
45
|
if (!art.mirrored)
|
|
45
46
|
return drawResourceImage(ctx, art.fileId, box.x, box.y, box.width, box.height, { inkHex, svg: art.kind === 'svg' }, art.resourceId);
|
|
46
|
-
ctx
|
|
47
|
+
saveContext(ctx);
|
|
47
48
|
ctx.translate(box.x + box.width, box.y);
|
|
48
49
|
ctx.scale(-1, 1);
|
|
49
50
|
const drawn = drawResourceImage(ctx, art.fileId, 0, 0, box.width, box.height, { inkHex, svg: art.kind === 'svg' }, art.resourceId);
|
|
50
|
-
ctx
|
|
51
|
+
restoreContext(ctx);
|
|
51
52
|
return drawn;
|
|
52
53
|
}
|
|
53
54
|
/** Paint one panel: its background, picture and border, and its pop-out
|
|
54
55
|
* cut-out over them unless `pop` is false (a page paints the cut-outs of
|
|
55
56
|
* all its panels after the last one, {@link renderComicPanels}). */
|
|
56
57
|
export function renderComicPanel(ctx, panel, inkHex = null, pop = true) {
|
|
57
|
-
ctx
|
|
58
|
+
saveContext(ctx);
|
|
58
59
|
comicPanelPath(ctx, panel);
|
|
59
60
|
ctx.clip();
|
|
60
61
|
if (panel.background) {
|
|
@@ -66,10 +67,10 @@ export function renderComicPanel(ctx, panel, inkHex = null, pop = true) {
|
|
|
66
67
|
ctx.fillStyle = 'rgba(160, 160, 160, 0.15)';
|
|
67
68
|
ctx.fillRect(panel.bbox.x, panel.bbox.y, panel.bbox.width, panel.bbox.height);
|
|
68
69
|
}
|
|
69
|
-
ctx
|
|
70
|
+
restoreContext(ctx);
|
|
70
71
|
const { border } = panel;
|
|
71
72
|
if (border.style !== 'none' && border.width > 0) {
|
|
72
|
-
ctx
|
|
73
|
+
saveContext(ctx);
|
|
73
74
|
ctx.strokeStyle = border.color;
|
|
74
75
|
ctx.lineWidth = border.width;
|
|
75
76
|
ctx.lineJoin = 'round';
|
|
@@ -85,7 +86,7 @@ export function renderComicPanel(ctx, panel, inkHex = null, pop = true) {
|
|
|
85
86
|
comicPanelPath(ctx, panel);
|
|
86
87
|
}
|
|
87
88
|
ctx.stroke();
|
|
88
|
-
ctx
|
|
89
|
+
restoreContext(ctx);
|
|
89
90
|
}
|
|
90
91
|
// The pop-out cut-out runs over the border, unclipped.
|
|
91
92
|
if (pop && panel.pop)
|
|
@@ -185,7 +186,7 @@ function haloOf(block, halo) {
|
|
|
185
186
|
* halo and its text, leaned by `skew` and turned by `rotate` degrees
|
|
186
187
|
* about its box's centre. */
|
|
187
188
|
export function renderComicBalloon(ctx, balloon) {
|
|
188
|
-
ctx
|
|
189
|
+
saveContext(ctx);
|
|
189
190
|
const m = comicBalloonMatrix(balloon);
|
|
190
191
|
if (m)
|
|
191
192
|
ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
|
|
@@ -199,7 +200,7 @@ export function renderComicBalloon(ctx, balloon) {
|
|
|
199
200
|
}
|
|
200
201
|
for (const block of balloon.text)
|
|
201
202
|
renderTextBlock(ctx, block);
|
|
202
|
-
ctx
|
|
203
|
+
restoreContext(ctx);
|
|
203
204
|
}
|
|
204
205
|
/** Paint the lettering of a comic page: balloons, captions and notes in
|
|
205
206
|
* reading order (each join group's outline, then its text), then the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comic.js","sourceRoot":"","sources":["../../src/canvas-backend/comic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"comic.js","sourceRoot":"","sources":["../../src/canvas-backend/comic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAA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C,CAAC;QACnB,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,IAAI;YAAE,eAAe,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACtF,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,IAAI;QAAE,eAAe,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC9D,cAAc,CAAC,GAAG,CAAC,CAAC;AACtB,CAAC;AAED;;qCAEqC;AACrC,MAAM,UAAU,mBAAmB,CAAC,GAA6B,EAAE,KAAmB;IACpF,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,QAAQ;QAAE,IAAI,CAAC,CAAC,IAAI,KAAK,KAAK;YAAE,kBAAkB,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACjF,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,QAAQ;QAAE,IAAI,CAAC,CAAC,IAAI,KAAK,KAAK;YAAE,kBAAkB,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AACnF,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,eAAe,CAAC,GAA6B,EAAE,KAAmB,EAAE,SAAwB,IAAI;IAC9G,iBAAiB,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IACtC,mBAAmB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a painting context does not keep, or does not tell (#764).
|
|
3
|
+
*
|
|
4
|
+
* Measured on Chrome 131 and 154, on a DOM canvas and an `OffscreenCanvas`:
|
|
5
|
+
*
|
|
6
|
+
* - `save()` makes a state whose language is `inherit` again:
|
|
7
|
+
* `ctx.lang = 'ar'; ctx.save(); ctx.lang` reads `inherit`, a nested save
|
|
8
|
+
* too, and `restore()` brings `ar` back. A page is painted inside saved
|
|
9
|
+
* states from its first column on (a clip, a transform, a style to give
|
|
10
|
+
* back), so every text of it was painted in the language of the page
|
|
11
|
+
* that hosts the canvas, whatever the painter had set: with glyphs of
|
|
12
|
+
* other widths than the layout measured in the document's language.
|
|
13
|
+
* - inside a saved state `ctx.letterSpacing` and `ctx.wordSpacing` read
|
|
14
|
+
* `""` until another value is set, though the spacing in force is the
|
|
15
|
+
* one of the state saved. A painter that read the spacing to put it back
|
|
16
|
+
* after a word painted without it assigned `""`, which the canvas
|
|
17
|
+
* ignores: the rest of that state was painted with no letter-spacing (a
|
|
18
|
+
* chip of a tracked line after its Arabic run).
|
|
19
|
+
*
|
|
20
|
+
* So the backend saves and restores through this module, and sets the
|
|
21
|
+
* letter-spacing through it:
|
|
22
|
+
*
|
|
23
|
+
* - {@link saveContext} carries the language into the new state
|
|
24
|
+
* ({@link languageOf} reads it: that getter tells the truth);
|
|
25
|
+
* - {@link setLetterSpacing} sets the spacing and remembers it, per saved
|
|
26
|
+
* state; {@link letterSpacingOf} answers what was set. Nothing reads the
|
|
27
|
+
* spacing back from the context.
|
|
28
|
+
*
|
|
29
|
+
* Every `save()`, `restore()` and letter-spacing of the paint code goes
|
|
30
|
+
* through here (`contextState.test.ts` scans the sources for a bare one).
|
|
31
|
+
*
|
|
32
|
+
* The word spacing is the key of the word cache a text is painted from
|
|
33
|
+
* (#770, `contextText.ts`). It reads `""` inside a saved state as the
|
|
34
|
+
* letter-spacing does, but nothing reads it: it is set before every text,
|
|
35
|
+
* a value set inside a saved state is taken, and `restore()` brings the
|
|
36
|
+
* outer one back (the same sequences measured on Chrome 154, three states
|
|
37
|
+
* deep). So neither `saveContext` nor `restoreContext` carries it.
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* `ctx.save()`, the new state in the language of the one saved. A context
|
|
41
|
+
* whose language is the host's (`inherit`: nobody set one) or that has
|
|
42
|
+
* none (an older browser) is saved as it is.
|
|
43
|
+
*/
|
|
44
|
+
export declare function saveContext(ctx: {
|
|
45
|
+
save(): void;
|
|
46
|
+
}): void;
|
|
47
|
+
/** `ctx.restore()` of a state saved with {@link saveContext}: the context
|
|
48
|
+
* has the language and the letter-spacing of the state it comes back to. */
|
|
49
|
+
export declare function restoreContext(ctx: {
|
|
50
|
+
restore(): void;
|
|
51
|
+
}): void;
|
|
52
|
+
/** Set the context's letter-spacing, px after every letter. */
|
|
53
|
+
export declare function setLetterSpacing(ctx: {
|
|
54
|
+
letterSpacing: string;
|
|
55
|
+
}, px: number): void;
|
|
56
|
+
/** The letter-spacing in force on the context, px: the one set last with
|
|
57
|
+
* {@link setLetterSpacing} in its state or in the states around it, 0
|
|
58
|
+
* when none was. */
|
|
59
|
+
export declare function letterSpacingOf(ctx: object): number;
|
|
60
|
+
/** The language set on a context: undefined for the host's (`inherit`)
|
|
61
|
+
* and for a context that has none. What a painter that places text by
|
|
62
|
+
* its measured widths asks the measuring module to measure in
|
|
63
|
+
* (`withMeasureLanguage`). */
|
|
64
|
+
export declare function languageOf(ctx: object): string | undefined;
|
|
65
|
+
/** Forget what was set on a context whose state is new: a canvas just
|
|
66
|
+
* given its size has no saved state, no letter-spacing and the host's
|
|
67
|
+
* language. */
|
|
68
|
+
export declare function resetContextState(ctx: object): void;
|
|
69
|
+
//# sourceMappingURL=contextState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextState.d.ts","sourceRoot":"","sources":["../../src/canvas-backend/contextState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AASH;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE;IAAE,IAAI,IAAI,IAAI,CAAA;CAAE,GAAG,IAAI,CAMvD;AAED;6EAC6E;AAC7E,wBAAgB,cAAc,CAAC,GAAG,EAAE;IAAE,OAAO,IAAI,IAAI,CAAA;CAAE,GAAG,IAAI,CAG7D;AAED,+DAA+D;AAC/D,wBAAgB,gBAAgB,CAAC,GAAG,EAAE;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAMjF;AAED;;qBAEqB;AACrB,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGnD;AAED;;;+BAG+B;AAC/B,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAG1D;AAED;;gBAEgB;AAChB,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEnD"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a painting context does not keep, or does not tell (#764).
|
|
3
|
+
*
|
|
4
|
+
* Measured on Chrome 131 and 154, on a DOM canvas and an `OffscreenCanvas`:
|
|
5
|
+
*
|
|
6
|
+
* - `save()` makes a state whose language is `inherit` again:
|
|
7
|
+
* `ctx.lang = 'ar'; ctx.save(); ctx.lang` reads `inherit`, a nested save
|
|
8
|
+
* too, and `restore()` brings `ar` back. A page is painted inside saved
|
|
9
|
+
* states from its first column on (a clip, a transform, a style to give
|
|
10
|
+
* back), so every text of it was painted in the language of the page
|
|
11
|
+
* that hosts the canvas, whatever the painter had set: with glyphs of
|
|
12
|
+
* other widths than the layout measured in the document's language.
|
|
13
|
+
* - inside a saved state `ctx.letterSpacing` and `ctx.wordSpacing` read
|
|
14
|
+
* `""` until another value is set, though the spacing in force is the
|
|
15
|
+
* one of the state saved. A painter that read the spacing to put it back
|
|
16
|
+
* after a word painted without it assigned `""`, which the canvas
|
|
17
|
+
* ignores: the rest of that state was painted with no letter-spacing (a
|
|
18
|
+
* chip of a tracked line after its Arabic run).
|
|
19
|
+
*
|
|
20
|
+
* So the backend saves and restores through this module, and sets the
|
|
21
|
+
* letter-spacing through it:
|
|
22
|
+
*
|
|
23
|
+
* - {@link saveContext} carries the language into the new state
|
|
24
|
+
* ({@link languageOf} reads it: that getter tells the truth);
|
|
25
|
+
* - {@link setLetterSpacing} sets the spacing and remembers it, per saved
|
|
26
|
+
* state; {@link letterSpacingOf} answers what was set. Nothing reads the
|
|
27
|
+
* spacing back from the context.
|
|
28
|
+
*
|
|
29
|
+
* Every `save()`, `restore()` and letter-spacing of the paint code goes
|
|
30
|
+
* through here (`contextState.test.ts` scans the sources for a bare one).
|
|
31
|
+
*
|
|
32
|
+
* The word spacing is the key of the word cache a text is painted from
|
|
33
|
+
* (#770, `contextText.ts`). It reads `""` inside a saved state as the
|
|
34
|
+
* letter-spacing does, but nothing reads it: it is set before every text,
|
|
35
|
+
* a value set inside a saved state is taken, and `restore()` brings the
|
|
36
|
+
* outer one back (the same sequences measured on Chrome 154, three states
|
|
37
|
+
* deep). So neither `saveContext` nor `restoreContext` carries it.
|
|
38
|
+
*/
|
|
39
|
+
/** The language a context has until someone sets one: the host's. */
|
|
40
|
+
const HOST_LANGUAGE = 'inherit';
|
|
41
|
+
/** Context → the letter-spacing set in each of its saved states, px, the
|
|
42
|
+
* innermost last. A context nothing was set on has no entry: no spacing. */
|
|
43
|
+
const spacings = new WeakMap();
|
|
44
|
+
/**
|
|
45
|
+
* `ctx.save()`, the new state in the language of the one saved. A context
|
|
46
|
+
* whose language is the host's (`inherit`: nobody set one) or that has
|
|
47
|
+
* none (an older browser) is saved as it is.
|
|
48
|
+
*/
|
|
49
|
+
export function saveContext(ctx) {
|
|
50
|
+
const lang = ctx.lang;
|
|
51
|
+
ctx.save();
|
|
52
|
+
if (typeof lang === 'string' && lang !== HOST_LANGUAGE)
|
|
53
|
+
ctx.lang = lang;
|
|
54
|
+
const stack = spacings.get(ctx);
|
|
55
|
+
if (stack)
|
|
56
|
+
stack.push(stack[stack.length - 1] ?? 0);
|
|
57
|
+
}
|
|
58
|
+
/** `ctx.restore()` of a state saved with {@link saveContext}: the context
|
|
59
|
+
* has the language and the letter-spacing of the state it comes back to. */
|
|
60
|
+
export function restoreContext(ctx) {
|
|
61
|
+
ctx.restore();
|
|
62
|
+
spacings.get(ctx)?.pop();
|
|
63
|
+
}
|
|
64
|
+
/** Set the context's letter-spacing, px after every letter. */
|
|
65
|
+
export function setLetterSpacing(ctx, px) {
|
|
66
|
+
ctx.letterSpacing = `${px}px`;
|
|
67
|
+
const stack = spacings.get(ctx);
|
|
68
|
+
if (!stack)
|
|
69
|
+
spacings.set(ctx, [px]);
|
|
70
|
+
else if (stack.length === 0)
|
|
71
|
+
stack.push(px);
|
|
72
|
+
else
|
|
73
|
+
stack[stack.length - 1] = px;
|
|
74
|
+
}
|
|
75
|
+
/** The letter-spacing in force on the context, px: the one set last with
|
|
76
|
+
* {@link setLetterSpacing} in its state or in the states around it, 0
|
|
77
|
+
* when none was. */
|
|
78
|
+
export function letterSpacingOf(ctx) {
|
|
79
|
+
const stack = spacings.get(ctx);
|
|
80
|
+
return stack?.[stack.length - 1] ?? 0;
|
|
81
|
+
}
|
|
82
|
+
/** The language set on a context: undefined for the host's (`inherit`)
|
|
83
|
+
* and for a context that has none. What a painter that places text by
|
|
84
|
+
* its measured widths asks the measuring module to measure in
|
|
85
|
+
* (`withMeasureLanguage`). */
|
|
86
|
+
export function languageOf(ctx) {
|
|
87
|
+
const lang = ctx.lang;
|
|
88
|
+
return typeof lang === 'string' && lang !== HOST_LANGUAGE ? lang : undefined;
|
|
89
|
+
}
|
|
90
|
+
/** Forget what was set on a context whose state is new: a canvas just
|
|
91
|
+
* given its size has no saved state, no letter-spacing and the host's
|
|
92
|
+
* language. */
|
|
93
|
+
export function resetContextState(ctx) {
|
|
94
|
+
spacings.delete(ctx);
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=contextState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextState.js","sourceRoot":"","sources":["../../src/canvas-backend/contextState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,qEAAqE;AACrE,MAAM,aAAa,GAAG,SAAS,CAAC;AAEhC;6EAC6E;AAC7E,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAo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AAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;AACxC,CAAC;AAED;;;+BAG+B;AAC/B,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,MAAM,IAAI,GAAI,GAA0B,CAAC,IAAI,CAAC;IAC9C,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/E,CAAC;AAED;;gBAEgB;AAChB,MAAM,UAAU,iBAAiB,CAAC,GAAW;IAC3C,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A text painted as wide as it was measured, whatever the context painted
|
|
3
|
+
* before (#770).
|
|
4
|
+
*
|
|
5
|
+
* Chrome's canvas keeps the words it shaped, per context, font, language
|
|
6
|
+
* and a few attributes, under the word's text alone (`measure/canvas.ts`
|
|
7
|
+
* tells the whole of it). A word shapes two ways: in a string of Latin-1
|
|
8
|
+
* characters held one byte each it is all Latin script; in a string that
|
|
9
|
+
* holds a wider character, or that V8 still holds two bytes a character
|
|
10
|
+
* (a slice of 13 characters or more of such a text, a string that came
|
|
11
|
+
* through a structured clone of one), each word is taken alone and a word
|
|
12
|
+
* with no letter is drawn by the font's default rules. The first shape to
|
|
13
|
+
* enter the cache answers for both. Measured on Chrome 154, Noto Serif SC
|
|
14
|
+
* at 10 px in English: `2016` is 22 px wide alone on a fresh context and
|
|
15
|
+
* 21.44 px once a line holding `2016` and a Han character was painted
|
|
16
|
+
* there; the cache outlives `canvas.width = …`, so it is the page's for
|
|
17
|
+
* as long as its canvas lives. Of 44 strings painted in eight orders on
|
|
18
|
+
* one canvas, 19 changed width with the order in that face, 10 in Amiri.
|
|
19
|
+
*
|
|
20
|
+
* The measurer of a document shaped in its own language has a context per
|
|
21
|
+
* kind of string. A page has one canvas, so the painter keeps two caches
|
|
22
|
+
* on it. The word spacing is part of the cache's key, and one of
|
|
23
|
+
* `1e-9px` moves nothing: 52 224 measures (51 faces, web and system, two
|
|
24
|
+
* languages, four sizes, both directions, with and without a
|
|
25
|
+
* letter-spacing) give the widths and the ink boxes of `0px` to the last
|
|
26
|
+
* bit, and 126 paintings the same pixels. A string with a character past
|
|
27
|
+
* U+00FF is handed over under that spacing, any other under `0px`,
|
|
28
|
+
* rebuilt one byte a character. So each string is set as a context that
|
|
29
|
+
* never painted anything sets it, which is what the layout measured; a
|
|
30
|
+
* document in its host's language, measured on one context word by word,
|
|
31
|
+
* is painted the same way. The page sets no other word spacing.
|
|
32
|
+
*
|
|
33
|
+
* (`fontKerning = 'normal'` and `textRendering = 'optimizeLegibility'`
|
|
34
|
+
* key a second cache too and shape a web face as the defaults do, but not
|
|
35
|
+
* a system face: Avenir Next sets `To AV Ty.` 40.64 px wide at 10 px
|
|
36
|
+
* under `'auto'` and 40.04 px under `'normal'`, and a kana of a fallback
|
|
37
|
+
* face is kerned under `'normal'` only.)
|
|
38
|
+
*
|
|
39
|
+
* The spacing is set before every call. Inside a saved state it reads
|
|
40
|
+
* `""` (`contextState.ts`), but a value set there is taken, and
|
|
41
|
+
* `restore()` brings the outer one back: nothing has to carry it. A
|
|
42
|
+
* canvas given a size starts at `0px` again.
|
|
43
|
+
*
|
|
44
|
+
* Every `fillText`, `strokeText` and `measureText` of the paint code goes
|
|
45
|
+
* through here (`contextText.test.ts` scans the sources for a bare one):
|
|
46
|
+
* a measure taken on the painting context must read the cache the text is
|
|
47
|
+
* painted from. `mirrorFrame.ts` wraps the context's own methods for a
|
|
48
|
+
* mirrored page and is called from here like the context.
|
|
49
|
+
*/
|
|
50
|
+
/** What the calls below ask of a context. */
|
|
51
|
+
type TextContext = Pick<CanvasRenderingContext2D, 'fillText' | 'strokeText' | 'measureText'>;
|
|
52
|
+
/**
|
|
53
|
+
* `text` as it is handed to `ctx`, the context set to the word cache of
|
|
54
|
+
* its kind: as it is under the word spacing of the wide strings when it
|
|
55
|
+
* holds a character past U+00FF, else one byte a character under `0px`.
|
|
56
|
+
* A context without the attribute (an older browser, a test's stub) takes
|
|
57
|
+
* the string all the same.
|
|
58
|
+
*/
|
|
59
|
+
export declare function handedText(ctx: object, text: string): string;
|
|
60
|
+
/** `ctx.fillText(text, x, y)`, the text set as a fresh context sets it. */
|
|
61
|
+
export declare function fillContextText(ctx: Pick<TextContext, 'fillText'>, text: string, x: number, y: number): void;
|
|
62
|
+
/** `ctx.strokeText(text, x, y)`, as {@link fillContextText}. */
|
|
63
|
+
export declare function strokeContextText(ctx: Pick<TextContext, 'strokeText'>, text: string, x: number, y: number): void;
|
|
64
|
+
/** `ctx.measureText(text)`: the metrics {@link fillContextText} paints
|
|
65
|
+
* `text` at, in the context's font, language, spacing and direction. */
|
|
66
|
+
export declare function measureContextText(ctx: Pick<TextContext, 'measureText'>, text: string): TextMetrics;
|
|
67
|
+
/** The advance {@link fillContextText} paints `text` at, px. */
|
|
68
|
+
export declare function contextTextWidth(ctx: Pick<TextContext, 'measureText'>, text: string): number;
|
|
69
|
+
/** Leave a context at the word spacing a canvas has when it is given its
|
|
70
|
+
* size, `0px`: what the host paints on the page afterwards reads the
|
|
71
|
+
* cache of the Latin-1 strings, as on a canvas nothing was painted on.
|
|
72
|
+
* Nothing is read back: inside a saved state the context would answer
|
|
73
|
+
* `""` (`contextState.ts`). */
|
|
74
|
+
export declare function resetWordSpacing(ctx: object): void;
|
|
75
|
+
export {};
|
|
76
|
+
//# sourceMappingURL=contextText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextText.d.ts","sourceRoot":"","sources":["../../src/canvas-backend/contextText.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAYH,6CAA6C;AAC7C,KAAK,WAAW,GAAG,IAAI,CAAC,wBAAwB,EAAE,UAAU,GAAG,YAAY,GAAG,aAAa,CAAC,CAAC;AAE7F;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAO5D;AAED,2EAA2E;AAC3E,wBAAgB,eAAe,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAE5G;AAED,gEAAgE;AAChE,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAEhH;AAED;yEACyE;AACzE,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,CAEnG;AAED,gEAAgE;AAChE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5F;AAED;;;;gCAIgC;AAChC,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAElD"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A text painted as wide as it was measured, whatever the context painted
|
|
3
|
+
* before (#770).
|
|
4
|
+
*
|
|
5
|
+
* Chrome's canvas keeps the words it shaped, per context, font, language
|
|
6
|
+
* and a few attributes, under the word's text alone (`measure/canvas.ts`
|
|
7
|
+
* tells the whole of it). A word shapes two ways: in a string of Latin-1
|
|
8
|
+
* characters held one byte each it is all Latin script; in a string that
|
|
9
|
+
* holds a wider character, or that V8 still holds two bytes a character
|
|
10
|
+
* (a slice of 13 characters or more of such a text, a string that came
|
|
11
|
+
* through a structured clone of one), each word is taken alone and a word
|
|
12
|
+
* with no letter is drawn by the font's default rules. The first shape to
|
|
13
|
+
* enter the cache answers for both. Measured on Chrome 154, Noto Serif SC
|
|
14
|
+
* at 10 px in English: `2016` is 22 px wide alone on a fresh context and
|
|
15
|
+
* 21.44 px once a line holding `2016` and a Han character was painted
|
|
16
|
+
* there; the cache outlives `canvas.width = …`, so it is the page's for
|
|
17
|
+
* as long as its canvas lives. Of 44 strings painted in eight orders on
|
|
18
|
+
* one canvas, 19 changed width with the order in that face, 10 in Amiri.
|
|
19
|
+
*
|
|
20
|
+
* The measurer of a document shaped in its own language has a context per
|
|
21
|
+
* kind of string. A page has one canvas, so the painter keeps two caches
|
|
22
|
+
* on it. The word spacing is part of the cache's key, and one of
|
|
23
|
+
* `1e-9px` moves nothing: 52 224 measures (51 faces, web and system, two
|
|
24
|
+
* languages, four sizes, both directions, with and without a
|
|
25
|
+
* letter-spacing) give the widths and the ink boxes of `0px` to the last
|
|
26
|
+
* bit, and 126 paintings the same pixels. A string with a character past
|
|
27
|
+
* U+00FF is handed over under that spacing, any other under `0px`,
|
|
28
|
+
* rebuilt one byte a character. So each string is set as a context that
|
|
29
|
+
* never painted anything sets it, which is what the layout measured; a
|
|
30
|
+
* document in its host's language, measured on one context word by word,
|
|
31
|
+
* is painted the same way. The page sets no other word spacing.
|
|
32
|
+
*
|
|
33
|
+
* (`fontKerning = 'normal'` and `textRendering = 'optimizeLegibility'`
|
|
34
|
+
* key a second cache too and shape a web face as the defaults do, but not
|
|
35
|
+
* a system face: Avenir Next sets `To AV Ty.` 40.64 px wide at 10 px
|
|
36
|
+
* under `'auto'` and 40.04 px under `'normal'`, and a kana of a fallback
|
|
37
|
+
* face is kerned under `'normal'` only.)
|
|
38
|
+
*
|
|
39
|
+
* The spacing is set before every call. Inside a saved state it reads
|
|
40
|
+
* `""` (`contextState.ts`), but a value set there is taken, and
|
|
41
|
+
* `restore()` brings the outer one back: nothing has to carry it. A
|
|
42
|
+
* canvas given a size starts at `0px` again.
|
|
43
|
+
*
|
|
44
|
+
* Every `fillText`, `strokeText` and `measureText` of the paint code goes
|
|
45
|
+
* through here (`contextText.test.ts` scans the sources for a bare one):
|
|
46
|
+
* a measure taken on the painting context must read the cache the text is
|
|
47
|
+
* painted from. `mirrorFrame.ts` wraps the context's own methods for a
|
|
48
|
+
* mirrored page and is called from here like the context.
|
|
49
|
+
*/
|
|
50
|
+
/** A character past Latin-1: a string that holds one is two bytes a
|
|
51
|
+
* character to the browser. */
|
|
52
|
+
const WIDE_RE = /[^\u0000-ÿ]/;
|
|
53
|
+
/** The word spacing that keys the cache of the strings with a character
|
|
54
|
+
* past Latin-1: too small to move a glyph (a float of 32 bits holds an
|
|
55
|
+
* advance to 1e-7 of its size), another value than `0px` to the cache. */
|
|
56
|
+
const WIDE_SPACING = '1e-9px';
|
|
57
|
+
const NARROW_SPACING = '0px';
|
|
58
|
+
/**
|
|
59
|
+
* `text` as it is handed to `ctx`, the context set to the word cache of
|
|
60
|
+
* its kind: as it is under the word spacing of the wide strings when it
|
|
61
|
+
* holds a character past U+00FF, else one byte a character under `0px`.
|
|
62
|
+
* A context without the attribute (an older browser, a test's stub) takes
|
|
63
|
+
* the string all the same.
|
|
64
|
+
*/
|
|
65
|
+
export function handedText(ctx, text) {
|
|
66
|
+
const wide = WIDE_RE.test(text);
|
|
67
|
+
if ('wordSpacing' in ctx)
|
|
68
|
+
ctx.wordSpacing = wide ? WIDE_SPACING : NARROW_SPACING;
|
|
69
|
+
if (wide)
|
|
70
|
+
return text;
|
|
71
|
+
let out = '';
|
|
72
|
+
for (let i = 0; i < text.length; i++)
|
|
73
|
+
out += text[i];
|
|
74
|
+
return out;
|
|
75
|
+
}
|
|
76
|
+
/** `ctx.fillText(text, x, y)`, the text set as a fresh context sets it. */
|
|
77
|
+
export function fillContextText(ctx, text, x, y) {
|
|
78
|
+
ctx.fillText(handedText(ctx, text), x, y);
|
|
79
|
+
}
|
|
80
|
+
/** `ctx.strokeText(text, x, y)`, as {@link fillContextText}. */
|
|
81
|
+
export function strokeContextText(ctx, text, x, y) {
|
|
82
|
+
ctx.strokeText(handedText(ctx, text), x, y);
|
|
83
|
+
}
|
|
84
|
+
/** `ctx.measureText(text)`: the metrics {@link fillContextText} paints
|
|
85
|
+
* `text` at, in the context's font, language, spacing and direction. */
|
|
86
|
+
export function measureContextText(ctx, text) {
|
|
87
|
+
return ctx.measureText(handedText(ctx, text));
|
|
88
|
+
}
|
|
89
|
+
/** The advance {@link fillContextText} paints `text` at, px. */
|
|
90
|
+
export function contextTextWidth(ctx, text) {
|
|
91
|
+
return ctx.measureText(handedText(ctx, text)).width;
|
|
92
|
+
}
|
|
93
|
+
/** Leave a context at the word spacing a canvas has when it is given its
|
|
94
|
+
* size, `0px`: what the host paints on the page afterwards reads the
|
|
95
|
+
* cache of the Latin-1 strings, as on a canvas nothing was painted on.
|
|
96
|
+
* Nothing is read back: inside a saved state the context would answer
|
|
97
|
+
* `""` (`contextState.ts`). */
|
|
98
|
+
export function resetWordSpacing(ctx) {
|
|
99
|
+
if ('wordSpacing' in ctx)
|
|
100
|
+
ctx.wordSpacing = NARROW_SPACING;
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=contextText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextText.js","sourceRoot":"","sources":["../../src/canvas-backend/contextText.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH;gCACgC;AAChC,MAAM,OAAO,GAAG,aAAa,CAAC;AAE9B;;2EAE2E;AAC3E,MAAM,YAAY,GAAG,QAAQ,CAAC;AAC9B,MAAM,cAAc,GAAG,KAAK,CAAC;AAK7B;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,GAAW,EAAE,IAAY;IAClD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChC,IAAI,aAAa,IAAI,GAAG;QAAG,GA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1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorations.d.ts","sourceRoot":"","sources":["../../src/canvas-backend/decorations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAI3E,OAAO,EAAwB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"decorations.d.ts","sourceRoot":"","sources":["../../src/canvas-backend/decorations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAI3E,OAAO,EAAwB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAG9E,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,wBAAwB,EAC7B,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,MAAM,EACzB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC1C,IAAI,CA4BN;AAED;;uBAEuB;AACvB,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,wBAAwB,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI,CAsB5F;AAED,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,wBAAwB,EAC7B,OAAO,EAAE,SAAS,EAAE,EACpB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,aAAa,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GACvC,IAAI,CAoBN;AAED,wBAAgB,cAAc,CAC5B,GAAG,EAAE,wBAAwB,EAC7B,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,WAAW,GACf,IAAI,CAiBN;AAED;;gEAEgE;AAChE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,E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