x_ite 10.0.5 → 10.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -23
- package/dist/X3DUOM.xml +69 -11
- package/dist/assets/components/Annotation.js +13 -13
- package/dist/assets/components/Annotation.min.js +1 -1
- package/dist/assets/components/CADGeometry.js +16 -16
- package/dist/assets/components/CADGeometry.min.js +1 -1
- package/dist/assets/components/CubeMapTexturing.js +39 -27
- package/dist/assets/components/CubeMapTexturing.min.js +1 -1
- package/dist/assets/components/DIS.js +13 -13
- package/dist/assets/components/DIS.min.js +1 -1
- package/dist/assets/components/EventUtilities.js +9 -9
- package/dist/assets/components/EventUtilities.min.js +1 -1
- package/dist/assets/components/Geometry2D.js +51 -35
- package/dist/assets/components/Geometry2D.min.js +1 -1
- package/dist/assets/components/Geospatial.js +34 -34
- package/dist/assets/components/Geospatial.min.js +1 -1
- package/dist/assets/components/HAnim.js +23 -23
- package/dist/assets/components/HAnim.min.js +1 -1
- package/dist/assets/components/KeyDeviceSensor.js +8 -8
- package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
- package/dist/assets/components/Layout.js +61 -46
- package/dist/assets/components/Layout.min.js +1 -1
- package/dist/assets/components/NURBS.js +25 -25
- package/dist/assets/components/NURBS.min.js +1 -1
- package/dist/assets/components/ParticleSystems.js +26 -26
- package/dist/assets/components/ParticleSystems.min.js +1 -1
- package/dist/assets/components/Picking.js +18 -18
- package/dist/assets/components/Picking.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysics.js +17 -17
- package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
- package/dist/assets/components/Scripting.js +38 -38
- package/dist/assets/components/Scripting.min.js +1 -1
- package/dist/assets/components/Text.js +287 -215
- package/dist/assets/components/Text.min.js +1 -1
- package/dist/assets/components/TextureProjection.js +15 -15
- package/dist/assets/components/TextureProjection.min.js +1 -1
- package/dist/assets/components/Texturing3D.js +28 -28
- package/dist/assets/components/Texturing3D.min.js +1 -1
- package/dist/assets/components/VolumeRendering.js +19 -19
- package/dist/assets/components/VolumeRendering.min.js +1 -1
- package/dist/assets/components/X_ITE.js +1254 -1053
- package/dist/assets/components/X_ITE.min.js +1 -1
- package/dist/assets/fonts/PT_Sans/OFL.txt +94 -0
- package/dist/assets/fonts/PT_Sans/PTSans-Bold.ttf +0 -0
- package/dist/assets/fonts/PT_Sans/PTSans-BoldItalic.ttf +0 -0
- package/dist/assets/fonts/PT_Sans/PTSans-Italic.ttf +0 -0
- package/dist/assets/fonts/PT_Sans/PTSans-Regular.ttf +0 -0
- package/dist/assets/lib/mikktspace_bg.wasm +0 -0
- package/dist/example.html +1 -1
- package/dist/x_ite.css +1 -1
- package/dist/x_ite.d.ts +60 -11
- package/dist/x_ite.js +1006 -683
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.min.mjs +1 -1
- package/dist/x_ite.mjs +1006 -683
- package/dist/x_ite.zip +0 -0
- package/package.json +1 -1
- /package/dist/assets/fonts/{DroidSerif Apache License.txt → Droid/DroidSerif Apache License.txt} +0 -0
- /package/dist/assets/fonts/{DroidSerif-Bold.ttf → Droid/DroidSerif-Bold.ttf} +0 -0
- /package/dist/assets/fonts/{DroidSerif-BoldItalic.ttf → Droid/DroidSerif-BoldItalic.ttf} +0 -0
- /package/dist/assets/fonts/{DroidSerif-Italic.ttf → Droid/DroidSerif-Italic.ttf} +0 -0
- /package/dist/assets/fonts/{DroidSerif-Regular.ttf → Droid/DroidSerif-Regular.ttf} +0 -0
- /package/dist/assets/fonts/{Ubuntu LICENCE.txt → Ubuntu/Ubuntu LICENCE.txt} +0 -0
- /package/dist/assets/fonts/{Ubuntu-B.ttf → Ubuntu/Ubuntu-B.ttf} +0 -0
- /package/dist/assets/fonts/{Ubuntu-BI.ttf → Ubuntu/Ubuntu-BI.ttf} +0 -0
- /package/dist/assets/fonts/{Ubuntu-R.ttf → Ubuntu/Ubuntu-R.ttf} +0 -0
- /package/dist/assets/fonts/{Ubuntu-RI.ttf → Ubuntu/Ubuntu-RI.ttf} +0 -0
- /package/dist/assets/fonts/{UbuntuMono-B.ttf → Ubuntu/UbuntuMono-B.ttf} +0 -0
- /package/dist/assets/fonts/{UbuntuMono-BI.ttf → Ubuntu/UbuntuMono-BI.ttf} +0 -0
- /package/dist/assets/fonts/{UbuntuMono-R.ttf → Ubuntu/UbuntuMono-R.ttf} +0 -0
- /package/dist/assets/fonts/{UbuntuMono-RI.ttf → Ubuntu/UbuntuMono-RI.ttf} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* X_ITE v10.0
|
|
1
|
+
/* X_ITE v10.2.0 */(() => { // webpackBootstrap
|
|
2
2
|
/******/ var __webpack_modules__ = ({
|
|
3
3
|
|
|
4
|
-
/***/
|
|
4
|
+
/***/ 999:
|
|
5
5
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -14488,7 +14488,7 @@
|
|
|
14488
14488
|
/***/ ((module) => {
|
|
14489
14489
|
|
|
14490
14490
|
"use strict";
|
|
14491
|
-
module.exports = window [Symbol .for ("X_ITE.X3D-10.0
|
|
14491
|
+
module.exports = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("lib/jquery");
|
|
14492
14492
|
|
|
14493
14493
|
/***/ }),
|
|
14494
14494
|
|
|
@@ -14564,25 +14564,25 @@ var __webpack_exports__ = {};
|
|
|
14564
14564
|
// UNUSED EXPORTS: default
|
|
14565
14565
|
|
|
14566
14566
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components\")"
|
|
14567
|
-
const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0
|
|
14567
|
+
const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Components");
|
|
14568
14568
|
var Components_default = /*#__PURE__*/__webpack_require__.n(Components_namespaceObject);
|
|
14569
14569
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Fields\")"
|
|
14570
|
-
const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0
|
|
14570
|
+
const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Fields");
|
|
14571
14571
|
var Fields_default = /*#__PURE__*/__webpack_require__.n(Fields_namespaceObject);
|
|
14572
14572
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DFieldDefinition\")"
|
|
14573
|
-
const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0
|
|
14573
|
+
const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Base/X3DFieldDefinition");
|
|
14574
14574
|
var X3DFieldDefinition_default = /*#__PURE__*/__webpack_require__.n(X3DFieldDefinition_namespaceObject);
|
|
14575
14575
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/FieldDefinitionArray\")"
|
|
14576
|
-
const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0
|
|
14576
|
+
const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Base/FieldDefinitionArray");
|
|
14577
14577
|
var FieldDefinitionArray_default = /*#__PURE__*/__webpack_require__.n(FieldDefinitionArray_namespaceObject);
|
|
14578
14578
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Core/X3DNode\")"
|
|
14579
|
-
const X3DNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0
|
|
14579
|
+
const X3DNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Components/Core/X3DNode");
|
|
14580
14580
|
var X3DNode_default = /*#__PURE__*/__webpack_require__.n(X3DNode_namespaceObject);
|
|
14581
14581
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Networking/X3DUrlObject\")"
|
|
14582
|
-
const X3DUrlObject_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0
|
|
14582
|
+
const X3DUrlObject_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Components/Networking/X3DUrlObject");
|
|
14583
14583
|
var X3DUrlObject_default = /*#__PURE__*/__webpack_require__.n(X3DUrlObject_namespaceObject);
|
|
14584
14584
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Namespace\")"
|
|
14585
|
-
const Namespace_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0
|
|
14585
|
+
const Namespace_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Namespace");
|
|
14586
14586
|
var Namespace_default = /*#__PURE__*/__webpack_require__.n(Namespace_namespaceObject);
|
|
14587
14587
|
;// CONCATENATED MODULE: ./src/x_ite/Browser/Text/TextAlignment.js
|
|
14588
14588
|
/*******************************************************************************
|
|
@@ -14648,12 +14648,12 @@ const __default__ = TextAlignment;
|
|
|
14648
14648
|
Namespace_default().add ("TextAlignment", "x_ite/Browser/Text/TextAlignment", __default__);
|
|
14649
14649
|
/* harmony default export */ const Text_TextAlignment = (__default__);
|
|
14650
14650
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/InputOutput/FileLoader\")"
|
|
14651
|
-
const FileLoader_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0
|
|
14651
|
+
const FileLoader_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/InputOutput/FileLoader");
|
|
14652
14652
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DConstants\")"
|
|
14653
|
-
const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0
|
|
14653
|
+
const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Base/X3DConstants");
|
|
14654
14654
|
var X3DConstants_default = /*#__PURE__*/__webpack_require__.n(X3DConstants_namespaceObject);
|
|
14655
14655
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Browser/Networking/URLs\")"
|
|
14656
|
-
const URLs_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0
|
|
14656
|
+
const URLs_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Browser/Networking/URLs");
|
|
14657
14657
|
var URLs_default = /*#__PURE__*/__webpack_require__.n(URLs_namespaceObject);
|
|
14658
14658
|
;// CONCATENATED MODULE: ./src/x_ite/Components/Text/X3DFontStyleNode.js
|
|
14659
14659
|
/*******************************************************************************
|
|
@@ -14717,22 +14717,22 @@ var URLs_default = /*#__PURE__*/__webpack_require__.n(URLs_namespaceObject);
|
|
|
14717
14717
|
|
|
14718
14718
|
const Fonts = new Map ([
|
|
14719
14719
|
["SERIF", new Map ([
|
|
14720
|
-
["PLAIN", URLs_default().getFontsURL ("DroidSerif-Regular.ttf")],
|
|
14721
|
-
["ITALIC", URLs_default().getFontsURL ("DroidSerif-Italic.ttf")],
|
|
14722
|
-
["BOLD", URLs_default().getFontsURL ("DroidSerif-Bold.ttf")],
|
|
14723
|
-
["BOLDITALIC", URLs_default().getFontsURL ("DroidSerif-BoldItalic.ttf")],
|
|
14720
|
+
["PLAIN", URLs_default().getFontsURL ("Droid/DroidSerif-Regular.ttf")],
|
|
14721
|
+
["ITALIC", URLs_default().getFontsURL ("Droid/DroidSerif-Italic.ttf")],
|
|
14722
|
+
["BOLD", URLs_default().getFontsURL ("Droid/DroidSerif-Bold.ttf")],
|
|
14723
|
+
["BOLDITALIC", URLs_default().getFontsURL ("Droid/DroidSerif-BoldItalic.ttf")],
|
|
14724
14724
|
])],
|
|
14725
14725
|
["SANS", new Map ([
|
|
14726
|
-
["PLAIN", URLs_default().getFontsURL ("Ubuntu-R.ttf")],
|
|
14727
|
-
["ITALIC", URLs_default().getFontsURL ("Ubuntu-RI.ttf")],
|
|
14728
|
-
["BOLD", URLs_default().getFontsURL ("Ubuntu-B.ttf")],
|
|
14729
|
-
["BOLDITALIC", URLs_default().getFontsURL ("Ubuntu-BI.ttf")],
|
|
14726
|
+
["PLAIN", URLs_default().getFontsURL ("Ubuntu/Ubuntu-R.ttf")],
|
|
14727
|
+
["ITALIC", URLs_default().getFontsURL ("Ubuntu/Ubuntu-RI.ttf")],
|
|
14728
|
+
["BOLD", URLs_default().getFontsURL ("Ubuntu/Ubuntu-B.ttf")],
|
|
14729
|
+
["BOLDITALIC", URLs_default().getFontsURL ("Ubuntu/Ubuntu-BI.ttf")],
|
|
14730
14730
|
])],
|
|
14731
14731
|
["TYPEWRITER", new Map ([
|
|
14732
|
-
["PLAIN", URLs_default().getFontsURL ("UbuntuMono-R.ttf")],
|
|
14733
|
-
["ITALIC", URLs_default().getFontsURL ("UbuntuMono-RI.ttf")],
|
|
14734
|
-
["BOLD", URLs_default().getFontsURL ("UbuntuMono-B.ttf")],
|
|
14735
|
-
["BOLDITALIC", URLs_default().getFontsURL ("UbuntuMono-BI.ttf")],
|
|
14732
|
+
["PLAIN", URLs_default().getFontsURL ("Ubuntu/UbuntuMono-R.ttf")],
|
|
14733
|
+
["ITALIC", URLs_default().getFontsURL ("Ubuntu/UbuntuMono-RI.ttf")],
|
|
14734
|
+
["BOLD", URLs_default().getFontsURL ("Ubuntu/UbuntuMono-B.ttf")],
|
|
14735
|
+
["BOLDITALIC", URLs_default().getFontsURL ("Ubuntu/UbuntuMono-BI.ttf")],
|
|
14736
14736
|
])],
|
|
14737
14737
|
]);
|
|
14738
14738
|
|
|
@@ -14921,20 +14921,26 @@ const X3DFontStyleNode_default_ = X3DFontStyleNode;
|
|
|
14921
14921
|
Namespace_default().add ("X3DFontStyleNode", "x_ite/Components/Text/X3DFontStyleNode", X3DFontStyleNode_default_);
|
|
14922
14922
|
/* harmony default export */ const Text_X3DFontStyleNode = (X3DFontStyleNode_default_);
|
|
14923
14923
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Browser/Core/PrimitiveQuality\")"
|
|
14924
|
-
const PrimitiveQuality_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0
|
|
14924
|
+
const PrimitiveQuality_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Browser/Core/PrimitiveQuality");
|
|
14925
14925
|
var PrimitiveQuality_default = /*#__PURE__*/__webpack_require__.n(PrimitiveQuality_namespaceObject);
|
|
14926
|
+
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Browser/Core/TextCompression\")"
|
|
14927
|
+
const TextCompression_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Browser/Core/TextCompression");
|
|
14928
|
+
var TextCompression_default = /*#__PURE__*/__webpack_require__.n(TextCompression_namespaceObject);
|
|
14926
14929
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Geometry/Box2\")"
|
|
14927
|
-
const Box2_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0
|
|
14930
|
+
const Box2_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("standard/Math/Geometry/Box2");
|
|
14928
14931
|
var Box2_default = /*#__PURE__*/__webpack_require__.n(Box2_namespaceObject);
|
|
14929
14932
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Geometry/Box3\")"
|
|
14930
|
-
const Box3_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0
|
|
14933
|
+
const Box3_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("standard/Math/Geometry/Box3");
|
|
14931
14934
|
var Box3_default = /*#__PURE__*/__webpack_require__.n(Box3_namespaceObject);
|
|
14932
14935
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Vector2\")"
|
|
14933
|
-
const Vector2_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0
|
|
14936
|
+
const Vector2_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("standard/Math/Numbers/Vector2");
|
|
14934
14937
|
var Vector2_default = /*#__PURE__*/__webpack_require__.n(Vector2_namespaceObject);
|
|
14935
14938
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Vector3\")"
|
|
14936
|
-
const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0
|
|
14939
|
+
const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("standard/Math/Numbers/Vector3");
|
|
14937
14940
|
var Vector3_default = /*#__PURE__*/__webpack_require__.n(Vector3_namespaceObject);
|
|
14941
|
+
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Matrix3\")"
|
|
14942
|
+
const Matrix3_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("standard/Math/Numbers/Matrix3");
|
|
14943
|
+
var Matrix3_default = /*#__PURE__*/__webpack_require__.n(Matrix3_namespaceObject);
|
|
14938
14944
|
;// CONCATENATED MODULE: ./src/x_ite/Browser/Text/X3DTextGeometry.js
|
|
14939
14945
|
/*******************************************************************************
|
|
14940
14946
|
*
|
|
@@ -14989,25 +14995,27 @@ var Vector3_default = /*#__PURE__*/__webpack_require__.n(Vector3_namespaceObject
|
|
|
14989
14995
|
|
|
14990
14996
|
|
|
14991
14997
|
|
|
14992
|
-
|
|
14993
|
-
|
|
14994
|
-
|
|
14995
|
-
|
|
14996
|
-
|
|
14997
|
-
|
|
14998
|
-
|
|
14999
|
-
|
|
15000
|
-
|
|
15001
|
-
|
|
15002
|
-
|
|
15003
|
-
|
|
15004
|
-
|
|
15005
|
-
|
|
15006
|
-
|
|
15007
|
-
|
|
15008
|
-
|
|
15009
|
-
|
|
15010
|
-
|
|
14998
|
+
|
|
14999
|
+
|
|
15000
|
+
const
|
|
15001
|
+
bbox = new (Box2_default()) (),
|
|
15002
|
+
lineBBox = new (Box2_default()) (),
|
|
15003
|
+
min = new (Vector2_default()) (),
|
|
15004
|
+
max = new (Vector2_default()) (),
|
|
15005
|
+
glyphMin = new (Vector2_default()) (),
|
|
15006
|
+
glyphMax = new (Vector2_default()) (),
|
|
15007
|
+
min3 = new (Vector3_default()) (),
|
|
15008
|
+
max3 = new (Vector3_default()) (),
|
|
15009
|
+
size = new (Vector2_default()) (),
|
|
15010
|
+
center = new (Vector2_default()) (),
|
|
15011
|
+
size1_2 = new (Vector2_default()) (),
|
|
15012
|
+
translation1 = new (Vector2_default()) (),
|
|
15013
|
+
translation2 = new (Vector2_default()) (),
|
|
15014
|
+
lineBound = new (Vector2_default()) (),
|
|
15015
|
+
origin = new (Vector3_default()) (),
|
|
15016
|
+
box2 = new (Box2_default()) (),
|
|
15017
|
+
zero2 = new (Vector2_default()) (),
|
|
15018
|
+
zero3 = new (Vector3_default()) ();
|
|
15011
15019
|
|
|
15012
15020
|
function X3DTextGeometry (text, fontStyle)
|
|
15013
15021
|
{
|
|
@@ -15016,10 +15024,11 @@ function X3DTextGeometry (text, fontStyle)
|
|
|
15016
15024
|
this .fontStyle = fontStyle;
|
|
15017
15025
|
this .glyphs = [ ];
|
|
15018
15026
|
this .minorAlignment = new (Vector2_default()) ();
|
|
15027
|
+
this .lineIndices = [ ];
|
|
15019
15028
|
this .translations = [ ];
|
|
15020
15029
|
this .charSpacings = [ ];
|
|
15030
|
+
this .scales = [ ];
|
|
15021
15031
|
this .bearing = new (Vector2_default()) ();
|
|
15022
|
-
this .yPad = [ ];
|
|
15023
15032
|
this .bbox = new (Box3_default()) ();
|
|
15024
15033
|
}
|
|
15025
15034
|
|
|
@@ -15053,6 +15062,10 @@ Object .assign (X3DTextGeometry .prototype,
|
|
|
15053
15062
|
{
|
|
15054
15063
|
return this .charSpacings;
|
|
15055
15064
|
},
|
|
15065
|
+
getScales ()
|
|
15066
|
+
{
|
|
15067
|
+
return this .scales;
|
|
15068
|
+
},
|
|
15056
15069
|
getBearing ()
|
|
15057
15070
|
{
|
|
15058
15071
|
return this .bearing;
|
|
@@ -15063,7 +15076,7 @@ Object .assign (X3DTextGeometry .prototype,
|
|
|
15063
15076
|
},
|
|
15064
15077
|
update ()
|
|
15065
15078
|
{
|
|
15066
|
-
|
|
15079
|
+
const
|
|
15067
15080
|
text = this .text,
|
|
15068
15081
|
fontStyle = this .fontStyle,
|
|
15069
15082
|
numLines = text ._string .length;
|
|
@@ -15071,7 +15084,7 @@ Object .assign (X3DTextGeometry .prototype,
|
|
|
15071
15084
|
text ._lineBounds .length = numLines;
|
|
15072
15085
|
this .glyphs .length = 0;
|
|
15073
15086
|
|
|
15074
|
-
if (numLines === 0 || !
|
|
15087
|
+
if (numLines === 0 || !fontStyle .getFont ())
|
|
15075
15088
|
{
|
|
15076
15089
|
text ._origin .setValue (zero3);
|
|
15077
15090
|
text ._textBounds .setValue (zero2);
|
|
@@ -15083,21 +15096,24 @@ Object .assign (X3DTextGeometry .prototype,
|
|
|
15083
15096
|
if (fontStyle ._horizontal .getValue ())
|
|
15084
15097
|
{
|
|
15085
15098
|
this .resizeArray (this .translations, numLines);
|
|
15086
|
-
|
|
15099
|
+
|
|
15100
|
+
this .lineIndices .length = 0;
|
|
15101
|
+
this .charSpacings .length = numLines;
|
|
15102
|
+
this .scales .length = numLines;
|
|
15087
15103
|
|
|
15088
15104
|
this .horizontal (text, fontStyle);
|
|
15089
15105
|
}
|
|
15090
15106
|
else
|
|
15091
15107
|
{
|
|
15092
|
-
|
|
15108
|
+
const
|
|
15093
15109
|
string = text ._string,
|
|
15094
|
-
numChars = 0;
|
|
15095
|
-
|
|
15096
|
-
for (var i = 0, length = string .length; i < length; ++ i)
|
|
15097
|
-
numChars += string [i] .length;
|
|
15110
|
+
numChars = string .reduce ((p, c) => p + c .length, 0);
|
|
15098
15111
|
|
|
15099
15112
|
this .resizeArray (this .translations, numChars);
|
|
15100
|
-
|
|
15113
|
+
|
|
15114
|
+
this .lineIndices .length = numChars;
|
|
15115
|
+
this .charSpacings .length = numLines;
|
|
15116
|
+
this .scales .length = numLines;
|
|
15101
15117
|
|
|
15102
15118
|
this .vertical (text, fontStyle);
|
|
15103
15119
|
}
|
|
@@ -15113,59 +15129,56 @@ Object .assign (X3DTextGeometry .prototype,
|
|
|
15113
15129
|
},
|
|
15114
15130
|
horizontal (text, fontStyle)
|
|
15115
15131
|
{
|
|
15116
|
-
|
|
15117
|
-
font
|
|
15118
|
-
string
|
|
15119
|
-
numLines
|
|
15120
|
-
maxExtent
|
|
15121
|
-
topToBottom
|
|
15122
|
-
scale
|
|
15123
|
-
spacing
|
|
15132
|
+
const
|
|
15133
|
+
font = fontStyle .getFont (),
|
|
15134
|
+
string = text ._string,
|
|
15135
|
+
numLines = string .length,
|
|
15136
|
+
maxExtent = Math .max (0, text ._maxExtent .getValue ()),
|
|
15137
|
+
topToBottom = fontStyle ._topToBottom .getValue (),
|
|
15138
|
+
scale = fontStyle .getScale (),
|
|
15139
|
+
spacing = fontStyle ._spacing .getValue (),
|
|
15140
|
+
textCompression = this .getBrowser () .getBrowserOptions () .getTextCompression ();
|
|
15124
15141
|
|
|
15125
15142
|
bbox .set ();
|
|
15126
15143
|
|
|
15127
15144
|
// Calculate bboxes.
|
|
15128
15145
|
|
|
15129
|
-
|
|
15146
|
+
const
|
|
15130
15147
|
first = topToBottom ? 0 : numLines - 1,
|
|
15131
15148
|
last = topToBottom ? numLines : -1,
|
|
15132
15149
|
step = topToBottom ? 1 : -1;
|
|
15133
15150
|
|
|
15134
|
-
for (
|
|
15151
|
+
for (let l = first, ll = 0; l !== last; l += step, ++ ll)
|
|
15135
15152
|
{
|
|
15136
|
-
|
|
15153
|
+
const line = string [l];
|
|
15137
15154
|
|
|
15138
15155
|
// Get line extents.
|
|
15139
15156
|
|
|
15140
|
-
|
|
15157
|
+
const glyphs = this .getHorizontalLineExtents (fontStyle, line, min, max, ll);
|
|
15141
15158
|
|
|
15142
15159
|
size .assign (max) .subtract (min);
|
|
15143
15160
|
|
|
15144
15161
|
// Calculate charSpacing and lineBounds.
|
|
15145
15162
|
|
|
15146
|
-
|
|
15147
|
-
|
|
15148
|
-
|
|
15163
|
+
const
|
|
15164
|
+
length = text .getLength (l),
|
|
15165
|
+
w = size .x * scale;
|
|
15149
15166
|
|
|
15150
|
-
|
|
15167
|
+
let charSpacing = 0;
|
|
15151
15168
|
|
|
15152
|
-
|
|
15153
|
-
{
|
|
15154
|
-
if (length)
|
|
15155
|
-
length = Math .min (maxExtent, length);
|
|
15156
|
-
|
|
15157
|
-
else
|
|
15158
|
-
length = Math .min (maxExtent, size .x * scale);
|
|
15159
|
-
}
|
|
15169
|
+
lineBound .set (w, ll == 0 ? max .y - font .descender / font .unitsPerEm * scale : spacing);
|
|
15160
15170
|
|
|
15161
15171
|
if (length)
|
|
15162
15172
|
{
|
|
15163
|
-
|
|
15173
|
+
if (textCompression === (TextCompression_default()).CHAR_SPACING && glyphs .length > 1)
|
|
15174
|
+
charSpacing = (length - lineBound .x) / (glyphs .length - 1);
|
|
15175
|
+
|
|
15164
15176
|
lineBound .x = length;
|
|
15165
15177
|
size .x = length / scale;
|
|
15166
15178
|
}
|
|
15167
15179
|
|
|
15168
15180
|
this .charSpacings [ll] = charSpacing;
|
|
15181
|
+
this .scales [ll] = textCompression === (TextCompression_default()).SCALING ? lineBound .x / w : 1;
|
|
15169
15182
|
text ._lineBounds [l] = lineBound;
|
|
15170
15183
|
|
|
15171
15184
|
// Calculate line translation.
|
|
@@ -15195,6 +15208,48 @@ Object .assign (X3DTextGeometry .prototype,
|
|
|
15195
15208
|
bbox .add (box2 .set (size .multiply (scale), center .multiply (scale) .add (this .translations [ll])));
|
|
15196
15209
|
}
|
|
15197
15210
|
|
|
15211
|
+
if (maxExtent)
|
|
15212
|
+
{
|
|
15213
|
+
const extent = text ._lineBounds .reduce ((p, c) => Math .max (p, c .x), 0);
|
|
15214
|
+
|
|
15215
|
+
if (extent > maxExtent)
|
|
15216
|
+
{
|
|
15217
|
+
const s = maxExtent / extent;
|
|
15218
|
+
|
|
15219
|
+
switch (textCompression)
|
|
15220
|
+
{
|
|
15221
|
+
case (TextCompression_default()).CHAR_SPACING:
|
|
15222
|
+
{
|
|
15223
|
+
for (const i of this .charSpacings .keys ())
|
|
15224
|
+
{
|
|
15225
|
+
if (text ._string [i] .length < 2)
|
|
15226
|
+
continue;
|
|
15227
|
+
|
|
15228
|
+
this .charSpacings [i] -= (text ._lineBounds [i] .x - text ._lineBounds [i] .x * s)
|
|
15229
|
+
/ (text ._string [i] .length - 1);
|
|
15230
|
+
}
|
|
15231
|
+
|
|
15232
|
+
break;
|
|
15233
|
+
}
|
|
15234
|
+
case (TextCompression_default()).SCALING:
|
|
15235
|
+
{
|
|
15236
|
+
for (const i of this .scales .keys ())
|
|
15237
|
+
this .scales [i] *= s;
|
|
15238
|
+
|
|
15239
|
+
break;
|
|
15240
|
+
}
|
|
15241
|
+
}
|
|
15242
|
+
|
|
15243
|
+
for (const i of this .translations .keys ())
|
|
15244
|
+
this .translations [i] .x *= s;
|
|
15245
|
+
|
|
15246
|
+
for (const i of text ._lineBounds .keys ())
|
|
15247
|
+
text ._lineBounds [i] .x *= s;
|
|
15248
|
+
|
|
15249
|
+
bbox .multRight (new (Matrix3_default()) (s,0,0, 0,1,0, 0,0,0));
|
|
15250
|
+
}
|
|
15251
|
+
}
|
|
15252
|
+
|
|
15198
15253
|
//console .log ("size", bbox .size, "center", bbox .center);
|
|
15199
15254
|
|
|
15200
15255
|
// Get text extents.
|
|
@@ -15238,7 +15293,7 @@ Object .assign (X3DTextGeometry .prototype,
|
|
|
15238
15293
|
},
|
|
15239
15294
|
vertical (text, fontStyle)
|
|
15240
15295
|
{
|
|
15241
|
-
|
|
15296
|
+
const
|
|
15242
15297
|
font = fontStyle .getFont (),
|
|
15243
15298
|
string = text ._string,
|
|
15244
15299
|
numLines = string .length,
|
|
@@ -15247,24 +15302,25 @@ Object .assign (X3DTextGeometry .prototype,
|
|
|
15247
15302
|
topToBottom = fontStyle ._topToBottom .getValue (),
|
|
15248
15303
|
scale = fontStyle .getScale (),
|
|
15249
15304
|
spacing = fontStyle ._spacing .getValue (),
|
|
15250
|
-
|
|
15251
|
-
|
|
15305
|
+
primitiveQuality = this .getBrowser () .getBrowserOptions () .getPrimitiveQuality (),
|
|
15306
|
+
textCompression = this .getBrowser () .getBrowserOptions () .getTextCompression ();
|
|
15252
15307
|
|
|
15253
15308
|
bbox .set ();
|
|
15254
15309
|
|
|
15255
15310
|
// Calculate bboxes.
|
|
15256
15311
|
|
|
15257
|
-
|
|
15312
|
+
const
|
|
15258
15313
|
firstL = leftToRight ? 0 : numLines - 1,
|
|
15259
15314
|
lastL = leftToRight ? numLines : -1,
|
|
15260
|
-
stepL = leftToRight ? 1 : -1
|
|
15261
|
-
|
|
15315
|
+
stepL = leftToRight ? 1 : -1;
|
|
15316
|
+
|
|
15317
|
+
let t = 0; // Translation index
|
|
15262
15318
|
|
|
15263
|
-
for (
|
|
15319
|
+
for (let l = firstL; l !== lastL; l += stepL)
|
|
15264
15320
|
{
|
|
15265
|
-
|
|
15321
|
+
const glyphs = this .stringToGlyphs (font, string [l], true, l);
|
|
15266
15322
|
|
|
15267
|
-
|
|
15323
|
+
const
|
|
15268
15324
|
t0 = t,
|
|
15269
15325
|
numChars = glyphs .length;
|
|
15270
15326
|
|
|
@@ -15272,14 +15328,14 @@ Object .assign (X3DTextGeometry .prototype,
|
|
|
15272
15328
|
|
|
15273
15329
|
lineBBox .set ();
|
|
15274
15330
|
|
|
15275
|
-
|
|
15331
|
+
const
|
|
15276
15332
|
firstG = topToBottom ? 0 : numChars - 1,
|
|
15277
15333
|
lastG = topToBottom ? numChars : -1,
|
|
15278
15334
|
stepG = topToBottom ? 1 : -1;
|
|
15279
15335
|
|
|
15280
|
-
for (
|
|
15336
|
+
for (let g = firstG; g !== lastG; g += stepG, ++ t)
|
|
15281
15337
|
{
|
|
15282
|
-
|
|
15338
|
+
const glyph = glyphs [g];
|
|
15283
15339
|
|
|
15284
15340
|
// Get glyph extents.
|
|
15285
15341
|
|
|
@@ -15289,8 +15345,9 @@ Object .assign (X3DTextGeometry .prototype,
|
|
|
15289
15345
|
|
|
15290
15346
|
// Calculate glyph translation
|
|
15291
15347
|
|
|
15292
|
-
|
|
15348
|
+
const glyphNumber = topToBottom ? g : numChars - g - 1;
|
|
15293
15349
|
|
|
15350
|
+
this .lineIndices [t] = l;
|
|
15294
15351
|
this .translations [t] .set ((spacing - size .x - min .x) / 2, -glyphNumber);
|
|
15295
15352
|
|
|
15296
15353
|
// Calculate center.
|
|
@@ -15310,32 +15367,30 @@ Object .assign (X3DTextGeometry .prototype,
|
|
|
15310
15367
|
|
|
15311
15368
|
// Calculate charSpacing and lineBounds.
|
|
15312
15369
|
|
|
15313
|
-
|
|
15314
|
-
lineNumber
|
|
15315
|
-
padding
|
|
15316
|
-
|
|
15317
|
-
length = text .getLength (l);
|
|
15370
|
+
const
|
|
15371
|
+
lineNumber = leftToRight ? l : numLines - l - 1,
|
|
15372
|
+
padding = (spacing - size .x) / 2,
|
|
15373
|
+
length = text .getLength (l);
|
|
15318
15374
|
|
|
15319
|
-
|
|
15375
|
+
let charSpacing = 0;
|
|
15320
15376
|
|
|
15321
|
-
|
|
15322
|
-
{
|
|
15323
|
-
if (length)
|
|
15324
|
-
length = Math .min (maxExtent, length);
|
|
15377
|
+
lineBound .set (l === 0 ? spacing - padding : spacing, numChars ? size .y : 0) .multiply (scale);
|
|
15325
15378
|
|
|
15326
|
-
|
|
15327
|
-
length = Math .min (maxExtent, size .y * scale);
|
|
15328
|
-
}
|
|
15379
|
+
const h = lineBound .y;
|
|
15329
15380
|
|
|
15330
15381
|
if (length)
|
|
15331
15382
|
{
|
|
15332
|
-
|
|
15383
|
+
if (textCompression === (TextCompression_default()).CHAR_SPACING && glyphs .length > 1)
|
|
15384
|
+
charSpacing = (length - lineBound .y) / (glyphs .length - 1);
|
|
15385
|
+
|
|
15333
15386
|
lineBound .y = length;
|
|
15334
15387
|
size .y = length / scale;
|
|
15335
|
-
min .y = max .y
|
|
15388
|
+
min .y = max .y - size .y;
|
|
15336
15389
|
}
|
|
15337
15390
|
|
|
15338
|
-
|
|
15391
|
+
this .charSpacings [l] = charSpacing;
|
|
15392
|
+
this .scales [l] = textCompression === (TextCompression_default()).SCALING ? lineBound .y / h : 1;
|
|
15393
|
+
text ._lineBounds [l] = lineBound;
|
|
15339
15394
|
|
|
15340
15395
|
// Calculate line translation.
|
|
15341
15396
|
|
|
@@ -15343,52 +15398,23 @@ Object .assign (X3DTextGeometry .prototype,
|
|
|
15343
15398
|
{
|
|
15344
15399
|
case Text_TextAlignment .BEGIN:
|
|
15345
15400
|
case Text_TextAlignment .FIRST:
|
|
15346
|
-
|
|
15401
|
+
translation2 .assign (translation1 .set (lineNumber * spacing, -max .y));
|
|
15347
15402
|
break;
|
|
15348
15403
|
case Text_TextAlignment .MIDDLE:
|
|
15349
|
-
|
|
15404
|
+
translation2 .assign (translation1 .set (lineNumber * spacing, (size .y / 2 - max .y)));
|
|
15350
15405
|
break;
|
|
15351
15406
|
case Text_TextAlignment .END:
|
|
15352
15407
|
{
|
|
15353
|
-
|
|
15354
|
-
|
|
15355
|
-
this .getGlyphExtents (font, glyphs [topToBottom ? numChars - 1 : 0], primitiveQuality, glyphMin .assign ((Vector2_default()).Zero), vector);
|
|
15356
|
-
|
|
15357
|
-
translation .set (lineNumber * spacing, (size .y - max .y + glyphMin .y));
|
|
15408
|
+
translation1 .set (lineNumber * spacing, (size .y / this .scales [l] - max .y));
|
|
15409
|
+
translation2 .set (lineNumber * spacing, (size .y - max .y));
|
|
15358
15410
|
break;
|
|
15359
15411
|
}
|
|
15360
15412
|
}
|
|
15361
15413
|
|
|
15362
15414
|
// Calculate glyph translation
|
|
15363
15415
|
|
|
15364
|
-
|
|
15365
|
-
|
|
15366
|
-
for (var tt = t0; tt < t; ++ tt)
|
|
15367
|
-
{
|
|
15368
|
-
this .translations [tt] .add (translation);
|
|
15369
|
-
|
|
15370
|
-
this .translations [tt] .y -= space;
|
|
15371
|
-
|
|
15372
|
-
this .translations [tt] .multiply (scale);
|
|
15373
|
-
|
|
15374
|
-
space += charSpacing;
|
|
15375
|
-
}
|
|
15376
|
-
|
|
15377
|
-
// Calculate ypad to extend line bounds.
|
|
15378
|
-
|
|
15379
|
-
switch (fontStyle .getMajorAlignment ())
|
|
15380
|
-
{
|
|
15381
|
-
case Text_TextAlignment .BEGIN:
|
|
15382
|
-
case Text_TextAlignment .FIRST:
|
|
15383
|
-
yPad [l] = max .y + translation .y;
|
|
15384
|
-
break;
|
|
15385
|
-
case Text_TextAlignment .MIDDLE:
|
|
15386
|
-
yPad [l] = 0;
|
|
15387
|
-
break;
|
|
15388
|
-
case Text_TextAlignment .END:
|
|
15389
|
-
yPad [l] = min .y + translation .y;
|
|
15390
|
-
break;
|
|
15391
|
-
}
|
|
15416
|
+
for (let tt = t0; tt < t; ++ tt)
|
|
15417
|
+
this .translations [tt] .add (translation1) .multiply (scale);
|
|
15392
15418
|
|
|
15393
15419
|
// Calculate center.
|
|
15394
15420
|
|
|
@@ -15396,42 +15422,80 @@ Object .assign (X3DTextGeometry .prototype,
|
|
|
15396
15422
|
|
|
15397
15423
|
// Add bbox.
|
|
15398
15424
|
|
|
15399
|
-
bbox .add (box2 .set (size .multiply (scale), center .add (
|
|
15425
|
+
bbox .add (box2 .set (size .multiply (scale), center .add (translation2) .multiply (scale)));
|
|
15400
15426
|
}
|
|
15401
15427
|
|
|
15402
|
-
|
|
15428
|
+
if (maxExtent)
|
|
15429
|
+
{
|
|
15430
|
+
const extent = text ._lineBounds .reduce ((p, c) => Math .max (p, c .y), 0);
|
|
15403
15431
|
|
|
15404
|
-
|
|
15432
|
+
if (extent > maxExtent)
|
|
15433
|
+
{
|
|
15434
|
+
const s = maxExtent / extent;
|
|
15405
15435
|
|
|
15406
|
-
|
|
15436
|
+
switch (textCompression)
|
|
15437
|
+
{
|
|
15438
|
+
case (TextCompression_default()).CHAR_SPACING:
|
|
15439
|
+
{
|
|
15440
|
+
for (const i of this .charSpacings .keys ())
|
|
15441
|
+
{
|
|
15442
|
+
if (text ._string [i] .length < 2)
|
|
15443
|
+
continue;
|
|
15407
15444
|
|
|
15408
|
-
|
|
15445
|
+
this .charSpacings [i] -= (text ._lineBounds [i] .y - text ._lineBounds [i] .y * s)
|
|
15446
|
+
/ (text ._string [i] .length - 1);
|
|
15447
|
+
}
|
|
15409
15448
|
|
|
15410
|
-
|
|
15411
|
-
|
|
15412
|
-
|
|
15413
|
-
|
|
15414
|
-
|
|
15415
|
-
|
|
15449
|
+
switch (fontStyle .getMajorAlignment ())
|
|
15450
|
+
{
|
|
15451
|
+
case Text_TextAlignment .MIDDLE:
|
|
15452
|
+
{
|
|
15453
|
+
for (const t of this .translations .keys ())
|
|
15454
|
+
{
|
|
15455
|
+
const l = this .lineIndices [t];
|
|
15456
|
+
|
|
15457
|
+
this .translations [t] .y -= (text ._lineBounds [l] .y - text ._lineBounds [l] .y * s) / 2;
|
|
15458
|
+
}
|
|
15459
|
+
|
|
15460
|
+
break;
|
|
15461
|
+
}
|
|
15462
|
+
case Text_TextAlignment .END:
|
|
15463
|
+
{
|
|
15464
|
+
for (const t of this .translations .keys ())
|
|
15465
|
+
{
|
|
15466
|
+
const l = this .lineIndices [t];
|
|
15467
|
+
|
|
15468
|
+
this .translations [t] .y -= (text ._lineBounds [l] .y - text ._lineBounds [l] .y * s);
|
|
15469
|
+
}
|
|
15470
|
+
|
|
15471
|
+
break;
|
|
15472
|
+
}
|
|
15473
|
+
}
|
|
15416
15474
|
|
|
15417
|
-
|
|
15418
|
-
|
|
15475
|
+
break;
|
|
15476
|
+
}
|
|
15477
|
+
case (TextCompression_default()).SCALING:
|
|
15478
|
+
{
|
|
15479
|
+
for (const i of this .scales .keys ())
|
|
15480
|
+
this .scales [i] *= s;
|
|
15419
15481
|
|
|
15420
|
-
|
|
15421
|
-
|
|
15422
|
-
|
|
15423
|
-
break;
|
|
15424
|
-
case Text_TextAlignment .END:
|
|
15425
|
-
{
|
|
15426
|
-
var lineBounds = text ._lineBounds;
|
|
15482
|
+
break;
|
|
15483
|
+
}
|
|
15484
|
+
}
|
|
15427
15485
|
|
|
15428
|
-
for (
|
|
15429
|
-
|
|
15486
|
+
for (const i of text ._lineBounds .keys ())
|
|
15487
|
+
text ._lineBounds [i] .y *= s;
|
|
15430
15488
|
|
|
15431
|
-
|
|
15489
|
+
bbox .multRight (new (Matrix3_default()) (1,0,0, 0,s,0, 0,0,0));
|
|
15432
15490
|
}
|
|
15433
15491
|
}
|
|
15434
15492
|
|
|
15493
|
+
// Get text extents.
|
|
15494
|
+
|
|
15495
|
+
bbox .getExtents (min, max);
|
|
15496
|
+
|
|
15497
|
+
size .assign (max) .subtract (min);
|
|
15498
|
+
|
|
15435
15499
|
// Calculate text position
|
|
15436
15500
|
|
|
15437
15501
|
text ._textBounds = size;
|
|
@@ -15478,40 +15542,38 @@ Object .assign (X3DTextGeometry .prototype,
|
|
|
15478
15542
|
},
|
|
15479
15543
|
stringToGlyphs (font, line, normal, lineNumber)
|
|
15480
15544
|
{
|
|
15481
|
-
|
|
15545
|
+
const glyphs = this .glyphs [lineNumber]
|
|
15546
|
+
?? (this .glyphs [lineNumber] = [ ]);
|
|
15482
15547
|
|
|
15483
|
-
|
|
15484
|
-
glypes = this .glyphs [lineNumber] = [ ];
|
|
15548
|
+
glyphs .length = line .length;
|
|
15485
15549
|
|
|
15486
|
-
|
|
15487
|
-
|
|
15488
|
-
var
|
|
15550
|
+
const
|
|
15489
15551
|
first = normal ? 0 : line .length - 1,
|
|
15490
15552
|
last = normal ? line .length : -1,
|
|
15491
15553
|
step = normal ? 1 : -1;
|
|
15492
15554
|
|
|
15493
|
-
for (
|
|
15494
|
-
|
|
15555
|
+
for (let c = first, g = 0; c !== last; c += step, ++ g)
|
|
15556
|
+
glyphs [g] = font .charToGlyph (line [c]);
|
|
15495
15557
|
|
|
15496
|
-
return
|
|
15558
|
+
return glyphs;
|
|
15497
15559
|
},
|
|
15498
15560
|
getHorizontalLineExtents (fontStyle, line, min, max, lineNumber)
|
|
15499
15561
|
{
|
|
15500
|
-
|
|
15562
|
+
const
|
|
15501
15563
|
font = fontStyle .getFont (),
|
|
15502
15564
|
normal = fontStyle ._horizontal .getValue () ? fontStyle ._leftToRight .getValue () : fontStyle ._topToBottom .getValue (),
|
|
15503
15565
|
glyphs = this .stringToGlyphs (font, line, normal, lineNumber),
|
|
15504
|
-
primitiveQuality = this .getBrowser () .getBrowserOptions () .getPrimitiveQuality ()
|
|
15505
|
-
|
|
15506
|
-
|
|
15507
|
-
|
|
15508
|
-
|
|
15566
|
+
primitiveQuality = this .getBrowser () .getBrowserOptions () .getPrimitiveQuality ();
|
|
15567
|
+
|
|
15568
|
+
let
|
|
15569
|
+
xMin = 0,
|
|
15570
|
+
xMax = 0,
|
|
15571
|
+
yMin = Number .POSITIVE_INFINITY,
|
|
15572
|
+
yMax = Number .NEGATIVE_INFINITY;
|
|
15509
15573
|
|
|
15510
|
-
for (
|
|
15574
|
+
for (const [g, glyph] of glyphs .entries ())
|
|
15511
15575
|
{
|
|
15512
|
-
|
|
15513
|
-
glyph = glyphs [g],
|
|
15514
|
-
kerning = g + 1 < length ? font .getKerningValue (glyph, glyphs [g + 1]) : 0;
|
|
15576
|
+
const kerning = g + 1 < glyphs .length ? font .getKerningValue (glyph, glyphs [g + 1]) : 0;
|
|
15515
15577
|
|
|
15516
15578
|
this .getGlyphExtents (font, glyph, primitiveQuality, glyphMin, glyphMax);
|
|
15517
15579
|
|
|
@@ -15524,7 +15586,7 @@ Object .assign (X3DTextGeometry .prototype,
|
|
|
15524
15586
|
{
|
|
15525
15587
|
this .getGlyphExtents (font, glyphs [0], primitiveQuality, glyphMin, glyphMax);
|
|
15526
15588
|
|
|
15527
|
-
xMin
|
|
15589
|
+
xMin = glyphMin .x;
|
|
15528
15590
|
}
|
|
15529
15591
|
else
|
|
15530
15592
|
{
|
|
@@ -15555,13 +15617,13 @@ const X3DTextGeometry_default_ = X3DTextGeometry;
|
|
|
15555
15617
|
Namespace_default().add ("X3DTextGeometry", "x_ite/Browser/Text/X3DTextGeometry", X3DTextGeometry_default_);
|
|
15556
15618
|
/* harmony default export */ const Text_X3DTextGeometry = (X3DTextGeometry_default_);
|
|
15557
15619
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Matrix4\")"
|
|
15558
|
-
const Matrix4_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0
|
|
15620
|
+
const Matrix4_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("standard/Math/Numbers/Matrix4");
|
|
15559
15621
|
var Matrix4_default = /*#__PURE__*/__webpack_require__.n(Matrix4_namespaceObject);
|
|
15560
15622
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Algorithms/Bezier\")"
|
|
15561
|
-
const Bezier_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0
|
|
15623
|
+
const Bezier_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("standard/Math/Algorithms/Bezier");
|
|
15562
15624
|
var Bezier_default = /*#__PURE__*/__webpack_require__.n(Bezier_namespaceObject);
|
|
15563
15625
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"lib/libtess\")"
|
|
15564
|
-
const libtess_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0
|
|
15626
|
+
const libtess_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("lib/libtess");
|
|
15565
15627
|
var libtess_default = /*#__PURE__*/__webpack_require__.n(libtess_namespaceObject);
|
|
15566
15628
|
;// CONCATENATED MODULE: ./src/x_ite/Browser/Text/PolygonText.js
|
|
15567
15629
|
/*******************************************************************************
|
|
@@ -15656,6 +15718,7 @@ Object .assign (Object .setPrototypeOf (PolygonText .prototype, Text_X3DTextGeom
|
|
|
15656
15718
|
minorAlignment = this .getMinorAlignment (),
|
|
15657
15719
|
translations = this .getTranslations (),
|
|
15658
15720
|
charSpacings = this .getCharSpacings (),
|
|
15721
|
+
scales = this .getScales (),
|
|
15659
15722
|
size = fontStyle .getScale (),
|
|
15660
15723
|
spacing = fontStyle ._spacing .getValue (),
|
|
15661
15724
|
origin = text ._origin .getValue (),
|
|
@@ -15679,8 +15742,9 @@ Object .assign (Object .setPrototypeOf (PolygonText .prototype, Text_X3DTextGeom
|
|
|
15679
15742
|
{
|
|
15680
15743
|
const
|
|
15681
15744
|
line = glyphs [l],
|
|
15745
|
+
translation = translations [l],
|
|
15682
15746
|
charSpacing = charSpacings [l],
|
|
15683
|
-
|
|
15747
|
+
scale = scales [l];
|
|
15684
15748
|
|
|
15685
15749
|
let advanceWidth = 0;
|
|
15686
15750
|
|
|
@@ -15689,14 +15753,14 @@ Object .assign (Object .setPrototypeOf (PolygonText .prototype, Text_X3DTextGeom
|
|
|
15689
15753
|
const
|
|
15690
15754
|
glyph = line [g],
|
|
15691
15755
|
glyphVertices = this .getGlyphGeometry (font, glyph, primitiveQuality),
|
|
15692
|
-
xOffset = minorAlignment .x + translation .x + advanceWidth + g * charSpacing,
|
|
15756
|
+
xOffset = minorAlignment .x + translation .x + advanceWidth * scale + g * charSpacing,
|
|
15693
15757
|
yOffset = minorAlignment .y + translation .y;
|
|
15694
15758
|
|
|
15695
|
-
for (
|
|
15759
|
+
for (const { x: glyphX, y: glyphY } of glyphVertices)
|
|
15696
15760
|
{
|
|
15697
15761
|
const
|
|
15698
|
-
x =
|
|
15699
|
-
y =
|
|
15762
|
+
x = glyphX * size * scale + xOffset,
|
|
15763
|
+
y = glyphY * size + yOffset;
|
|
15700
15764
|
|
|
15701
15765
|
texCoordArray .push ((x - origin .x) / spacing, (y - origin .y) / spacing, 0, 1);
|
|
15702
15766
|
normalArray .push (0, 0, 1);
|
|
@@ -15720,17 +15784,19 @@ Object .assign (Object .setPrototypeOf (PolygonText .prototype, Text_X3DTextGeom
|
|
|
15720
15784
|
leftToRight = fontStyle ._leftToRight .getValue (),
|
|
15721
15785
|
topToBottom = fontStyle ._topToBottom .getValue (),
|
|
15722
15786
|
first = leftToRight ? 0 : text ._string .length - 1,
|
|
15723
|
-
last = leftToRight ? text ._string .length
|
|
15787
|
+
last = leftToRight ? text ._string .length : -1,
|
|
15724
15788
|
step = leftToRight ? 1 : -1;
|
|
15725
15789
|
|
|
15726
15790
|
for (let l = first, t = 0; l !== last; l += step)
|
|
15727
15791
|
{
|
|
15728
15792
|
const
|
|
15729
|
-
line
|
|
15730
|
-
numChars
|
|
15731
|
-
firstG
|
|
15732
|
-
lastG
|
|
15733
|
-
stepG
|
|
15793
|
+
line = glyphs [l],
|
|
15794
|
+
numChars = line .length,
|
|
15795
|
+
firstG = topToBottom ? 0 : numChars - 1,
|
|
15796
|
+
lastG = topToBottom ? numChars : -1,
|
|
15797
|
+
stepG = topToBottom ? 1 : -1,
|
|
15798
|
+
charSpacing = charSpacings [l],
|
|
15799
|
+
scale = scales [l];
|
|
15734
15800
|
|
|
15735
15801
|
for (let g = firstG; g !== lastG; g += stepG, ++ t)
|
|
15736
15802
|
{
|
|
@@ -15738,11 +15804,11 @@ Object .assign (Object .setPrototypeOf (PolygonText .prototype, Text_X3DTextGeom
|
|
|
15738
15804
|
translation = translations [t],
|
|
15739
15805
|
glyphVertices = this .getGlyphGeometry (font, line [g], primitiveQuality);
|
|
15740
15806
|
|
|
15741
|
-
for (
|
|
15807
|
+
for (const { x: glyphX, y: glyphY } of glyphVertices)
|
|
15742
15808
|
{
|
|
15743
15809
|
const
|
|
15744
|
-
x =
|
|
15745
|
-
y =
|
|
15810
|
+
x = glyphX * size + minorAlignment .x + translation .x,
|
|
15811
|
+
y = glyphY * size * scale + minorAlignment .y + translation .y * scale - g * charSpacing;
|
|
15746
15812
|
|
|
15747
15813
|
texCoordArray .push ((x - origin .x) / spacing, (y - origin .y) / spacing, 0, 1);
|
|
15748
15814
|
normalArray .push (0, 0, 1);
|
|
@@ -16048,7 +16114,7 @@ Namespace_default().add ("FontStyle", "x_ite/Components/Text/FontStyle", FontSty
|
|
|
16048
16114
|
/* harmony default export */ const Text_FontStyle = (FontStyle_default_);
|
|
16049
16115
|
;// CONCATENATED MODULE: ./src/x_ite/Browser/Text/X3DTextContext.js
|
|
16050
16116
|
/* provided dependency */ var $ = __webpack_require__(823);
|
|
16051
|
-
/* provided dependency */ var opentype = __webpack_require__(
|
|
16117
|
+
/* provided dependency */ var opentype = __webpack_require__(999);
|
|
16052
16118
|
/*******************************************************************************
|
|
16053
16119
|
*
|
|
16054
16120
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
@@ -16188,10 +16254,10 @@ const X3DTextContext_default_ = X3DTextContext;
|
|
|
16188
16254
|
Namespace_default().add ("X3DTextContext", "x_ite/Browser/Text/X3DTextContext", X3DTextContext_default_);
|
|
16189
16255
|
/* harmony default export */ const Text_X3DTextContext = (X3DTextContext_default_);
|
|
16190
16256
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Rendering/X3DGeometryNode\")"
|
|
16191
|
-
const X3DGeometryNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0
|
|
16257
|
+
const X3DGeometryNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Components/Rendering/X3DGeometryNode");
|
|
16192
16258
|
var X3DGeometryNode_default = /*#__PURE__*/__webpack_require__.n(X3DGeometryNode_namespaceObject);
|
|
16193
16259
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DCast\")"
|
|
16194
|
-
const X3DCast_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.0
|
|
16260
|
+
const X3DCast_namespaceObject = window [Symbol .for ("X_ITE.X3D-10.2.0")] .require ("x_ite/Base/X3DCast");
|
|
16195
16261
|
var X3DCast_default = /*#__PURE__*/__webpack_require__.n(X3DCast_namespaceObject);
|
|
16196
16262
|
;// CONCATENATED MODULE: ./src/x_ite/Components/Text/Text.js
|
|
16197
16263
|
/*******************************************************************************
|
|
@@ -16284,14 +16350,20 @@ Object .assign (Object .setPrototypeOf (Text .prototype, (X3DGeometryNode_defaul
|
|
|
16284
16350
|
},
|
|
16285
16351
|
set_live__ ()
|
|
16286
16352
|
{
|
|
16287
|
-
|
|
16353
|
+
X3DGeometryNode_default().prototype .set_live__ .call (this);
|
|
16288
16354
|
|
|
16289
|
-
|
|
16355
|
+
const alwaysUpdate = this .isLive () && this .getBrowser () .getBrowserOption ("AlwaysUpdateGeometries");
|
|
16290
16356
|
|
|
16291
|
-
|
|
16292
|
-
|
|
16357
|
+
if (this .getLive () .getValue () || alwaysUpdate)
|
|
16358
|
+
{
|
|
16359
|
+
this .getBrowser () .getBrowserOptions () ._PrimitiveQuality .addInterest ("requestRebuild", this);
|
|
16360
|
+
this .getBrowser () .getBrowserOptions () ._TextCompression .addInterest ("requestRebuild", this);
|
|
16361
|
+
}
|
|
16293
16362
|
else
|
|
16363
|
+
{
|
|
16294
16364
|
this .getBrowser () .getBrowserOptions () ._PrimitiveQuality .removeInterest ("requestRebuild", this);
|
|
16365
|
+
this .getBrowser () .getBrowserOptions () ._TextCompression .removeInterest ("requestRebuild", this);
|
|
16366
|
+
}
|
|
16295
16367
|
},
|
|
16296
16368
|
set_fontStyle__ ()
|
|
16297
16369
|
{
|