three-base 2.0.137 → 2.0.145
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/DirectionalLight.d.ts +2 -2
- package/DirectionalLight.js +1 -1
- package/DirectionalLight.ts +70 -0
- package/EventMap.d.ts +103 -0
- package/EventMap.js +17 -0
- package/EventMap.ts +139 -0
- package/EventMesh.ts +60 -0
- package/ExtrudeMesh.js +1 -25
- package/ExtrudeMesh.ts +553 -0
- package/FPScontrol.d.ts +448 -15
- package/FPScontrol.js +1448 -266
- package/FPScontrol.ts +1855 -0
- package/Fire/Fire.d.ts +4 -4
- package/Fire/Fire.js +8 -7
- package/Fire/Fire.ts +89 -0
- package/Fire/{FireGromtry.d.ts → FireGeometry.d.ts} +2 -2
- package/Fire/{FireGromtry.js → FireGeometry.js} +1 -1
- package/Fire/FireGeometry.ts +40 -0
- package/Fire/FireMaterial.d.ts +3 -3
- package/Fire/FireMaterial.js +1 -1
- package/Fire/FireMaterial.ts +89 -0
- package/Fire/index.d.ts +1 -0
- package/Fire/index.js +1 -0
- package/Fire/index.ts +2 -0
- package/GLTFDracoLoader.d.ts +71 -0
- package/GLTFDracoLoader.js +266 -0
- package/GLTFDracoLoader.ts +430 -0
- package/Grass/Grass.d.ts +2 -2
- package/Grass/Grass.ts +38 -0
- package/Grass/index.d.ts +1 -0
- package/Grass/index.js +1 -0
- package/Grass/index.ts +2 -0
- package/Ground1/Ground1.d.ts +2 -3
- package/Ground1/Ground1.js +64 -60
- package/Ground1/Ground1.ts +114 -0
- package/Ground1/index.ts +1 -0
- package/MeshBase.d.ts +1 -0
- package/MeshBase.js +37 -13
- package/MeshBase.ts +253 -0
- package/Mirror.d.ts +3 -3
- package/Mirror.js +7 -3
- package/Mirror.ts +203 -0
- package/MktMesh/MktMesh.d.ts +301 -0
- package/MktMesh/MktMesh.js +1064 -0
- package/MktMesh/MktMesh.ts +1096 -0
- package/MktMesh/assetUrl.d.ts +59 -0
- package/MktMesh/assetUrl.js +154 -0
- package/MktMesh/assetUrl.ts +155 -0
- package/MktMesh/mktMappingShader.d.ts +12 -0
- package/MktMesh/mktMappingShader.js +139 -0
- package/MktMesh/mktMappingShader.ts +139 -0
- package/MktMesh/mktShader.d.ts +263 -0
- package/MktMesh/mktShader.js +1248 -0
- package/MktMesh/mktShader.ts +1344 -0
- package/MktMesh/panoBitmapTexture.d.ts +25 -0
- package/MktMesh/panoBitmapTexture.js +52 -0
- package/MktMesh/panoBitmapTexture.ts +54 -0
- package/MktMesh/panoSlotBind.d.ts +29 -0
- package/MktMesh/panoSlotBind.js +106 -0
- package/MktMesh/panoSlotBind.ts +153 -0
- package/MktMesh/panoSlotRoster.d.ts +22 -0
- package/MktMesh/panoSlotRoster.js +169 -0
- package/MktMesh/panoSlotRoster.ts +168 -0
- package/MktMesh/panoTileStitcher.d.ts +119 -0
- package/MktMesh/panoTileStitcher.js +533 -0
- package/MktMesh/panoTileStitcher.ts +616 -0
- package/MktMesh/types.d.ts +75 -0
- package/MktMesh/types.js +1 -0
- package/MktMesh/types.ts +87 -0
- package/MktMesh/wallCapTessellate.d.ts +33 -0
- package/MktMesh/wallCapTessellate.js +97 -0
- package/MktMesh/wallCapTessellate.ts +68 -0
- package/PipeMesh/PathGeometry.js +9 -2
- package/PipeMesh/PathGeometry.ts +343 -0
- package/PipeMesh/PathPoint.ts +36 -0
- package/PipeMesh/PathPointList.js +1 -0
- package/PipeMesh/PathPointList.ts +227 -0
- package/PipeMesh/PathTubeGeometry.ts +146 -0
- package/PipeMesh/PipeMesh.d.ts +1 -1
- package/PipeMesh/PipeMesh.js +1 -1
- package/PipeMesh/PipeMesh.ts +76 -0
- package/PipeMesh/index.ts +1 -0
- package/PlaneModal1/PlaneModal1.d.ts +16 -13
- package/PlaneModal1/PlaneModal1.js +4 -0
- package/PlaneModal1/PlaneModal1.ts +138 -0
- package/PlaneModal1/index.ts +1 -0
- package/PlaneText.d.ts +2 -14
- package/PlaneText.js +7 -2
- package/PlaneText.ts +55 -0
- package/PlaneWithHtml.d.ts +4 -2
- package/PlaneWithHtml.js +2 -1
- package/PlaneWithHtml.ts +70 -0
- package/PointLight/PointLight.d.ts +3 -4
- package/PointLight/PointLight.js +1 -7
- package/PointLight/PointLight.ts +67 -0
- package/PointLight/index.ts +1 -0
- package/README.md +110 -79
- package/Sky/Sky.ts +22 -0
- package/Sky/index.ts +1 -0
- package/SpotLight.d.ts +2 -2
- package/SpotLight.js +1 -1
- package/SpotLight.ts +74 -0
- package/SpriteModal1/SpriteModal1.d.ts +16 -13
- package/SpriteModal1/SpriteModal1.js +8 -2
- package/SpriteModal1/SpriteModal1.ts +146 -0
- package/SpriteModal1/index.ts +1 -0
- package/SpriteText.d.ts +14 -13
- package/SpriteText.js +22 -9
- package/SpriteText.ts +205 -0
- package/SpriteText2.d.ts +9 -8
- package/SpriteText2.js +57 -32
- package/SpriteText2.ts +258 -0
- package/SpriteText3.d.ts +86 -0
- package/SpriteText3.js +519 -0
- package/SpriteText3.ts +599 -0
- package/SpriteWithHtml.d.ts +4 -2
- package/SpriteWithHtml.ts +50 -0
- package/Text3D/Text3D.js +17 -21
- package/Text3D/Text3D.ts +77 -0
- package/Text3D/fontController.d.ts +10 -9
- package/Text3D/fontController.js +17 -50
- package/Text3D/fontController.ts +209 -0
- package/Text3D/index.ts +1 -0
- package/ThreeBase.d.ts +168 -31
- package/ThreeBase.js +663 -117
- package/ThreeBase.ts +1314 -0
- package/ThreeMouse.d.ts +20 -7
- package/ThreeMouse.js +78 -32
- package/ThreeMouse.ts +472 -0
- package/Transition.d.ts +12 -7
- package/Transition.js +26 -27
- package/Transition.ts +242 -0
- package/Water/Water.js +21 -3
- package/Water/Water.ts +45 -0
- package/Water/index.d.ts +2 -0
- package/Water/index.js +2 -0
- package/Water/index.ts +2 -0
- package/WaterFlow/FloatingDuck.d.ts +88 -0
- package/WaterFlow/FloatingDuck.js +307 -0
- package/WaterFlow/FloatingDuck.ts +445 -0
- package/WaterFlow/GPUFluidSimulation.d.ts +56 -0
- package/WaterFlow/GPUFluidSimulation.js +785 -0
- package/WaterFlow/GPUFluidSimulation.ts +827 -0
- package/WaterFlow/ReservoirSystem.d.ts +106 -0
- package/WaterFlow/ReservoirSystem.js +621 -0
- package/WaterFlow/ReservoirSystem.ts +754 -0
- package/WaterFlow/SPHField.d.ts +35 -0
- package/WaterFlow/SPHField.js +204 -0
- package/WaterFlow/SPHField.ts +228 -0
- package/WaterFlow/ScreenSpaceFluidPass.d.ts +69 -0
- package/WaterFlow/ScreenSpaceFluidPass.js +736 -0
- package/WaterFlow/ScreenSpaceFluidPass.ts +789 -0
- package/WaterFlow/ShallowWaterSurface.d.ts +45 -0
- package/WaterFlow/ShallowWaterSurface.js +441 -0
- package/WaterFlow/ShallowWaterSurface.ts +510 -0
- package/WaterFlow/WaterFlow.d.ts +87 -0
- package/WaterFlow/WaterFlow.js +171 -0
- package/WaterFlow/WaterFlow.ts +219 -0
- package/WaterFlow/types.d.ts +161 -0
- package/WaterFlow/types.js +1 -0
- package/WaterFlow/types.ts +189 -0
- package/WaterFlow/waterFlowPass.d.ts +3 -0
- package/WaterFlow/waterFlowPass.js +20 -0
- package/WaterFlow/waterFlowPass.ts +40 -0
- package/collisionOBB.d.ts +42 -0
- package/collisionOBB.js +112 -0
- package/collisionOBB.ts +108 -0
- package/declare.d.ts +25 -167
- package/index.js +0 -1
- package/index.ts +1 -0
- package/instanced/InstancedBatch.d.ts +57 -0
- package/instanced/InstancedBatch.js +348 -0
- package/instanced/InstancedBatch.ts +406 -0
- package/instanced/InstancedChild.d.ts +174 -0
- package/instanced/InstancedChild.js +264 -0
- package/instanced/InstancedChild.ts +327 -0
- package/instanced/InstancedGroup.d.ts +43 -0
- package/instanced/InstancedGroup.js +126 -0
- package/instanced/InstancedGroup.ts +137 -0
- package/{InstancedMeshBase.d.ts → instanced/InstancedMeshBase.d.ts} +6 -7
- package/{InstancedMeshBase.js → instanced/InstancedMeshBase.js} +36 -47
- package/instanced/InstancedMeshBase.ts +292 -0
- package/instanced/InstancedTemplate.d.ts +46 -0
- package/instanced/InstancedTemplate.js +125 -0
- package/instanced/InstancedTemplate.ts +188 -0
- package/keyControls.d.ts +29 -0
- package/{keyContorls.js → keyControls.js} +10 -7
- package/keyControls.ts +107 -0
- package/lensflare/LensFlare.d.ts +39 -0
- package/lensflare/LensFlare.js +373 -0
- package/lensflare/LensFlare.ts +448 -0
- package/lensflare/lensflare0.png +0 -0
- package/lensflare/lensflare3.png +0 -0
- package/lensflare/lensflare_custom.png +0 -0
- package/lensflare/lensflare_hex_ghost.png +0 -0
- package/lensflare/lensflare_hex_main.png +0 -0
- package/package.json +104 -25
- package/pass/bloom_pass.d.ts +1 -1
- package/pass/bloom_pass.js +127 -40
- package/pass/bloom_pass.ts +243 -0
- package/pass/cover_pass.d.ts +1 -1
- package/pass/cover_pass.js +55 -32
- package/pass/cover_pass.ts +182 -0
- package/pass/debugDepthState.d.ts +20 -0
- package/pass/debugDepthState.js +9 -0
- package/pass/debugDepthState.ts +22 -0
- package/pass/depthTestBias.d.ts +12 -0
- package/pass/depthTestBias.js +12 -0
- package/pass/depthTestBias.ts +12 -0
- package/pass/effectUserData.d.ts +27 -0
- package/pass/effectUserData.js +1 -0
- package/pass/effectUserData.ts +46 -0
- package/pass/frosted_glass_pass.d.ts +1 -1
- package/pass/frosted_glass_pass.js +45 -64
- package/pass/frosted_glass_pass.ts +288 -0
- package/pass/fsQuad.d.ts +2 -2
- package/pass/fsQuad.ts +34 -0
- package/pass/glow_pass.d.ts +1 -1
- package/pass/glow_pass.js +288 -72
- package/pass/glow_pass.ts +654 -0
- package/pass/screen_bloom_pass.d.ts +11 -0
- package/pass/screen_bloom_pass.js +235 -0
- package/pass/screen_bloom_pass.ts +263 -0
- package/pass/ssao_pass.d.ts +78 -3
- package/pass/ssao_pass.js +642 -206
- package/pass/ssao_pass.ts +918 -0
- package/pass/stroke_pass.d.ts +1 -1
- package/pass/stroke_pass.js +187 -116
- package/pass/stroke_pass.ts +638 -0
- package/shaders/FXAAShaderMaterial.js +5 -48
- package/shaders/FXAAShaderMaterial.ts +201 -0
- package/shaders/baseDepthVisShader.d.ts +11 -0
- package/shaders/baseDepthVisShader.js +36 -0
- package/shaders/baseDepthVisShader.ts +36 -0
- package/shaders/baseTextureToRenderShader.js +46 -51
- package/shaders/baseTextureToRenderShader.ts +232 -0
- package/shaders/copyShader.js +2 -3
- package/shaders/copyShader.ts +32 -0
- package/shaders/debugDepthCompareShader.d.ts +14 -0
- package/shaders/debugDepthCompareShader.js +49 -0
- package/shaders/debugDepthCompareShader.ts +50 -0
- package/shaders/debugDepthJudgeShader.d.ts +18 -0
- package/shaders/debugDepthJudgeShader.js +52 -0
- package/shaders/debugDepthJudgeShader.ts +54 -0
- package/shaders/debugExcludedShader.d.ts +13 -0
- package/shaders/debugExcludedShader.js +46 -0
- package/shaders/debugExcludedShader.ts +48 -0
- package/spriteTextBg.d.ts +1 -0
- package/spriteTextBg.js +20 -0
- package/spriteTextBg.ts +20 -0
- package/threeLoader.d.ts +8 -7
- package/threeLoader.js +58 -67
- package/threeLoader.ts +525 -0
- package/threeUtils.d.ts +2 -1
- package/threeUtils.js +24 -25
- package/threeUtils.ts +373 -0
- package/types.d.ts +2 -0
- package/types.js +6 -0
- package/types.ts +8 -0
- package/ApngTexture.d.ts +0 -13
- package/ApngTexture.js +0 -61
- package/ApngTextureManage.d.ts +0 -18
- package/ApngTextureManage.js +0 -87
- package/KeyFrameAnimation.d.ts +0 -25
- package/KeyFrameAnimation.js +0 -78
- package/keyContorls.d.ts +0 -25
- package/lib/draco/draco_decoder.js +0 -34
- package/lib/draco/draco_decoder.wasm +0 -0
- package/lib/draco/draco_wasm_wrapper.js +0 -117
- package/pass/emissive_ao_pass.d.ts +0 -13
- package/pass/emissive_ao_pass.js +0 -370
- package/shaders.d.ts +0 -5
- package/shaders.js +0 -93
package/Text3D/Text3D.js
CHANGED
|
@@ -6,52 +6,48 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { TextGeometry } from 'three/examples/jsm/geometries/TextGeometry.js';
|
|
8
8
|
import { Mesh, MeshStandardMaterial } from "three";
|
|
9
|
-
import
|
|
10
|
-
// 3D文字模型
|
|
9
|
+
import fontController from "./fontController";
|
|
11
10
|
export default class Text3D extends Mesh {
|
|
12
11
|
constructor(text = "new Text3D()") {
|
|
13
12
|
super();
|
|
14
13
|
this.setText({ text });
|
|
15
14
|
}
|
|
16
|
-
// 字体的存储路径 例如 : "http://drm.gitee.io/three-base-font/simhei/字.js"
|
|
17
15
|
static path = "//www.3dkeshihua.com/three-base-font/";
|
|
18
16
|
material = new MeshStandardMaterial({
|
|
19
|
-
metalness: 1,
|
|
20
|
-
roughness: 0.5,
|
|
17
|
+
metalness: 1,
|
|
18
|
+
roughness: 0.5,
|
|
21
19
|
});
|
|
22
|
-
// 配置
|
|
23
20
|
_config = {
|
|
24
21
|
text: "",
|
|
25
22
|
fontType: "simhei",
|
|
26
23
|
size: 1,
|
|
27
24
|
curveSegments: 10,
|
|
28
|
-
depth: 0.1,
|
|
29
|
-
bevelEnabled: true,
|
|
30
|
-
bevelThickness: 0.02,
|
|
31
|
-
bevelSize: 0.015,
|
|
32
|
-
bevelOffset: 0,
|
|
33
|
-
bevelSegments: 3,
|
|
25
|
+
depth: 0.1,
|
|
26
|
+
bevelEnabled: true,
|
|
27
|
+
bevelThickness: 0.02,
|
|
28
|
+
bevelSize: 0.015,
|
|
29
|
+
bevelOffset: 0,
|
|
30
|
+
bevelSegments: 3,
|
|
34
31
|
};
|
|
35
|
-
// 设置文字
|
|
36
32
|
setText(text3DProps) {
|
|
37
33
|
if (Object.keys(text3DProps).some(key => text3DProps[key] !== this._config[key])) {
|
|
38
34
|
Object.assign(this._config, text3DProps);
|
|
39
|
-
|
|
35
|
+
fontController.loadText({
|
|
40
36
|
fontBasePath: Text3D.path,
|
|
41
37
|
text: this._config.text,
|
|
42
38
|
fontType: this._config.fontType,
|
|
43
|
-
callback: THREEFont => {
|
|
39
|
+
callback: (THREEFont) => {
|
|
44
40
|
this.geometry.dispose();
|
|
45
41
|
this.geometry = new TextGeometry(this._config.text || "", {
|
|
46
42
|
font: THREEFont,
|
|
47
43
|
size: this._config.size,
|
|
48
44
|
curveSegments: this._config.curveSegments,
|
|
49
|
-
depth: this._config.depth,
|
|
50
|
-
bevelEnabled: this._config.bevelEnabled,
|
|
51
|
-
bevelThickness: this._config.bevelThickness,
|
|
52
|
-
bevelSize: this._config.bevelSize,
|
|
53
|
-
bevelOffset: this._config.bevelOffset,
|
|
54
|
-
bevelSegments: this._config.bevelSegments,
|
|
45
|
+
depth: this._config.depth,
|
|
46
|
+
bevelEnabled: this._config.bevelEnabled,
|
|
47
|
+
bevelThickness: this._config.bevelThickness,
|
|
48
|
+
bevelSize: this._config.bevelSize,
|
|
49
|
+
bevelOffset: this._config.bevelOffset,
|
|
50
|
+
bevelSegments: this._config.bevelSegments,
|
|
55
51
|
});
|
|
56
52
|
this.geometry.center();
|
|
57
53
|
this.dispatchEvent({ type: "loaded" });
|
package/Text3D/Text3D.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: xiaosihan
|
|
3
|
+
* @Date: 2022-06-14 09:48:00
|
|
4
|
+
* @Last Modified by: xiaosihan
|
|
5
|
+
* @Last Modified time: 2023-04-07 21:52:03
|
|
6
|
+
*/
|
|
7
|
+
import { TextGeometry } from 'three/examples/jsm/geometries/TextGeometry.js';
|
|
8
|
+
import { Font } from 'three/examples/jsm/loaders/FontLoader.js';
|
|
9
|
+
import { Mesh, MeshBasicMaterial, MeshLambertMaterial, MeshPhysicalMaterial, MeshStandardMaterial } from "three";
|
|
10
|
+
import fontController from "./fontController";
|
|
11
|
+
|
|
12
|
+
export type Text3DProps = {
|
|
13
|
+
text?: string;
|
|
14
|
+
fontType?: string;
|
|
15
|
+
size?: number | undefined;
|
|
16
|
+
depth?: number | undefined;
|
|
17
|
+
curveSegments?: number | undefined;
|
|
18
|
+
bevelEnabled?: boolean | undefined;
|
|
19
|
+
bevelThickness?: number | undefined;
|
|
20
|
+
bevelSize?: number | undefined;
|
|
21
|
+
bevelOffset?: number | undefined;
|
|
22
|
+
bevelSegments?: number | undefined;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default class Text3D extends Mesh {
|
|
26
|
+
constructor(text: string = "new Text3D()") {
|
|
27
|
+
super();
|
|
28
|
+
this.setText({ text });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static path: string = "//www.3dkeshihua.com/three-base-font/";
|
|
32
|
+
|
|
33
|
+
material: MeshStandardMaterial | MeshBasicMaterial | MeshPhysicalMaterial | MeshLambertMaterial = new MeshStandardMaterial({
|
|
34
|
+
metalness: 1,
|
|
35
|
+
roughness: 0.5,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
_config: Text3DProps = {
|
|
39
|
+
text: "",
|
|
40
|
+
fontType: "simhei",
|
|
41
|
+
size: 1,
|
|
42
|
+
curveSegments: 10,
|
|
43
|
+
depth: 0.1,
|
|
44
|
+
bevelEnabled: true,
|
|
45
|
+
bevelThickness: 0.02,
|
|
46
|
+
bevelSize: 0.015,
|
|
47
|
+
bevelOffset: 0,
|
|
48
|
+
bevelSegments: 3,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
setText(text3DProps: Text3DProps): void {
|
|
52
|
+
if (Object.keys(text3DProps).some(key => text3DProps[key as keyof Text3DProps] !== this._config[key as keyof Text3DProps])) {
|
|
53
|
+
Object.assign(this._config, text3DProps);
|
|
54
|
+
fontController.loadText({
|
|
55
|
+
fontBasePath: Text3D.path,
|
|
56
|
+
text: this._config.text,
|
|
57
|
+
fontType: this._config.fontType,
|
|
58
|
+
callback: (THREEFont: Font) => {
|
|
59
|
+
this.geometry.dispose();
|
|
60
|
+
this.geometry = new TextGeometry(this._config.text || "", {
|
|
61
|
+
font: THREEFont,
|
|
62
|
+
size: this._config.size,
|
|
63
|
+
curveSegments: this._config.curveSegments,
|
|
64
|
+
depth: this._config.depth,
|
|
65
|
+
bevelEnabled: this._config.bevelEnabled,
|
|
66
|
+
bevelThickness: this._config.bevelThickness,
|
|
67
|
+
bevelSize: this._config.bevelSize,
|
|
68
|
+
bevelOffset: this._config.bevelOffset,
|
|
69
|
+
bevelSegments: this._config.bevelSegments,
|
|
70
|
+
});
|
|
71
|
+
this.geometry.center();
|
|
72
|
+
this.dispatchEvent({ type: "loaded" } as never);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import Dexie, { Table } from "dexie";
|
|
2
|
-
import { Font } from "three/examples/jsm/loaders/FontLoader
|
|
2
|
+
import { Font } from "three/examples/jsm/loaders/FontLoader";
|
|
3
3
|
export type saveFontParam = {
|
|
4
4
|
fontType?: string;
|
|
5
5
|
fontName: string;
|
|
6
|
-
fontJson:
|
|
6
|
+
fontJson: Record<string, unknown>;
|
|
7
7
|
};
|
|
8
8
|
export type addFontFamilyParam = {
|
|
9
9
|
fontType?: string;
|
|
10
|
-
fontFamilyJson:
|
|
10
|
+
fontFamilyJson: Record<string, unknown>;
|
|
11
11
|
};
|
|
12
12
|
export type getFontParam = {
|
|
13
13
|
fontType?: string;
|
|
@@ -23,23 +23,23 @@ declare class indexBD extends Dexie {
|
|
|
23
23
|
constructor(dbName: string);
|
|
24
24
|
threeFont: Table;
|
|
25
25
|
}
|
|
26
|
-
declare class
|
|
26
|
+
declare class fontControl {
|
|
27
27
|
constructor();
|
|
28
28
|
THREEFontMap: Map<string, Font>;
|
|
29
29
|
fontBD: indexBD;
|
|
30
30
|
/**
|
|
31
31
|
* 保存 字体json到本地数据库中
|
|
32
32
|
* @param {saveFontParam} { fontType = "simhei", fontName, fontJson }
|
|
33
|
-
* @memberof
|
|
33
|
+
* @memberof fontControl
|
|
34
34
|
*/
|
|
35
35
|
saveFont({ fontType, fontName, fontJson }: saveFontParam): Promise<void>;
|
|
36
36
|
/**
|
|
37
37
|
* 通过 fontType 和 fontName 查询 fontJson
|
|
38
38
|
* @param {getFontParam} { fontType = "simhei", fontName }
|
|
39
39
|
* @returns
|
|
40
|
-
* @memberof
|
|
40
|
+
* @memberof fontControl
|
|
41
41
|
*/
|
|
42
|
-
getFont({ fontType, fontName }: getFontParam): Promise<
|
|
42
|
+
getFont({ fontType, fontName }: getFontParam): Promise<Record<string, unknown> | undefined>;
|
|
43
43
|
_loadTextCall: Map<string, Array<() => void>>;
|
|
44
44
|
loadText({ fontType, text, fontBasePath, callback }: loadTextParam): Promise<void>;
|
|
45
45
|
_loadFontIndexJson({ fontType, fontBasePath }: loadTextParam): Promise<void>;
|
|
@@ -55,5 +55,6 @@ declare class fontContorl {
|
|
|
55
55
|
addFont({ fontType, fontName, fontJson }: saveFontParam): void;
|
|
56
56
|
addFontFamily({ fontType, fontFamilyJson }: addFontFamilyParam): void;
|
|
57
57
|
}
|
|
58
|
-
declare const
|
|
59
|
-
export default
|
|
58
|
+
declare const fontController: fontControl;
|
|
59
|
+
export default fontController;
|
|
60
|
+
export { fontController };
|
package/Text3D/fontController.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import Dexie from "dexie";
|
|
8
8
|
import { filter, first, isEmpty } from "lodash";
|
|
9
|
-
import { Font } from "three/examples/jsm/loaders/FontLoader
|
|
9
|
+
import { Font } from "three/examples/jsm/loaders/FontLoader";
|
|
10
10
|
import threeUtils from "../threeUtils";
|
|
11
11
|
import gentilisJSON from "./gentilis.json";
|
|
12
12
|
class indexBD extends Dexie {
|
|
@@ -15,11 +15,9 @@ class indexBD extends Dexie {
|
|
|
15
15
|
}
|
|
16
16
|
threeFont;
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
class fontContorl {
|
|
18
|
+
class fontControl {
|
|
20
19
|
constructor() { }
|
|
21
20
|
THREEFontMap = new Map();
|
|
22
|
-
// 专门存储字体的数据库
|
|
23
21
|
fontBD = (() => {
|
|
24
22
|
let fontDB = new indexBD("three-base-font");
|
|
25
23
|
fontDB.version(1).stores({ threeFont: "++KeyPath,fontType,fontName,fontJson" });
|
|
@@ -28,9 +26,9 @@ class fontContorl {
|
|
|
28
26
|
/**
|
|
29
27
|
* 保存 字体json到本地数据库中
|
|
30
28
|
* @param {saveFontParam} { fontType = "simhei", fontName, fontJson }
|
|
31
|
-
* @memberof
|
|
29
|
+
* @memberof fontControl
|
|
32
30
|
*/
|
|
33
|
-
async saveFont({ fontType = "simhei", fontName, fontJson =
|
|
31
|
+
async saveFont({ fontType = "simhei", fontName, fontJson = {} }) {
|
|
34
32
|
let findResult = await this.getFont({ fontType, fontName });
|
|
35
33
|
if (isEmpty(findResult)) {
|
|
36
34
|
await this.fontBD.threeFont.add({ fontType, fontName, fontJson });
|
|
@@ -40,11 +38,11 @@ class fontContorl {
|
|
|
40
38
|
* 通过 fontType 和 fontName 查询 fontJson
|
|
41
39
|
* @param {getFontParam} { fontType = "simhei", fontName }
|
|
42
40
|
* @returns
|
|
43
|
-
* @memberof
|
|
41
|
+
* @memberof fontControl
|
|
44
42
|
*/
|
|
45
43
|
async getFont({ fontType = "simhei", fontName }) {
|
|
46
44
|
let fondResult = await this.fontBD.threeFont
|
|
47
|
-
.filter(d => (d.fontType === fontType && d.fontName === fontName))
|
|
45
|
+
.filter((d) => (d.fontType === fontType && d.fontName === fontName))
|
|
48
46
|
.toArray();
|
|
49
47
|
if (isEmpty(fondResult)) {
|
|
50
48
|
return undefined;
|
|
@@ -53,11 +51,8 @@ class fontContorl {
|
|
|
53
51
|
return first(fondResult).fontJson;
|
|
54
52
|
}
|
|
55
53
|
}
|
|
56
|
-
// 加载字体的回调函数们
|
|
57
54
|
_loadTextCall = new Map();
|
|
58
|
-
// 加载文字 提供给需要创建字体模型的方法使用 以节流的形式调用 回调函数
|
|
59
55
|
async loadText({ fontType = "simhei", text = "", fontBasePath, callback }) {
|
|
60
|
-
// 加载字体容器
|
|
61
56
|
await this._loadFontIndexJson({ fontType, fontBasePath });
|
|
62
57
|
let newCallback = () => {
|
|
63
58
|
let fontFamily = this.THREEFontMap.get(fontType);
|
|
@@ -65,34 +60,24 @@ class fontContorl {
|
|
|
65
60
|
callback(fontFamily);
|
|
66
61
|
}
|
|
67
62
|
};
|
|
68
|
-
|
|
69
|
-
filter(text).map(fontName => {
|
|
70
|
-
// 没有的就去加载
|
|
63
|
+
filter(text).map((fontName) => {
|
|
71
64
|
if (!this.hasFont({ fontType, fontName })) {
|
|
72
|
-
// 添加文字的默认模型 避免报错
|
|
73
65
|
let fontFamily = this.THREEFontMap.get(fontType);
|
|
74
|
-
// 创建 three 字体对象
|
|
75
66
|
if (fontFamily) {
|
|
76
|
-
//@ts-ignore
|
|
77
67
|
fontFamily.data.glyphs[fontName] = { "ha": 1389, "x_min": 477, "x_max": 949, "o": "m 700 901 q 906 770 830 906 q 770 477 949 618 q 711 288 711 412 l 613 288 q 781 608 613 494 q 819 722 825 651 q 700 808 808 803 l 684 808 q 581 673 575 803 l 477 673 q 613 884 477 836 q 700 901 629 901 m 732 184 l 732 71 l 591 71 l 591 184 l 732 184 z " };
|
|
78
68
|
}
|
|
79
69
|
this._loadFontJson({ fontType, fontName, fontBasePath });
|
|
80
70
|
}
|
|
81
|
-
// 加入待执行的回调
|
|
82
71
|
let origin_callbacks = this._loadTextCall.get(`${fontType}_${fontName}`) || [];
|
|
83
72
|
if (newCallback) {
|
|
84
73
|
this._loadTextCall.set(`${fontType}_${fontName}`, [...origin_callbacks, newCallback]);
|
|
85
74
|
}
|
|
86
75
|
});
|
|
87
|
-
// 执行任务队列
|
|
88
76
|
threeUtils.addWork(newCallback);
|
|
89
77
|
}
|
|
90
|
-
// 加载字体
|
|
91
78
|
async _loadFontIndexJson({ fontType = "simhei", fontBasePath }) {
|
|
92
79
|
let fontFamily = this.THREEFontMap.get(fontType);
|
|
93
|
-
// 创建 three 字体对象
|
|
94
80
|
if (!fontFamily) {
|
|
95
|
-
// 初始字体结构
|
|
96
81
|
fontFamily = new Font({
|
|
97
82
|
"underlineThickness": 69,
|
|
98
83
|
"underlinePosition": -174,
|
|
@@ -110,23 +95,18 @@ class fontContorl {
|
|
|
110
95
|
"glyphs": {}
|
|
111
96
|
});
|
|
112
97
|
this.THREEFontMap.set(fontType, fontFamily);
|
|
113
|
-
// 读取本地数据库中的字体初始结构文件
|
|
114
98
|
let fontFamilyIndexJson = await this.getFont({ fontType, fontName: "index" });
|
|
115
|
-
// 加载外部字体初始结构文件
|
|
116
99
|
if (!fontFamilyIndexJson) {
|
|
117
100
|
this._loadFontJson({ fontType, fontName: "index", fontBasePath });
|
|
118
101
|
}
|
|
119
102
|
}
|
|
120
103
|
}
|
|
121
|
-
// 加载外部字体.js
|
|
122
104
|
async _loadFontJson({ fontType = "simhei", fontName, fontBasePath }) {
|
|
123
105
|
let fontJson = await this.getFont({ fontType, fontName });
|
|
124
106
|
if (!fontJson) {
|
|
125
107
|
fontJson = gentilisJSON.glyphs[fontName];
|
|
126
108
|
}
|
|
127
|
-
// 数据库中没有 就去加载字体js
|
|
128
109
|
if (!fontJson) {
|
|
129
|
-
// 加载字体js
|
|
130
110
|
await new Promise(resolve => {
|
|
131
111
|
let script = document.createElement("script");
|
|
132
112
|
Object.assign(script, {
|
|
@@ -144,56 +124,43 @@ class fontContorl {
|
|
|
144
124
|
});
|
|
145
125
|
}
|
|
146
126
|
else {
|
|
147
|
-
// 数据库或者默认字体中 有就加入字体文件中
|
|
148
127
|
let fontFamily = this.THREEFontMap.get(fontType);
|
|
149
|
-
// 创建 three 字体对象
|
|
150
128
|
if (fontFamily) {
|
|
151
|
-
//@ts-ignore
|
|
152
129
|
fontFamily.data.glyphs[fontName] = fontJson;
|
|
153
130
|
}
|
|
154
131
|
}
|
|
155
|
-
// 执行相应的回调函数
|
|
156
132
|
let origin_callbacks = this._loadTextCall.get(`${fontType}_${fontName}`) || [];
|
|
157
|
-
// // 删除待执行的回调
|
|
158
133
|
this._loadTextCall.delete(`${fontType}_${fontName}`);
|
|
159
134
|
origin_callbacks.map(callback => {
|
|
160
|
-
// 执行任务队列
|
|
161
135
|
threeUtils.addWork(callback);
|
|
162
136
|
});
|
|
163
137
|
}
|
|
164
|
-
// 判断是否有这个文字
|
|
165
138
|
hasFont({ fontType, fontName }) {
|
|
166
139
|
return !isEmpty(this.THREEFontMap.get(fontType) &&
|
|
167
|
-
//@ts-ignore
|
|
168
140
|
this.THREEFontMap.get(fontType).data.glyphs[fontName]);
|
|
169
141
|
}
|
|
170
|
-
// 这个方法是提供给外部字体文件调用的
|
|
171
142
|
addFont({ fontType = "simhei", fontName, fontJson }) {
|
|
172
|
-
// 保存字体json到本地数据中
|
|
173
143
|
this.saveFont({ fontType, fontName, fontJson });
|
|
174
144
|
let fontFamily = this.THREEFontMap.get(fontType);
|
|
175
|
-
// 创建 three 字体对象
|
|
176
145
|
if (fontFamily) {
|
|
177
|
-
//@ts-ignore
|
|
178
146
|
fontFamily.data.glyphs[fontName] = fontJson;
|
|
179
147
|
}
|
|
180
148
|
}
|
|
181
|
-
// 这个方法是提供给外部字体文件调用的
|
|
182
149
|
addFontFamily({ fontType = "simhei", fontFamilyJson }) {
|
|
183
|
-
// 保存字体初始结构到数据库中
|
|
184
150
|
this.saveFont({ fontType, fontName: "index", fontJson: fontFamilyJson });
|
|
185
151
|
let fontFamily = this.THREEFontMap.get(fontType);
|
|
186
|
-
// 创建 three 字体对象
|
|
187
152
|
if (fontFamily) {
|
|
188
|
-
|
|
189
|
-
fontFamily.data = {
|
|
190
|
-
...fontFamilyJson,
|
|
191
|
-
//@ts-ignore
|
|
153
|
+
fontFamily.data = Object.assign({}, fontFamilyJson, {
|
|
192
154
|
glyphs: fontFamily.data.glyphs
|
|
193
|
-
};
|
|
155
|
+
});
|
|
194
156
|
}
|
|
195
157
|
}
|
|
196
158
|
}
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
|
|
159
|
+
const fontController = new fontControl();
|
|
160
|
+
// 将 fontController 实例挂载到 window 上,供浏览器控制台全局访问
|
|
161
|
+
window.fontController = fontController;
|
|
162
|
+
// 兼容旧代码中对 fontContorller (多了一个 l) 的错误拼写引用
|
|
163
|
+
// 保持向后兼容,避免旧示例代码或浏览器控制台输入报错
|
|
164
|
+
window.fontContorller = fontController;
|
|
165
|
+
export default fontController;
|
|
166
|
+
export { fontController };
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: xiaosihan
|
|
3
|
+
* @Date: 2021-04-15 00:34:44
|
|
4
|
+
* @Last Modified by: xiaosihan
|
|
5
|
+
* @Last Modified time: 2022-06-08 14:33:45
|
|
6
|
+
*/
|
|
7
|
+
import Dexie, { Table } from "dexie";
|
|
8
|
+
import { filter, first, isEmpty } from "lodash";
|
|
9
|
+
import { Font, FontData } from "three/examples/jsm/loaders/FontLoader";
|
|
10
|
+
import threeUtils from "../threeUtils";
|
|
11
|
+
import gentilisJSON from "./gentilis.json";
|
|
12
|
+
|
|
13
|
+
// 字体字形数据结构(对齐 three FontLoader 的 FontData.glyphs 元素)
|
|
14
|
+
type FontGlyph = { ha: number; x_min: number; x_max: number; o?: string };
|
|
15
|
+
|
|
16
|
+
export type saveFontParam = {
|
|
17
|
+
fontType?: string;
|
|
18
|
+
fontName: string;
|
|
19
|
+
fontJson: Record<string, unknown>;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type addFontFamilyParam = {
|
|
23
|
+
fontType?: string;
|
|
24
|
+
fontFamilyJson: Record<string, unknown>;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type getFontParam = {
|
|
28
|
+
fontType?: string;
|
|
29
|
+
fontName: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type loadTextParam = {
|
|
33
|
+
fontBasePath: string;
|
|
34
|
+
fontType?: string;
|
|
35
|
+
text?: string;
|
|
36
|
+
callback?: (font: Font) => void;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
class indexBD extends Dexie {
|
|
40
|
+
constructor(dbName: string) {
|
|
41
|
+
super(dbName);
|
|
42
|
+
}
|
|
43
|
+
threeFont!: Table;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
class fontControl {
|
|
47
|
+
constructor() { }
|
|
48
|
+
|
|
49
|
+
THREEFontMap: Map<string, Font> = new Map();
|
|
50
|
+
|
|
51
|
+
fontBD: indexBD = (() => {
|
|
52
|
+
let fontDB = new indexBD("three-base-font");
|
|
53
|
+
fontDB.version(1).stores({ threeFont: "++KeyPath,fontType,fontName,fontJson" });
|
|
54
|
+
return fontDB;
|
|
55
|
+
})();
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* 保存 字体json到本地数据库中
|
|
59
|
+
* @param {saveFontParam} { fontType = "simhei", fontName, fontJson }
|
|
60
|
+
* @memberof fontControl
|
|
61
|
+
*/
|
|
62
|
+
async saveFont({ fontType = "simhei", fontName, fontJson = {} }: saveFontParam): Promise<void> {
|
|
63
|
+
let findResult = await this.getFont({ fontType, fontName });
|
|
64
|
+
if (isEmpty(findResult)) {
|
|
65
|
+
await this.fontBD.threeFont.add({ fontType, fontName, fontJson });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* 通过 fontType 和 fontName 查询 fontJson
|
|
71
|
+
* @param {getFontParam} { fontType = "simhei", fontName }
|
|
72
|
+
* @returns
|
|
73
|
+
* @memberof fontControl
|
|
74
|
+
*/
|
|
75
|
+
async getFont({ fontType = "simhei", fontName }: getFontParam): Promise<Record<string, unknown> | undefined> {
|
|
76
|
+
let fondResult = await this.fontBD.threeFont
|
|
77
|
+
.filter((d: { fontType: string; fontName: string }) => (d.fontType === fontType && d.fontName === fontName))
|
|
78
|
+
.toArray();
|
|
79
|
+
if (isEmpty(fondResult)) {
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
return first(fondResult)!.fontJson;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
_loadTextCall: Map<string, Array<() => void>> = new Map();
|
|
88
|
+
|
|
89
|
+
async loadText({ fontType = "simhei", text = "", fontBasePath, callback }: loadTextParam): Promise<void> {
|
|
90
|
+
await this._loadFontIndexJson({ fontType, fontBasePath });
|
|
91
|
+
let newCallback = () => {
|
|
92
|
+
let fontFamily = this.THREEFontMap.get(fontType);
|
|
93
|
+
if (callback && fontFamily) {
|
|
94
|
+
callback(fontFamily);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
filter(text).map((fontName: string) => {
|
|
98
|
+
if (!this.hasFont({ fontType, fontName })) {
|
|
99
|
+
let fontFamily = this.THREEFontMap.get(fontType);
|
|
100
|
+
if (fontFamily) {
|
|
101
|
+
fontFamily.data.glyphs[fontName] = { "ha": 1389, "x_min": 477, "x_max": 949, "o": "m 700 901 q 906 770 830 906 q 770 477 949 618 q 711 288 711 412 l 613 288 q 781 608 613 494 q 819 722 825 651 q 700 808 808 803 l 684 808 q 581 673 575 803 l 477 673 q 613 884 477 836 q 700 901 629 901 m 732 184 l 732 71 l 591 71 l 591 184 l 732 184 z " };
|
|
102
|
+
}
|
|
103
|
+
this._loadFontJson({ fontType, fontName, fontBasePath });
|
|
104
|
+
}
|
|
105
|
+
let origin_callbacks = this._loadTextCall.get(`${fontType}_${fontName}`) || [];
|
|
106
|
+
if (newCallback) {
|
|
107
|
+
this._loadTextCall.set(`${fontType}_${fontName}`, [...origin_callbacks, newCallback]);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
threeUtils.addWork(newCallback);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
async _loadFontIndexJson({ fontType = "simhei", fontBasePath }: loadTextParam): Promise<void> {
|
|
114
|
+
let fontFamily = this.THREEFontMap.get(fontType);
|
|
115
|
+
if (!fontFamily) {
|
|
116
|
+
fontFamily = new Font({
|
|
117
|
+
"underlineThickness": 69,
|
|
118
|
+
"underlinePosition": -174,
|
|
119
|
+
"resolution": 1000,
|
|
120
|
+
"original_font_information": {},
|
|
121
|
+
"familyName": "Source Han Sans CN Normal",
|
|
122
|
+
"descender": -167,
|
|
123
|
+
"ascender": 0,
|
|
124
|
+
"boundingBox": {
|
|
125
|
+
"yMin": -700,
|
|
126
|
+
"xMin": -1389,
|
|
127
|
+
"yMax": 700,
|
|
128
|
+
"xMax": 4067
|
|
129
|
+
},
|
|
130
|
+
"glyphs": {}
|
|
131
|
+
});
|
|
132
|
+
this.THREEFontMap.set(fontType, fontFamily);
|
|
133
|
+
let fontFamilyIndexJson = await this.getFont({ fontType, fontName: "index" });
|
|
134
|
+
if (!fontFamilyIndexJson) {
|
|
135
|
+
this._loadFontJson({ fontType, fontName: "index", fontBasePath });
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
async _loadFontJson({ fontType = "simhei", fontName, fontBasePath }: { fontType: string; fontName: string; fontBasePath: string }): Promise<void> {
|
|
141
|
+
let fontJson = await this.getFont({ fontType, fontName });
|
|
142
|
+
if (!fontJson) {
|
|
143
|
+
fontJson = (gentilisJSON as unknown as FontData).glyphs[fontName];
|
|
144
|
+
}
|
|
145
|
+
if (!fontJson) {
|
|
146
|
+
await new Promise<void>(resolve => {
|
|
147
|
+
let script = document.createElement("script");
|
|
148
|
+
Object.assign(script, {
|
|
149
|
+
type: "text/javascript",
|
|
150
|
+
src: `${fontBasePath}${fontType}/${fontName}.js`,
|
|
151
|
+
async: true,
|
|
152
|
+
onload: () => {
|
|
153
|
+
script.remove();
|
|
154
|
+
resolve();
|
|
155
|
+
},
|
|
156
|
+
onerror: () => {
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
document.head.appendChild(script);
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
let fontFamily = this.THREEFontMap.get(fontType);
|
|
164
|
+
if (fontFamily) {
|
|
165
|
+
fontFamily.data.glyphs[fontName] = fontJson as unknown as FontGlyph;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
let origin_callbacks = this._loadTextCall.get(`${fontType}_${fontName}`) || [];
|
|
169
|
+
this._loadTextCall.delete(`${fontType}_${fontName}`);
|
|
170
|
+
origin_callbacks.map(callback => {
|
|
171
|
+
threeUtils.addWork(callback);
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
hasFont({ fontType, fontName }: { fontType: string; fontName: string }): boolean {
|
|
176
|
+
return !isEmpty(this.THREEFontMap.get(fontType) &&
|
|
177
|
+
this.THREEFontMap.get(fontType)!.data.glyphs[fontName]);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
addFont({ fontType = "simhei", fontName, fontJson }: saveFontParam): void {
|
|
181
|
+
this.saveFont({ fontType, fontName, fontJson });
|
|
182
|
+
let fontFamily = this.THREEFontMap.get(fontType);
|
|
183
|
+
if (fontFamily) {
|
|
184
|
+
(fontFamily.data as FontData).glyphs[fontName] = fontJson as unknown as FontGlyph;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
addFontFamily({ fontType = "simhei", fontFamilyJson }: addFontFamilyParam): void {
|
|
189
|
+
this.saveFont({ fontType, fontName: "index", fontJson: fontFamilyJson });
|
|
190
|
+
let fontFamily = this.THREEFontMap.get(fontType);
|
|
191
|
+
if (fontFamily) {
|
|
192
|
+
fontFamily.data = Object.assign({}, fontFamilyJson, {
|
|
193
|
+
glyphs: fontFamily.data.glyphs
|
|
194
|
+
}) as unknown as FontData;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const fontController = new fontControl();
|
|
200
|
+
|
|
201
|
+
// 将 fontController 实例挂载到 window 上,供浏览器控制台全局访问
|
|
202
|
+
(window as unknown as Record<string, unknown>).fontController = fontController;
|
|
203
|
+
|
|
204
|
+
// 兼容旧代码中对 fontContorller (多了一个 l) 的错误拼写引用
|
|
205
|
+
// 保持向后兼容,避免旧示例代码或浏览器控制台输入报错
|
|
206
|
+
(window as unknown as Record<string, unknown>).fontContorller = fontController;
|
|
207
|
+
|
|
208
|
+
export default fontController;
|
|
209
|
+
export { fontController };
|
package/Text3D/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Text3D";
|