@lightningjs/renderer 2.16.0 → 2.17.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/src/core/CoreTextureManager.js +1 -1
- package/dist/src/core/CoreTextureManager.js.map +1 -1
- package/dist/src/core/TextureMemoryManager.js +14 -32
- package/dist/src/core/TextureMemoryManager.js.map +1 -1
- package/dist/tsconfig.dist.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/core/CoreTextureManager.ts +1 -1
- package/src/core/TextureMemoryManager.ts +21 -38
- package/dist/exports/canvas-shaders.d.ts +0 -10
- package/dist/exports/canvas-shaders.js +0 -27
- package/dist/exports/canvas-shaders.js.map +0 -1
- package/dist/exports/webgl-shaders.d.ts +0 -11
- package/dist/exports/webgl-shaders.js +0 -28
- package/dist/exports/webgl-shaders.js.map +0 -1
- package/dist/src/core/platforms/Platform.d.ts +0 -37
- package/dist/src/core/platforms/Platform.js +0 -22
- package/dist/src/core/platforms/Platform.js.map +0 -1
- package/dist/src/core/platforms/web/WebPlatform.d.ts +0 -9
- package/dist/src/core/platforms/web/WebPlatform.js +0 -58
- package/dist/src/core/platforms/web/WebPlatform.js.map +0 -1
- package/dist/src/core/renderers/CoreShaderNode.d.ts +0 -59
- package/dist/src/core/renderers/CoreShaderNode.js +0 -113
- package/dist/src/core/renderers/CoreShaderNode.js.map +0 -1
- package/dist/src/core/renderers/CoreShaderProgram.d.ts +0 -4
- package/dist/src/core/renderers/CoreShaderProgram.js +0 -20
- package/dist/src/core/renderers/CoreShaderProgram.js.map +0 -1
- package/dist/src/core/renderers/canvas/CanvasRenderer.d.ts +0 -37
- package/dist/src/core/renderers/canvas/CanvasRenderer.js +0 -215
- package/dist/src/core/renderers/canvas/CanvasRenderer.js.map +0 -1
- package/dist/src/core/renderers/canvas/CanvasShaderNode.d.ts +0 -21
- package/dist/src/core/renderers/canvas/CanvasShaderNode.js +0 -57
- package/dist/src/core/renderers/canvas/CanvasShaderNode.js.map +0 -1
- package/dist/src/core/renderers/canvas/CanvasTexture.d.ts +0 -16
- package/dist/src/core/renderers/canvas/CanvasTexture.js +0 -124
- package/dist/src/core/renderers/canvas/CanvasTexture.js.map +0 -1
- package/dist/src/core/renderers/webgl/WebGlCtxRenderTexture.d.ts +0 -12
- package/dist/src/core/renderers/webgl/WebGlCtxRenderTexture.js +0 -55
- package/dist/src/core/renderers/webgl/WebGlCtxRenderTexture.js.map +0 -1
- package/dist/src/core/renderers/webgl/WebGlCtxSubTexture.d.ts +0 -9
- package/dist/src/core/renderers/webgl/WebGlCtxSubTexture.js +0 -38
- package/dist/src/core/renderers/webgl/WebGlCtxSubTexture.js.map +0 -1
- package/dist/src/core/renderers/webgl/WebGlCtxTexture.d.ts +0 -57
- package/dist/src/core/renderers/webgl/WebGlCtxTexture.js +0 -224
- package/dist/src/core/renderers/webgl/WebGlCtxTexture.js.map +0 -1
- package/dist/src/core/renderers/webgl/WebGlRenderOp.d.ts +0 -44
- package/dist/src/core/renderers/webgl/WebGlRenderOp.js +0 -125
- package/dist/src/core/renderers/webgl/WebGlRenderOp.js.map +0 -1
- package/dist/src/core/renderers/webgl/WebGlRenderer.d.ts +0 -136
- package/dist/src/core/renderers/webgl/WebGlRenderer.js +0 -573
- package/dist/src/core/renderers/webgl/WebGlRenderer.js.map +0 -1
- package/dist/src/core/renderers/webgl/WebGlShaderNode.d.ts +0 -222
- package/dist/src/core/renderers/webgl/WebGlShaderNode.js +0 -331
- package/dist/src/core/renderers/webgl/WebGlShaderNode.js.map +0 -1
- package/dist/src/core/renderers/webgl/WebGlShaderProgram.d.ts +0 -35
- package/dist/src/core/renderers/webgl/WebGlShaderProgram.js +0 -201
- package/dist/src/core/renderers/webgl/WebGlShaderProgram.js.map +0 -1
- package/dist/src/core/shaders/canvas/Border.d.ts +0 -9
- package/dist/src/core/shaders/canvas/Border.js +0 -57
- package/dist/src/core/shaders/canvas/Border.js.map +0 -1
- package/dist/src/core/shaders/canvas/HolePunch.d.ts +0 -7
- package/dist/src/core/shaders/canvas/HolePunch.js +0 -38
- package/dist/src/core/shaders/canvas/HolePunch.js.map +0 -1
- package/dist/src/core/shaders/canvas/LinearGradient.d.ts +0 -10
- package/dist/src/core/shaders/canvas/LinearGradient.js +0 -48
- package/dist/src/core/shaders/canvas/LinearGradient.js.map +0 -1
- package/dist/src/core/shaders/canvas/RadialGradient.d.ts +0 -11
- package/dist/src/core/shaders/canvas/RadialGradient.js +0 -70
- package/dist/src/core/shaders/canvas/RadialGradient.js.map +0 -1
- package/dist/src/core/shaders/canvas/Rounded.d.ts +0 -7
- package/dist/src/core/shaders/canvas/Rounded.js +0 -33
- package/dist/src/core/shaders/canvas/Rounded.js.map +0 -1
- package/dist/src/core/shaders/canvas/RoundedWithBorder.d.ts +0 -7
- package/dist/src/core/shaders/canvas/RoundedWithBorder.js +0 -43
- package/dist/src/core/shaders/canvas/RoundedWithBorder.js.map +0 -1
- package/dist/src/core/shaders/canvas/RoundedWithBorderAndShadow.d.ts +0 -8
- package/dist/src/core/shaders/canvas/RoundedWithBorderAndShadow.js +0 -41
- package/dist/src/core/shaders/canvas/RoundedWithBorderAndShadow.js.map +0 -1
- package/dist/src/core/shaders/canvas/RoundedWithShadow.d.ts +0 -7
- package/dist/src/core/shaders/canvas/RoundedWithShadow.js +0 -40
- package/dist/src/core/shaders/canvas/RoundedWithShadow.js.map +0 -1
- package/dist/src/core/shaders/canvas/Shadow.d.ts +0 -8
- package/dist/src/core/shaders/canvas/Shadow.js +0 -31
- package/dist/src/core/shaders/canvas/Shadow.js.map +0 -1
- package/dist/src/core/shaders/canvas/utils/render.d.ts +0 -5
- package/dist/src/core/shaders/canvas/utils/render.js +0 -84
- package/dist/src/core/shaders/canvas/utils/render.js.map +0 -1
- package/dist/src/core/shaders/templates/BorderTemplate.d.ts +0 -37
- package/dist/src/core/shaders/templates/BorderTemplate.js +0 -73
- package/dist/src/core/shaders/templates/BorderTemplate.js.map +0 -1
- package/dist/src/core/shaders/templates/HolePunchTemplate.d.ts +0 -46
- package/dist/src/core/shaders/templates/HolePunchTemplate.js +0 -35
- package/dist/src/core/shaders/templates/HolePunchTemplate.js.map +0 -1
- package/dist/src/core/shaders/templates/LinearGradientTemplate.d.ts +0 -23
- package/dist/src/core/shaders/templates/LinearGradientTemplate.js +0 -47
- package/dist/src/core/shaders/templates/LinearGradientTemplate.js.map +0 -1
- package/dist/src/core/shaders/templates/RadialGradientTemplate.d.ts +0 -31
- package/dist/src/core/shaders/templates/RadialGradientTemplate.js +0 -49
- package/dist/src/core/shaders/templates/RadialGradientTemplate.js.map +0 -1
- package/dist/src/core/shaders/templates/RoundedTemplate.d.ts +0 -29
- package/dist/src/core/shaders/templates/RoundedTemplate.js +0 -67
- package/dist/src/core/shaders/templates/RoundedTemplate.js.map +0 -1
- package/dist/src/core/shaders/templates/RoundedWithBorderAndShadowTemplate.d.ts +0 -7
- package/dist/src/core/shaders/templates/RoundedWithBorderAndShadowTemplate.js +0 -24
- package/dist/src/core/shaders/templates/RoundedWithBorderAndShadowTemplate.js.map +0 -1
- package/dist/src/core/shaders/templates/RoundedWithBorderTemplate.d.ts +0 -6
- package/dist/src/core/shaders/templates/RoundedWithBorderTemplate.js +0 -23
- package/dist/src/core/shaders/templates/RoundedWithBorderTemplate.js.map +0 -1
- package/dist/src/core/shaders/templates/RoundedWithShadowTemplate.d.ts +0 -6
- package/dist/src/core/shaders/templates/RoundedWithShadowTemplate.js +0 -23
- package/dist/src/core/shaders/templates/RoundedWithShadowTemplate.js.map +0 -1
- package/dist/src/core/shaders/templates/ShadowTemplate.d.ts +0 -34
- package/dist/src/core/shaders/templates/ShadowTemplate.js +0 -66
- package/dist/src/core/shaders/templates/ShadowTemplate.js.map +0 -1
- package/dist/src/core/shaders/templates/shaderUtils.d.ts +0 -5
- package/dist/src/core/shaders/templates/shaderUtils.js +0 -41
- package/dist/src/core/shaders/templates/shaderUtils.js.map +0 -1
- package/dist/src/core/shaders/utils.d.ts +0 -5
- package/dist/src/core/shaders/utils.js +0 -41
- package/dist/src/core/shaders/utils.js.map +0 -1
- package/dist/src/core/shaders/webgl/Border.d.ts +0 -3
- package/dist/src/core/shaders/webgl/Border.js +0 -110
- package/dist/src/core/shaders/webgl/Border.js.map +0 -1
- package/dist/src/core/shaders/webgl/Default.d.ts +0 -2
- package/dist/src/core/shaders/webgl/Default.js +0 -86
- package/dist/src/core/shaders/webgl/Default.js.map +0 -1
- package/dist/src/core/shaders/webgl/DefaultBatched.d.ts +0 -2
- package/dist/src/core/shaders/webgl/DefaultBatched.js +0 -104
- package/dist/src/core/shaders/webgl/DefaultBatched.js.map +0 -1
- package/dist/src/core/shaders/webgl/HolePunch.d.ts +0 -3
- package/dist/src/core/shaders/webgl/HolePunch.js +0 -65
- package/dist/src/core/shaders/webgl/HolePunch.js.map +0 -1
- package/dist/src/core/shaders/webgl/LinearGradient.d.ts +0 -3
- package/dist/src/core/shaders/webgl/LinearGradient.js +0 -76
- package/dist/src/core/shaders/webgl/LinearGradient.js.map +0 -1
- package/dist/src/core/shaders/webgl/RadialGradient.d.ts +0 -3
- package/dist/src/core/shaders/webgl/RadialGradient.js +0 -74
- package/dist/src/core/shaders/webgl/RadialGradient.js.map +0 -1
- package/dist/src/core/shaders/webgl/Rounded.d.ts +0 -7
- package/dist/src/core/shaders/webgl/Rounded.js +0 -86
- package/dist/src/core/shaders/webgl/Rounded.js.map +0 -1
- package/dist/src/core/shaders/webgl/RoundedWithBorder.d.ts +0 -3
- package/dist/src/core/shaders/webgl/RoundedWithBorder.js +0 -140
- package/dist/src/core/shaders/webgl/RoundedWithBorder.js.map +0 -1
- package/dist/src/core/shaders/webgl/RoundedWithBorderAndShadow.d.ts +0 -3
- package/dist/src/core/shaders/webgl/RoundedWithBorderAndShadow.js +0 -162
- package/dist/src/core/shaders/webgl/RoundedWithBorderAndShadow.js.map +0 -1
- package/dist/src/core/shaders/webgl/RoundedWithShadow.d.ts +0 -3
- package/dist/src/core/shaders/webgl/RoundedWithShadow.js +0 -84
- package/dist/src/core/shaders/webgl/RoundedWithShadow.js.map +0 -1
- package/dist/src/core/shaders/webgl/SdfShader.d.ts +0 -32
- package/dist/src/core/shaders/webgl/SdfShader.js +0 -116
- package/dist/src/core/shaders/webgl/SdfShader.js.map +0 -1
- package/dist/src/core/shaders/webgl/Shadow.d.ts +0 -3
- package/dist/src/core/shaders/webgl/Shadow.js +0 -110
- package/dist/src/core/shaders/webgl/Shadow.js.map +0 -1
- package/dist/src/core/shaders/webgl/Spinner.d.ts +0 -1
- package/dist/src/core/shaders/webgl/Spinner.js +0 -2
- package/dist/src/core/shaders/webgl/Spinner.js.map +0 -1
- package/dist/src/core/text-rendering/CanvasFontHandler.d.ts +0 -25
- package/dist/src/core/text-rendering/CanvasFontHandler.js +0 -117
- package/dist/src/core/text-rendering/CanvasFontHandler.js.map +0 -1
- package/dist/src/core/text-rendering/CanvasTextRenderer.d.ts +0 -6
- package/dist/src/core/text-rendering/CanvasTextRenderer.js +0 -139
- package/dist/src/core/text-rendering/CanvasTextRenderer.js.map +0 -1
- package/dist/src/core/text-rendering/SdfFontHandler.d.ts +0 -137
- package/dist/src/core/text-rendering/SdfFontHandler.js +0 -336
- package/dist/src/core/text-rendering/SdfFontHandler.js.map +0 -1
- package/dist/src/core/text-rendering/SdfTextRenderer.d.ts +0 -21
- package/dist/src/core/text-rendering/SdfTextRenderer.js +0 -324
- package/dist/src/core/text-rendering/SdfTextRenderer.js.map +0 -1
- package/dist/src/core/text-rendering/TextRenderer.d.ts +0 -425
- package/dist/src/core/text-rendering/TextRenderer.js +0 -70
- package/dist/src/core/text-rendering/TextRenderer.js.map +0 -1
- package/dist/src/core/text-rendering/Utils.d.ts +0 -71
- package/dist/src/core/text-rendering/Utils.js +0 -212
- package/dist/src/core/text-rendering/Utils.js.map +0 -1
- package/dist/src/core/text-rendering/canvas/Settings.d.ts +0 -53
- package/dist/src/core/text-rendering/canvas/Settings.js +0 -20
- package/dist/src/core/text-rendering/canvas/Settings.js.map +0 -1
- package/dist/src/core/text-rendering/canvas/Utils.d.ts +0 -19
- package/dist/src/core/text-rendering/canvas/Utils.js +0 -139
- package/dist/src/core/text-rendering/canvas/Utils.js.map +0 -1
- package/dist/src/core/text-rendering/canvas/calculateRenderInfo.d.ts +0 -37
- package/dist/src/core/text-rendering/canvas/calculateRenderInfo.js +0 -188
- package/dist/src/core/text-rendering/canvas/calculateRenderInfo.js.map +0 -1
- package/dist/src/core/text-rendering/canvas/draw.d.ts +0 -12
- package/dist/src/core/text-rendering/canvas/draw.js +0 -133
- package/dist/src/core/text-rendering/canvas/draw.js.map +0 -1
- package/dist/src/core/text-rendering/sdf/PeekableGenerator.d.ts +0 -12
- package/dist/src/core/text-rendering/sdf/PeekableGenerator.js +0 -61
- package/dist/src/core/text-rendering/sdf/PeekableGenerator.js.map +0 -1
- package/dist/src/core/text-rendering/sdf/SimpleFontShaper.d.ts +0 -45
- package/dist/src/core/text-rendering/sdf/SimpleFontShaper.js +0 -69
- package/dist/src/core/text-rendering/sdf/SimpleFontShaper.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SdfTextRenderer.js","sourceRoot":"","sources":["../../../../src/core/text-rendering/SdfTextRenderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,aAAa,EAAwD,MAAM,mBAAmB,CAAC;AACxG,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,GAAG,EAAuB,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iDAAiD,CAAC;AAGnF,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjD,+EAA+E;AAC/E,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,kBAAkB,GAAG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CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,6BAA6B;QAC9F,SAAS,EAAE,UAAU;QACrB,UAAU;QACV,UAAU;KACX,CAAC;AACJ,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,eAAe,GAAG;IACtB,IAAI;IACJ,IAAI;IACJ,UAAU;IACV,QAAQ;IACR,WAAW;IACX,IAAI;CACL,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,425 +0,0 @@
|
|
|
1
|
-
import type { CoreRenderer } from '../renderers/CoreRenderer.js';
|
|
2
|
-
import type { Stage } from '../Stage.js';
|
|
3
|
-
export declare enum TextBaseline {
|
|
4
|
-
alphabetic = 0,
|
|
5
|
-
hanging = 1,
|
|
6
|
-
middle = 2,
|
|
7
|
-
ideographic = 3,
|
|
8
|
-
bottom = 4
|
|
9
|
-
}
|
|
10
|
-
export type TextBaselineType = keyof typeof TextBaseline;
|
|
11
|
-
export declare const TextBaselineValueToKey: Record<TextBaseline, "alphabetic" | "hanging" | "middle" | "ideographic" | "bottom">;
|
|
12
|
-
export declare enum TextAlign {
|
|
13
|
-
left = 0,
|
|
14
|
-
center = 1,
|
|
15
|
-
right = 2
|
|
16
|
-
}
|
|
17
|
-
export type TextAlignType = keyof typeof TextAlign;
|
|
18
|
-
export declare const TextAlignValueToKey: Record<TextAlign, "left" | "center" | "right">;
|
|
19
|
-
export declare enum TextFontStyle {
|
|
20
|
-
normal = 0,
|
|
21
|
-
italic = 1,
|
|
22
|
-
oblique = 2
|
|
23
|
-
}
|
|
24
|
-
export type TextFontStyleType = keyof typeof TextFontStyle;
|
|
25
|
-
export declare const TextFontStyleValueToKey: Record<TextFontStyle, "normal" | "italic" | "oblique">;
|
|
26
|
-
export declare enum TextVerticalAlign {
|
|
27
|
-
top = 0,
|
|
28
|
-
middle = 1,
|
|
29
|
-
bottom = 2
|
|
30
|
-
}
|
|
31
|
-
export type TextVerticalAlignType = keyof typeof TextVerticalAlign;
|
|
32
|
-
export declare const TextVerticalAlignValueToKey: Record<TextVerticalAlign, "middle" | "bottom" | "top">;
|
|
33
|
-
export declare enum TextContain {
|
|
34
|
-
none = 0,
|
|
35
|
-
width = 1,
|
|
36
|
-
both = 2
|
|
37
|
-
}
|
|
38
|
-
export type TextContainType = keyof typeof TextContain;
|
|
39
|
-
export declare const TextContainValueToKey: Record<TextContain, "width" | "none" | "both">;
|
|
40
|
-
export declare enum TextWordBreak {
|
|
41
|
-
normal = 0,
|
|
42
|
-
'break-all' = 1,
|
|
43
|
-
'break-word' = 2
|
|
44
|
-
}
|
|
45
|
-
export type TextWordBreakType = keyof typeof TextWordBreak;
|
|
46
|
-
export declare const TextWordBreakValueToKey: Record<TextWordBreak, "normal" | "break-all" | "break-word">;
|
|
47
|
-
export declare enum TextRenderers {
|
|
48
|
-
canvas = 0,
|
|
49
|
-
sdf = 1
|
|
50
|
-
}
|
|
51
|
-
export type TextRendererType = keyof typeof TextRenderers;
|
|
52
|
-
export declare const TextRendererValueToKey: Record<TextRenderers, "canvas" | "sdf">;
|
|
53
|
-
/**
|
|
54
|
-
* Structure mapping font family names to a set of font faces.
|
|
55
|
-
*/
|
|
56
|
-
export interface FontFamilyMap {
|
|
57
|
-
[familyName: string]: FontFace;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Font metrics used for layout and default line height calculations.
|
|
61
|
-
*/
|
|
62
|
-
export interface FontMetrics {
|
|
63
|
-
/**
|
|
64
|
-
* The distance, in font units, from the baseline to the highest point of the font.
|
|
65
|
-
*/
|
|
66
|
-
ascender: number;
|
|
67
|
-
/**
|
|
68
|
-
* The distance, in font units, from the baseline to the lowest point of the font.
|
|
69
|
-
*/
|
|
70
|
-
descender: number;
|
|
71
|
-
/**
|
|
72
|
-
* The additional space used in the calculation of the default line height in font units.
|
|
73
|
-
*/
|
|
74
|
-
lineGap: number;
|
|
75
|
-
/**
|
|
76
|
-
* The number of font units per 1 EM.
|
|
77
|
-
*/
|
|
78
|
-
unitsPerEm: number;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Normalized font metrics where values are expressed as a fraction of 1 EM.
|
|
82
|
-
*/
|
|
83
|
-
export interface NormalizedFontMetrics {
|
|
84
|
-
/**
|
|
85
|
-
* The distance, as a fraction of 1 EM, from the baseline to the highest point of the font.
|
|
86
|
-
*/
|
|
87
|
-
ascender: number;
|
|
88
|
-
/**
|
|
89
|
-
* The distance, as a fraction of 1 EM, from the baseline to the lowest point of the font.
|
|
90
|
-
*/
|
|
91
|
-
descender: number;
|
|
92
|
-
/**
|
|
93
|
-
* The additional space used in the calculation of the default line height as a fraction of 1 EM
|
|
94
|
-
*/
|
|
95
|
-
lineGap: number;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Text renderer properties that are used in resolving appropriate font faces
|
|
99
|
-
*
|
|
100
|
-
* @remarks
|
|
101
|
-
* Extended by {@link TrProps}
|
|
102
|
-
*/
|
|
103
|
-
export interface TrFontProps {
|
|
104
|
-
/**
|
|
105
|
-
* Font Family
|
|
106
|
-
*
|
|
107
|
-
* @internalRemarks
|
|
108
|
-
* `fontFamily` is defined currently as single string, but in the future we may want to
|
|
109
|
-
* support multiple font family fallbacks, as this is supported by CSS / Canvas2d. We can
|
|
110
|
-
* do this in a backwards compatible way by unioning an array of strings to the
|
|
111
|
-
* `fontFamily` property.
|
|
112
|
-
*/
|
|
113
|
-
fontFamily: string;
|
|
114
|
-
/**
|
|
115
|
-
* Font Style
|
|
116
|
-
*
|
|
117
|
-
* @remarks
|
|
118
|
-
* The font style to use when looking up the font face. This can be one of the
|
|
119
|
-
* following strings:
|
|
120
|
-
* - `'normal'`
|
|
121
|
-
* - `'italic'`
|
|
122
|
-
* - `'oblique'`
|
|
123
|
-
*/
|
|
124
|
-
fontStyle: TextFontStyleType;
|
|
125
|
-
/**
|
|
126
|
-
* Font Size
|
|
127
|
-
*
|
|
128
|
-
* @remarks
|
|
129
|
-
* The font size to use when looking up the font face.
|
|
130
|
-
*
|
|
131
|
-
* The font size is specified in pixels and is the height of the font's
|
|
132
|
-
* em-square. The em-square is essentially the height of the capital letters
|
|
133
|
-
* for the font. The actual height of the text can be larger than the
|
|
134
|
-
* specified font size, as the font may have ascenders and descenders that
|
|
135
|
-
* extend beyond the em-square.
|
|
136
|
-
*
|
|
137
|
-
* @default 16
|
|
138
|
-
*/
|
|
139
|
-
fontSize: number;
|
|
140
|
-
}
|
|
141
|
-
export interface TrProps extends TrFontProps {
|
|
142
|
-
/**
|
|
143
|
-
* Text to display
|
|
144
|
-
*
|
|
145
|
-
* @default ''
|
|
146
|
-
*/
|
|
147
|
-
text: string;
|
|
148
|
-
/**
|
|
149
|
-
* Text alignment
|
|
150
|
-
*
|
|
151
|
-
* @remarks
|
|
152
|
-
* Alignment of the text relative to it's contained bounds. For best results,
|
|
153
|
-
* use {@link contain} mode `'width'` or `'both'` and a set an explicit
|
|
154
|
-
* {@link width} for the text to be aligned within.
|
|
155
|
-
*
|
|
156
|
-
* @default 'left'
|
|
157
|
-
*/
|
|
158
|
-
textAlign: TextAlignType;
|
|
159
|
-
/**
|
|
160
|
-
* Color of text
|
|
161
|
-
*
|
|
162
|
-
* @remarks
|
|
163
|
-
* The color value is a number in the format 0xRRGGBBAA, where RR is the red
|
|
164
|
-
* component, GG is the green component, BB is the blue component, and AA is
|
|
165
|
-
* the alpha component.
|
|
166
|
-
*
|
|
167
|
-
* @default 0xffffffff (opaque white)
|
|
168
|
-
*/
|
|
169
|
-
color: number;
|
|
170
|
-
x: number;
|
|
171
|
-
y: number;
|
|
172
|
-
/**
|
|
173
|
-
* Contain mode for text
|
|
174
|
-
*
|
|
175
|
-
* @remarks
|
|
176
|
-
* The contain mode determines how the text is contained within the bounds
|
|
177
|
-
* of the Text Node. The default value is `'none'`, which means that the
|
|
178
|
-
* Text Renderer will not constrain the text in any way. `'width'` mode will
|
|
179
|
-
* constrain the text to the set width wrapping lines as necessary, and
|
|
180
|
-
* `'both'` mode will constrain the text to both the set width and height
|
|
181
|
-
* wrapping lines and truncating text as necessary.
|
|
182
|
-
*
|
|
183
|
-
* ## Text Auto-size Behavior
|
|
184
|
-
* Depending on the set contain mode, after the text 'loaded' event is emitted,
|
|
185
|
-
* the text node may have either its {@link width} and {@link height} updated
|
|
186
|
-
* to match the rendered size of the text.
|
|
187
|
-
*
|
|
188
|
-
* When contain mode is 'none', both the {@link width} and {@link height}
|
|
189
|
-
* properties are updated.
|
|
190
|
-
*
|
|
191
|
-
* When contain mode is 'width', only the {@link height} property is updated.
|
|
192
|
-
*
|
|
193
|
-
* When contain mode is 'both', neither property is updated.
|
|
194
|
-
*
|
|
195
|
-
* @default 'none'
|
|
196
|
-
*/
|
|
197
|
-
contain: TextContainType;
|
|
198
|
-
width: number;
|
|
199
|
-
height: number;
|
|
200
|
-
/**
|
|
201
|
-
* Vertical offset for text
|
|
202
|
-
*
|
|
203
|
-
* @remarks
|
|
204
|
-
* The vertical offset of the text.
|
|
205
|
-
*
|
|
206
|
-
* @default 0
|
|
207
|
-
*/
|
|
208
|
-
offsetY: number;
|
|
209
|
-
/**
|
|
210
|
-
* Letter spacing for text (in pixels)
|
|
211
|
-
*
|
|
212
|
-
* @remarks
|
|
213
|
-
* This property sets additional (or reduced, if value is negative) spacing
|
|
214
|
-
* between characters in the text.
|
|
215
|
-
*
|
|
216
|
-
* @default 0
|
|
217
|
-
*/
|
|
218
|
-
letterSpacing: number;
|
|
219
|
-
/**
|
|
220
|
-
* Line height for text (in pixels)
|
|
221
|
-
*
|
|
222
|
-
* @remarks
|
|
223
|
-
* This property sets the height of each line. If set to `undefined`, the
|
|
224
|
-
* line height will be calculated based on the font and font size to be the
|
|
225
|
-
* minimal height required to completely contain a line of text.
|
|
226
|
-
*
|
|
227
|
-
* See: https://github.com/lightning-js/renderer/issues/170
|
|
228
|
-
*
|
|
229
|
-
* @default `undefined`
|
|
230
|
-
*/
|
|
231
|
-
lineHeight: number | undefined;
|
|
232
|
-
/**
|
|
233
|
-
* Max lines for text
|
|
234
|
-
*
|
|
235
|
-
* @remarks
|
|
236
|
-
* This property sets max number of lines of a text paragraph.
|
|
237
|
-
* Not yet implemented in the SDF renderer.
|
|
238
|
-
*
|
|
239
|
-
* @default 0
|
|
240
|
-
*/
|
|
241
|
-
maxLines: number;
|
|
242
|
-
/**
|
|
243
|
-
* Baseline for text
|
|
244
|
-
*
|
|
245
|
-
* @remarks
|
|
246
|
-
* This property sets the text baseline used when drawing text.
|
|
247
|
-
* Not yet implemented in the SDF renderer.
|
|
248
|
-
*
|
|
249
|
-
* @default alphabetic
|
|
250
|
-
*/
|
|
251
|
-
textBaseline: TextBaselineType;
|
|
252
|
-
/**
|
|
253
|
-
* Vertical Align for text when lineHeight > fontSize
|
|
254
|
-
*
|
|
255
|
-
* @remarks
|
|
256
|
-
* This property sets the vertical align of the text.
|
|
257
|
-
* Not yet implemented in the SDF renderer.
|
|
258
|
-
*
|
|
259
|
-
* @default middle
|
|
260
|
-
*/
|
|
261
|
-
verticalAlign: TextVerticalAlignType;
|
|
262
|
-
/**
|
|
263
|
-
* Overflow Suffix for text
|
|
264
|
-
*
|
|
265
|
-
* @remarks
|
|
266
|
-
* The suffix to be added when text is cropped due to overflow.
|
|
267
|
-
* Not yet implemented in the SDF renderer.
|
|
268
|
-
*
|
|
269
|
-
* @default "..."
|
|
270
|
-
*/
|
|
271
|
-
overflowSuffix: string;
|
|
272
|
-
/**
|
|
273
|
-
* Word Break for text
|
|
274
|
-
*
|
|
275
|
-
* @remarks
|
|
276
|
-
* This property sets how words should break when reaching the end of a line.
|
|
277
|
-
*
|
|
278
|
-
* - `'normal'`: Use the default line break rule.
|
|
279
|
-
* - `'break-all'`: To prevent overflow, word breaks should happen between any two characters.
|
|
280
|
-
* - `'break-word'`: To prevent overflow, word breaks should happen between words. If words are too long word breaks happen between any two characters.
|
|
281
|
-
*
|
|
282
|
-
* @default "normal"
|
|
283
|
-
*/
|
|
284
|
-
wordBreak: TextWordBreakType;
|
|
285
|
-
zIndex: number;
|
|
286
|
-
}
|
|
287
|
-
/**
|
|
288
|
-
* Glyph layout information for WebGL rendering
|
|
289
|
-
*/
|
|
290
|
-
export interface GlyphLayout {
|
|
291
|
-
/**
|
|
292
|
-
* Unicode codepoint
|
|
293
|
-
*/
|
|
294
|
-
codepoint: number;
|
|
295
|
-
/**
|
|
296
|
-
* Glyph ID in the font atlas
|
|
297
|
-
*/
|
|
298
|
-
glyphId: number;
|
|
299
|
-
/**
|
|
300
|
-
* X position relative to text origin
|
|
301
|
-
*/
|
|
302
|
-
x: number;
|
|
303
|
-
/**
|
|
304
|
-
* Y position relative to text origin
|
|
305
|
-
*/
|
|
306
|
-
y: number;
|
|
307
|
-
/**
|
|
308
|
-
* Width of glyph in font units
|
|
309
|
-
*/
|
|
310
|
-
width: number;
|
|
311
|
-
/**
|
|
312
|
-
* Height of glyph in font units
|
|
313
|
-
*/
|
|
314
|
-
height: number;
|
|
315
|
-
/**
|
|
316
|
-
* X offset for glyph positioning
|
|
317
|
-
*/
|
|
318
|
-
xOffset: number;
|
|
319
|
-
/**
|
|
320
|
-
* Y offset for glyph positioning
|
|
321
|
-
*/
|
|
322
|
-
yOffset: number;
|
|
323
|
-
/**
|
|
324
|
-
* Atlas texture coordinates (normalized 0-1)
|
|
325
|
-
*/
|
|
326
|
-
atlasX: number;
|
|
327
|
-
atlasY: number;
|
|
328
|
-
atlasWidth: number;
|
|
329
|
-
atlasHeight: number;
|
|
330
|
-
}
|
|
331
|
-
/**
|
|
332
|
-
* Complete text layout information for caching
|
|
333
|
-
*/
|
|
334
|
-
export interface TextLayout {
|
|
335
|
-
/**
|
|
336
|
-
* Individual glyph layouts
|
|
337
|
-
*/
|
|
338
|
-
glyphs: GlyphLayout[];
|
|
339
|
-
/**
|
|
340
|
-
* Total text width
|
|
341
|
-
*/
|
|
342
|
-
width: number;
|
|
343
|
-
/**
|
|
344
|
-
* Total text height
|
|
345
|
-
*/
|
|
346
|
-
height: number;
|
|
347
|
-
/**
|
|
348
|
-
* Font scale factor
|
|
349
|
-
*/
|
|
350
|
-
fontScale: number;
|
|
351
|
-
/**
|
|
352
|
-
* Line height
|
|
353
|
-
*/
|
|
354
|
-
lineHeight: number;
|
|
355
|
-
/**
|
|
356
|
-
* Font family used
|
|
357
|
-
*/
|
|
358
|
-
fontFamily: string;
|
|
359
|
-
}
|
|
360
|
-
export interface FontLoadOptions {
|
|
361
|
-
fontFamily: string;
|
|
362
|
-
metrics?: FontMetrics;
|
|
363
|
-
fontUrl?: string;
|
|
364
|
-
atlasUrl?: string;
|
|
365
|
-
atlasDataUrl?: string;
|
|
366
|
-
}
|
|
367
|
-
export interface FontHandler {
|
|
368
|
-
init: () => void;
|
|
369
|
-
type: TextRenderers;
|
|
370
|
-
isFontLoaded: (fontFamily: string) => boolean;
|
|
371
|
-
loadFont: (stage: Stage, options: FontLoadOptions) => Promise<void>;
|
|
372
|
-
getFontFamilies: () => FontFamilyMap;
|
|
373
|
-
canRenderFont: (trProps: TrProps) => boolean;
|
|
374
|
-
getFontMetrics: (fontFamily: string, trProps: TrProps) => NormalizedFontMetrics | null;
|
|
375
|
-
setFontMetrics: (fontFamily: string, metrics: NormalizedFontMetrics) => void;
|
|
376
|
-
}
|
|
377
|
-
export interface TextRenderProps {
|
|
378
|
-
fontFamily: string;
|
|
379
|
-
fontSize: number;
|
|
380
|
-
color: number;
|
|
381
|
-
offsetY: number;
|
|
382
|
-
worldAlpha: number;
|
|
383
|
-
globalTransform: Float32Array;
|
|
384
|
-
clippingRect: unknown;
|
|
385
|
-
width: number;
|
|
386
|
-
height: number;
|
|
387
|
-
parentHasRenderTexture: boolean;
|
|
388
|
-
framebufferDimensions: unknown;
|
|
389
|
-
stage: Stage;
|
|
390
|
-
}
|
|
391
|
-
export interface TextRenderPropsNormalized {
|
|
392
|
-
x: number;
|
|
393
|
-
y: number;
|
|
394
|
-
zIndex: number;
|
|
395
|
-
text: string;
|
|
396
|
-
fontFamily: string;
|
|
397
|
-
fontSize: number;
|
|
398
|
-
fontStyle: TextFontStyle;
|
|
399
|
-
textAlign: TextAlign;
|
|
400
|
-
contain: TextContain;
|
|
401
|
-
letterSpacing: number;
|
|
402
|
-
lineHeight: number | undefined;
|
|
403
|
-
maxLines: number;
|
|
404
|
-
textBaseline: TextBaseline;
|
|
405
|
-
verticalAlign: TextVerticalAlign;
|
|
406
|
-
color: number;
|
|
407
|
-
offsetY: number;
|
|
408
|
-
width: number;
|
|
409
|
-
height: number;
|
|
410
|
-
overflowSuffix: string;
|
|
411
|
-
wordBreak: TextWordBreak;
|
|
412
|
-
}
|
|
413
|
-
export interface TextRenderer {
|
|
414
|
-
type: TextRenderers;
|
|
415
|
-
font: FontHandler;
|
|
416
|
-
renderText: (stage: Stage, props: TextRenderPropsNormalized) => {
|
|
417
|
-
imageData: ImageData | null;
|
|
418
|
-
width: number;
|
|
419
|
-
height: number;
|
|
420
|
-
layout?: TextLayout;
|
|
421
|
-
};
|
|
422
|
-
addQuads: (layout?: TextLayout) => Float32Array | null;
|
|
423
|
-
renderQuads: (renderer: CoreRenderer, layout: TextLayout, vertexBuffer: Float32Array, renderProps: TextRenderProps) => void;
|
|
424
|
-
init: (stage: Stage) => void;
|
|
425
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* If not stated otherwise in this file or this component's LICENSE file the
|
|
3
|
-
* following copyright and licenses apply:
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2023 Comcast Cable Communications Management, LLC.
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the License);
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
import { createEnumReverseMap } from '../../utils.js';
|
|
20
|
-
export var TextBaseline;
|
|
21
|
-
(function (TextBaseline) {
|
|
22
|
-
TextBaseline[TextBaseline["alphabetic"] = 0] = "alphabetic";
|
|
23
|
-
TextBaseline[TextBaseline["hanging"] = 1] = "hanging";
|
|
24
|
-
TextBaseline[TextBaseline["middle"] = 2] = "middle";
|
|
25
|
-
TextBaseline[TextBaseline["ideographic"] = 3] = "ideographic";
|
|
26
|
-
TextBaseline[TextBaseline["bottom"] = 4] = "bottom";
|
|
27
|
-
})(TextBaseline || (TextBaseline = {}));
|
|
28
|
-
export const TextBaselineValueToKey = createEnumReverseMap(TextBaseline);
|
|
29
|
-
export var TextAlign;
|
|
30
|
-
(function (TextAlign) {
|
|
31
|
-
TextAlign[TextAlign["left"] = 0] = "left";
|
|
32
|
-
TextAlign[TextAlign["center"] = 1] = "center";
|
|
33
|
-
TextAlign[TextAlign["right"] = 2] = "right";
|
|
34
|
-
})(TextAlign || (TextAlign = {}));
|
|
35
|
-
export const TextAlignValueToKey = createEnumReverseMap(TextAlign);
|
|
36
|
-
export var TextFontStyle;
|
|
37
|
-
(function (TextFontStyle) {
|
|
38
|
-
TextFontStyle[TextFontStyle["normal"] = 0] = "normal";
|
|
39
|
-
TextFontStyle[TextFontStyle["italic"] = 1] = "italic";
|
|
40
|
-
TextFontStyle[TextFontStyle["oblique"] = 2] = "oblique";
|
|
41
|
-
})(TextFontStyle || (TextFontStyle = {}));
|
|
42
|
-
export const TextFontStyleValueToKey = createEnumReverseMap(TextFontStyle);
|
|
43
|
-
export var TextVerticalAlign;
|
|
44
|
-
(function (TextVerticalAlign) {
|
|
45
|
-
TextVerticalAlign[TextVerticalAlign["top"] = 0] = "top";
|
|
46
|
-
TextVerticalAlign[TextVerticalAlign["middle"] = 1] = "middle";
|
|
47
|
-
TextVerticalAlign[TextVerticalAlign["bottom"] = 2] = "bottom";
|
|
48
|
-
})(TextVerticalAlign || (TextVerticalAlign = {}));
|
|
49
|
-
export const TextVerticalAlignValueToKey = createEnumReverseMap(TextVerticalAlign);
|
|
50
|
-
export var TextContain;
|
|
51
|
-
(function (TextContain) {
|
|
52
|
-
TextContain[TextContain["none"] = 0] = "none";
|
|
53
|
-
TextContain[TextContain["width"] = 1] = "width";
|
|
54
|
-
TextContain[TextContain["both"] = 2] = "both";
|
|
55
|
-
})(TextContain || (TextContain = {}));
|
|
56
|
-
export const TextContainValueToKey = createEnumReverseMap(TextContain);
|
|
57
|
-
export var TextWordBreak;
|
|
58
|
-
(function (TextWordBreak) {
|
|
59
|
-
TextWordBreak[TextWordBreak["normal"] = 0] = "normal";
|
|
60
|
-
TextWordBreak[TextWordBreak["break-all"] = 1] = "break-all";
|
|
61
|
-
TextWordBreak[TextWordBreak["break-word"] = 2] = "break-word";
|
|
62
|
-
})(TextWordBreak || (TextWordBreak = {}));
|
|
63
|
-
export const TextWordBreakValueToKey = createEnumReverseMap(TextWordBreak);
|
|
64
|
-
export var TextRenderers;
|
|
65
|
-
(function (TextRenderers) {
|
|
66
|
-
TextRenderers[TextRenderers["canvas"] = 0] = "canvas";
|
|
67
|
-
TextRenderers[TextRenderers["sdf"] = 1] = "sdf";
|
|
68
|
-
})(TextRenderers || (TextRenderers = {}));
|
|
69
|
-
export const TextRendererValueToKey = createEnumReverseMap(TextRenderers);
|
|
70
|
-
//# sourceMappingURL=TextRenderer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TextRenderer.js","sourceRoot":"","sources":["../../../../src/core/text-rendering/TextRenderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAItD,MAAM,CAAN,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,2DAAU,CAAA;IACV,qDAAO,CAAA;IACP,mDAAM,CAAA;IACN,6DAAW,CAAA;IAC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3E,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,qDAAM,CAAA;IACN,+CAAG,CAAA;AACL,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAGD,MAAM,CAAC,MAAM,sBAAsB,GAAG,oBAAoB,CAAC,aAAa,CAAC,CAAC"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { NormalizedFontMetrics } from './TextRenderer.js';
|
|
2
|
-
/**
|
|
3
|
-
* Returns CSS font setting string for use in canvas context.
|
|
4
|
-
*
|
|
5
|
-
* @param fontFace
|
|
6
|
-
* @param fontStyle
|
|
7
|
-
* @param fontSize
|
|
8
|
-
* @param precision
|
|
9
|
-
* @param defaultFontFace
|
|
10
|
-
* @returns
|
|
11
|
-
*/
|
|
12
|
-
export declare function getFontSetting(fontFace: string | string[], fontStyle: string, fontSize: number, precision: number, defaultFontFace: string): string;
|
|
13
|
-
/**
|
|
14
|
-
* Returns true if the given character is a zero-width space.
|
|
15
|
-
*
|
|
16
|
-
* @param space
|
|
17
|
-
*/
|
|
18
|
-
export declare function isZeroWidthSpace(space: string): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Returns true if the given character is a zero-width space or a regular space.
|
|
21
|
-
*
|
|
22
|
-
* @param space
|
|
23
|
-
*/
|
|
24
|
-
export declare function isSpace(space: string): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Converts a string into an array of tokens and the words between them.
|
|
27
|
-
*
|
|
28
|
-
* @param tokenRegex
|
|
29
|
-
* @param text
|
|
30
|
-
*/
|
|
31
|
-
export declare function tokenizeString(tokenRegex: RegExp, text: string): string[];
|
|
32
|
-
/**
|
|
33
|
-
* Measure the width of a string accounting for letter spacing.
|
|
34
|
-
*
|
|
35
|
-
* @param context
|
|
36
|
-
* @param word
|
|
37
|
-
* @param space
|
|
38
|
-
*/
|
|
39
|
-
export declare function measureText(context: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, word: string, space?: number): number;
|
|
40
|
-
/**
|
|
41
|
-
* Get the font metrics for a font face.
|
|
42
|
-
*
|
|
43
|
-
* @remarks
|
|
44
|
-
* This function will attempt to grab the explicitly defined metrics from the
|
|
45
|
-
* font face first. If the font face does not have metrics defined, it will
|
|
46
|
-
* attempt to calculate the metrics using the browser's measureText method.
|
|
47
|
-
*
|
|
48
|
-
* If the browser does not support the font metrics API, it will use some
|
|
49
|
-
* default values.
|
|
50
|
-
*
|
|
51
|
-
* @param context
|
|
52
|
-
* @param fontFace
|
|
53
|
-
* @param fontSize
|
|
54
|
-
* @returns
|
|
55
|
-
*/
|
|
56
|
-
export declare function calculateFontMetrics(context: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, fontFamily: string, fontSize: number): NormalizedFontMetrics;
|
|
57
|
-
export interface WrapTextResult {
|
|
58
|
-
l: string[];
|
|
59
|
-
n: number[];
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Applies newlines to a string to have it optimally fit into the horizontal
|
|
63
|
-
* bounds set by the Text object's wordWrapWidth property.
|
|
64
|
-
*
|
|
65
|
-
* @param context
|
|
66
|
-
* @param text
|
|
67
|
-
* @param wordWrapWidth
|
|
68
|
-
* @param letterSpacing
|
|
69
|
-
* @param indent
|
|
70
|
-
*/
|
|
71
|
-
export declare function wrapText(context: CanvasRenderingContext2D, text: string, wordWrapWidth: number, letterSpacing: number, indent: number): WrapTextResult;
|