@mlightcad/cad-simple-viewer 1.0.18 → 1.0.19

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 CHANGED
@@ -57,19 +57,15 @@ Thirdly, add the following code in the entry point of cad-simple-viewer integrat
57
57
 
58
58
  ```typescript
59
59
  import { AcApDocManager } from '@mlightcad/cad-simple-viewer'
60
- import { AcDbDatabaseConverterManager, AcDbFileType, registerConverters } from '@mlightcad/data-model'
60
+ import { AcDbDatabaseConverterManager, AcDbFileType, registerWorkers } from '@mlightcad/data-model'
61
61
 
62
- // Register DXF and DWG converters
63
- registerConverters()
62
+ // Initializes background workers used by the viewer runtime.
63
+ registerWorkers()
64
64
 
65
65
  // Get canvas DOM element by its id
66
66
  const canvas = document.getElementById('canvas') as HTMLCanvasElement
67
67
  AcApDocManager.createInstance(canvas)
68
68
 
69
- // Although it is optional, it is better to call this method to load the default fonts.
70
- // The default fonts are used if fonts used in drawing are not found.
71
- await AcApDocManager.instance.loadDefaultFonts()
72
-
73
69
  // Read the file content
74
70
  const fileContent = await this.readFile(file)
75
71
 
@@ -90,14 +86,15 @@ const success = await AcApDocManager.instance.openDocument(
90
86
  ......
91
87
  ```
92
88
 
93
- Finally, copy web worker javascript file to `dist/assets` folder.
89
+ Finally, copy web worker javascript files to `dist/assets` folder.
94
90
 
95
- Web worker are used to parser dxf/dwg file so that UI not blocked. You can copy the following web worker files to folder `dist/assets` manually.
91
+ Web worker are used to parser dxf/dwg file and render mtext entities so that UI not blocked. You can copy the following web worker files to folder `dist/assets` manually.
96
92
 
97
93
  - `./node_modules/@mlightcad/data-model/dist/dxf-parser-worker.js`
98
94
  - `./node_modules/@mlightcad/cad-simple-viewer/dist/libredwg-parser-worker.js`
95
+ - `./node_modules/@mlightcad/cad-simple-viewer/dist/mtext-renderer-worker.js`
99
96
 
100
- However, `vite-plugin-static-copy` is recommended to make your lefe easier.
97
+ However, `vite-plugin-static-copy` is recommended to make your life easier.
101
98
 
102
99
  ```typescript
103
100
  import { resolve } from 'path'
@@ -126,6 +123,10 @@ export default defineConfig(() => {
126
123
  {
127
124
  src: './node_modules/@mlightcad/cad-simple-viewer/dist/libredwg-parser-worker.js',
128
125
  dest: 'assets'
126
+ },
127
+ {
128
+ src: './node_modules/@mlightcad/cad-simple-viewer/dist/mtext-renderer-worker.js',
129
+ dest: 'assets'
129
130
  }
130
131
  ]
131
132
  })