oasis-editor 0.0.97 → 0.0.98
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/{OasisEditorApp-m8k4gBW1.js → OasisEditorApp-QVHCHhPa.js} +16 -3
- package/dist/assets/{importDocxWorker-BV6LezJZ.js → importDocxWorker-BulqJDJj.js} +1 -1
- package/dist/core/model/types/documentComments.d.ts +5 -0
- package/dist/core/model/types/styles.d.ts +11 -0
- package/dist/import/docx/commentsXml.d.ts +2 -0
- package/dist/{index-BiTnt_yD.js → index-DBzN897A.js} +28 -2
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +4 -4
- package/dist/ui/canvas/canvasFontResolution.d.ts +28 -0
- package/dist/ui/canvas/canvasParagraphPainter.d.ts +1 -1
- package/package.json +1 -1
|
@@ -8,3 +8,31 @@ export declare function resolveCanvasTextRenderMetrics(styles: {
|
|
|
8
8
|
fontSize: number;
|
|
9
9
|
baselineOffset: number;
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Applies the subset of OpenType-feature/typography intent that Canvas 2D can
|
|
13
|
+
* actually express, keeping painting consistent with the metric-only slot
|
|
14
|
+
* measurement (see `measureCharacterWidth`).
|
|
15
|
+
*
|
|
16
|
+
* - **Kerning (`w:kern`)** → `ctx.fontKerning`. `w:kern/@w:val` is a *minimum
|
|
17
|
+
* font size threshold* (stored in pt as `kerningThreshold`); kerning is active
|
|
18
|
+
* only when the run's size meets it. Defaulting to `"none"` keeps the painter
|
|
19
|
+
* aligned with the no-kerning measurement, avoiding caret/slot drift.
|
|
20
|
+
* - **Ligatures (`w14:ligatures`)** → `ctx.textRendering` as a *coarse, lossy
|
|
21
|
+
* hint* (`optimizeSpeed` suppresses, `optimizeLegibility` enables). It cannot
|
|
22
|
+
* distinguish standard/contextual/historical and is engine-dependent.
|
|
23
|
+
*
|
|
24
|
+
* Canvas 2D has **no** API for `w14:numForm`, `w14:numSpacing`,
|
|
25
|
+
* `w14:stylisticSets`, or `w14:cntxtAlts` (no `fontVariantNumeric` /
|
|
26
|
+
* `fontVariantLigatures` / `fontFeatureSettings`), so those remain a documented
|
|
27
|
+
* canvas limitation — HTML/CSS honors them via `styleCss.ts`; PDF is separate.
|
|
28
|
+
*
|
|
29
|
+
* `fontVariantCaps`, `letterSpacing`, and `fontStretch` are intentionally left
|
|
30
|
+
* untouched: small caps, character spacing, and character scale are already
|
|
31
|
+
* realized by the render-metric/slot/scale path and would double-apply here.
|
|
32
|
+
*
|
|
33
|
+
* @param fontSizePx the run's effective (unscaled) font size in px.
|
|
34
|
+
*/
|
|
35
|
+
export declare function applyCanvasTextFeatureHints(ctx: CanvasRenderingContext2D, styles: {
|
|
36
|
+
kerningThreshold?: number | null;
|
|
37
|
+
ligatures?: "none" | "standard" | "contextual" | "historical" | "standardContextual" | null;
|
|
38
|
+
} | undefined, fontSizePx: number): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EditorLayoutLine, EditorPageSettings, EditorParagraphNode, EditorState } from '../../core/model.js';
|
|
2
2
|
import { CanvasBlockPainters } from './canvasBlockPainters.js';
|
|
3
3
|
|
|
4
|
-
export { resolveCanvasFontFamily, resolveCanvasTextRenderMetrics, } from './canvasFontResolution.js';
|
|
4
|
+
export { applyCanvasTextFeatureHints, resolveCanvasFontFamily, resolveCanvasTextRenderMetrics, } from './canvasFontResolution.js';
|
|
5
5
|
/**
|
|
6
6
|
* Paints the floating images anchored within a paragraph, mirroring
|
|
7
7
|
* `drawFloatingTextBoxesForParagraph`. Split into `behind`/`front` layers so a
|