zelos-recad 0.0.0-stage → 0.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.
Files changed (402) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +73 -2
  3. package/THIRD_PARTY_NOTICES.md +27 -0
  4. package/UPSTREAM-LICENSE +21 -0
  5. package/assets/fonts/.gitattributes +4 -0
  6. package/assets/fonts/Liberation-LICENSE.txt +102 -0
  7. package/assets/fonts/LiberationMono-Bold.ttf +0 -0
  8. package/assets/fonts/LiberationMono-BoldItalic.ttf +0 -0
  9. package/assets/fonts/LiberationMono-Italic.ttf +0 -0
  10. package/assets/fonts/LiberationMono-Regular.ttf +0 -0
  11. package/assets/fonts/LiberationSans-Bold.ttf +0 -0
  12. package/assets/fonts/LiberationSans-BoldItalic.ttf +0 -0
  13. package/assets/fonts/LiberationSans-Italic.ttf +0 -0
  14. package/assets/fonts/LiberationSans-Regular.ttf +0 -0
  15. package/assets/fonts/LiberationSerif-Bold.ttf +0 -0
  16. package/assets/fonts/LiberationSerif-BoldItalic.ttf +0 -0
  17. package/assets/fonts/LiberationSerif-Italic.ttf +0 -0
  18. package/assets/fonts/LiberationSerif-Regular.ttf +0 -0
  19. package/assets/fonts/NotoSans-LICENSE.txt +92 -0
  20. package/assets/fonts/NotoSansSC-Bold.ttf +0 -0
  21. package/assets/fonts/NotoSansSC-Regular.ttf +0 -0
  22. package/assets/fonts/NotoSerif-LICENSE.txt +92 -0
  23. package/assets/fonts/NotoSerifSC-Regular.ttf +0 -0
  24. package/assets/fonts/README.md +25 -0
  25. package/assets/fonts/manifest.json +127 -0
  26. package/assets/fonts/sources.json +147 -0
  27. package/assets/fonts/substitutions.json +139 -0
  28. package/build-info.json +26 -0
  29. package/mcp/index.d.ts +3 -0
  30. package/mcp/index.js +20 -0
  31. package/package.json +140 -4
  32. package/protocol/src/bundle.d.ts +96 -0
  33. package/protocol/src/bundle.js +83 -0
  34. package/protocol/src/client.d.ts +3 -0
  35. package/protocol/src/client.js +6 -0
  36. package/protocol/src/contracts.d.ts +224 -0
  37. package/protocol/src/contracts.js +196 -0
  38. package/protocol/src/native-evidence.d.ts +166 -0
  39. package/protocol/src/native-evidence.js +93 -0
  40. package/protocol/src/resource-manifest.d.ts +24 -0
  41. package/protocol/src/resource-manifest.js +27 -0
  42. package/protocol/src/resource-path.d.ts +5 -0
  43. package/protocol/src/resource-path.js +44 -0
  44. package/requirements.txt +2 -0
  45. package/scripts/check_runtime.py +21 -0
  46. package/scripts/extract_font_face.py +16 -0
  47. package/scripts/finish_pdf.py +76 -0
  48. package/scripts/index_fonts.py +57 -0
  49. package/scripts/rasterize.py +38 -0
  50. package/service/app.d.ts +8 -0
  51. package/service/app.js +110 -0
  52. package/service/main.d.ts +2 -0
  53. package/service/main.js +4 -0
  54. package/service/options.d.ts +3 -0
  55. package/service/options.js +24 -0
  56. package/shared/build-identity.d.mts +6 -0
  57. package/shared/build-identity.mjs +63 -0
  58. package/shared/client.d.mts +20 -0
  59. package/shared/client.mjs +123 -0
  60. package/shared/command.d.mts +10 -0
  61. package/shared/command.mjs +74 -0
  62. package/shared/contracts/src/paths.d.ts +3 -0
  63. package/shared/contracts/src/paths.js +31 -0
  64. package/shared/mcp.d.mts +13 -0
  65. package/shared/mcp.mjs +232 -0
  66. package/shared/service-storage/src/capacity.d.ts +36 -0
  67. package/shared/service-storage/src/capacity.js +71 -0
  68. package/shared/service-storage/src/consumption.d.ts +15 -0
  69. package/shared/service-storage/src/consumption.js +27 -0
  70. package/shared/service-storage/src/documents.d.ts +43 -0
  71. package/shared/service-storage/src/documents.js +210 -0
  72. package/shared/service-storage/src/downloads.d.ts +10 -0
  73. package/shared/service-storage/src/downloads.js +58 -0
  74. package/shared/service-storage/src/files.d.ts +18 -0
  75. package/shared/service-storage/src/files.js +118 -0
  76. package/shared/service-storage/src/footprint.d.ts +14 -0
  77. package/shared/service-storage/src/footprint.js +72 -0
  78. package/shared/service-storage/src/process-temp.d.ts +22 -0
  79. package/shared/service-storage/src/process-temp.js +181 -0
  80. package/shared/service-storage/src/quota.d.ts +30 -0
  81. package/shared/service-storage/src/quota.js +166 -0
  82. package/shared/service-storage/src/retention.d.ts +38 -0
  83. package/shared/service-storage/src/retention.js +148 -0
  84. package/shared/service-storage/src/staging.d.ts +15 -0
  85. package/shared/service-storage/src/staging.js +116 -0
  86. package/source/README.md +3 -0
  87. package/source/mcp/index.ts +16 -0
  88. package/source/package.json +45 -0
  89. package/source/protocol/src/bundle.ts +96 -0
  90. package/source/protocol/src/client.ts +7 -0
  91. package/source/protocol/src/contracts.ts +219 -0
  92. package/source/protocol/src/native-evidence.ts +212 -0
  93. package/source/protocol/src/resource-manifest.ts +29 -0
  94. package/source/protocol/src/resource-path.ts +57 -0
  95. package/source/rebuild.mjs +31 -0
  96. package/source/service/app.ts +124 -0
  97. package/source/service/main.ts +4 -0
  98. package/source/service/options.ts +24 -0
  99. package/source/shared/build-identity.d.mts +6 -0
  100. package/source/shared/build-identity.mjs +63 -0
  101. package/source/shared/client.d.mts +20 -0
  102. package/source/shared/client.mjs +123 -0
  103. package/source/shared/command.d.mts +10 -0
  104. package/source/shared/command.mjs +74 -0
  105. package/source/shared/contracts/src/paths.ts +33 -0
  106. package/source/shared/mcp.d.mts +13 -0
  107. package/source/shared/mcp.mjs +232 -0
  108. package/source/shared/service-storage/src/capacity.ts +101 -0
  109. package/source/shared/service-storage/src/consumption.ts +45 -0
  110. package/source/shared/service-storage/src/documents.ts +262 -0
  111. package/source/shared/service-storage/src/downloads.ts +62 -0
  112. package/source/shared/service-storage/src/files.ts +135 -0
  113. package/source/shared/service-storage/src/footprint.ts +78 -0
  114. package/source/shared/service-storage/src/process-temp.ts +205 -0
  115. package/source/shared/service-storage/src/quota.ts +198 -0
  116. package/source/shared/service-storage/src/retention.ts +180 -0
  117. package/source/shared/service-storage/src/staging.ts +106 -0
  118. package/source/src/application-objects.ts +64 -0
  119. package/source/src/assets.ts +15 -0
  120. package/source/src/base-fonts.ts +144 -0
  121. package/source/src/binary-dxf.ts +119 -0
  122. package/source/src/block-array.ts +67 -0
  123. package/source/src/block-clip.ts +294 -0
  124. package/source/src/block-metadata.ts +278 -0
  125. package/source/src/build-info.ts +15 -0
  126. package/source/src/bundle.ts +2 -0
  127. package/source/src/cad-engine.ts +380 -0
  128. package/source/src/cad-options.ts +12 -0
  129. package/source/src/cli.ts +41 -0
  130. package/source/src/clip-bounds.ts +181 -0
  131. package/source/src/command.ts +31 -0
  132. package/source/src/constraints.ts +83 -0
  133. package/source/src/contracts.ts +2 -0
  134. package/source/src/conversion.ts +2 -0
  135. package/source/src/dwg-dictionaries.ts +31 -0
  136. package/source/src/dwg-fallback.ts +68 -0
  137. package/source/src/dwg-viewports.ts +61 -0
  138. package/source/src/dwg.ts +193 -0
  139. package/source/src/dxf-database.ts +168 -0
  140. package/source/src/dxf-export.ts +414 -0
  141. package/source/src/dxf.ts +441 -0
  142. package/source/src/embedded-mtext.ts +157 -0
  143. package/source/src/font-options.ts +6 -0
  144. package/source/src/full-arc-adapter.ts +43 -0
  145. package/source/src/index.ts +8 -0
  146. package/source/src/io.ts +34 -0
  147. package/source/src/layout-bounds.ts +64 -0
  148. package/source/src/layouts.ts +182 -0
  149. package/source/src/leader.ts +241 -0
  150. package/source/src/legacy-columns.ts +356 -0
  151. package/source/src/line-type.ts +196 -0
  152. package/source/src/native-circular-path.ts +17 -0
  153. package/source/src/native-evidence.ts +224 -0
  154. package/source/src/native-linear-path.ts +23 -0
  155. package/source/src/native-segmented-path.ts +29 -0
  156. package/source/src/plot-regions.ts +169 -0
  157. package/source/src/point-dictionaries.ts +65 -0
  158. package/source/src/print-plan.ts +181 -0
  159. package/source/src/print-style.ts +23 -0
  160. package/source/src/raster-image.ts +179 -0
  161. package/source/src/readback.ts +108 -0
  162. package/source/src/reader-adapters.ts +225 -0
  163. package/source/src/reader.ts +315 -0
  164. package/source/src/render-operation.ts +583 -0
  165. package/source/src/resource-loading.ts +74 -0
  166. package/source/src/resource-manifest.ts +2 -0
  167. package/source/src/resource-path.ts +2 -0
  168. package/source/src/runner.ts +295 -0
  169. package/source/src/runtime/documents.ts +34 -0
  170. package/source/src/runtime/font-catalog.ts +44 -0
  171. package/source/src/runtime/index.ts +260 -0
  172. package/source/src/runtime/jobs.ts +460 -0
  173. package/source/src/runtime/managed-worker.ts +37 -0
  174. package/source/src/runtime/readiness.ts +106 -0
  175. package/source/src/runtime/storage-policy.ts +39 -0
  176. package/source/src/runtime/storage.ts +9 -0
  177. package/source/src/runtime-paths.ts +19 -0
  178. package/source/src/scope.ts +146 -0
  179. package/source/src/setup.ts +53 -0
  180. package/source/src/source-scene.ts +422 -0
  181. package/source/src/text/AcPdfMTextParser.ts +277 -0
  182. package/source/src/text/AcPdfTextLayout.ts +606 -0
  183. package/source/src/text/affine-writer.ts +40 -0
  184. package/source/src/text/best-effort.ts +124 -0
  185. package/source/src/text/bigfont.ts +206 -0
  186. package/source/src/text/fallback.ts +201 -0
  187. package/source/src/text/fonts.ts +263 -0
  188. package/source/src/text/glyphs.ts +63 -0
  189. package/source/src/text/imports.ts +240 -0
  190. package/source/src/text/ink-bounds.ts +35 -0
  191. package/source/src/text/render.ts +248 -0
  192. package/source/src/text/scene-geometry.ts +92 -0
  193. package/source/src/text/shape-vm.ts +221 -0
  194. package/source/src/text/shape.ts +38 -0
  195. package/source/src/text/shx-module.d.ts +11 -0
  196. package/source/src/text/single-line-codes.ts +22 -0
  197. package/source/src/text/single-line.ts +260 -0
  198. package/source/src/text/source-fonts.ts +31 -0
  199. package/source/src/text/style.ts +8 -0
  200. package/source/src/text/styles.ts +21 -0
  201. package/source/src/text-columns.ts +114 -0
  202. package/source/src/text-mask.ts +182 -0
  203. package/source/src/vendor-object-data.ts +265 -0
  204. package/source/src/worker.ts +107 -0
  205. package/source/src/xref.ts +374 -0
  206. package/source/tsconfig.json +29 -0
  207. package/src/application-objects.d.ts +4 -0
  208. package/src/application-objects.js +56 -0
  209. package/src/assets.d.ts +9 -0
  210. package/src/assets.js +14 -0
  211. package/src/base-fonts.d.ts +38 -0
  212. package/src/base-fonts.js +118 -0
  213. package/src/binary-dxf.d.ts +6 -0
  214. package/src/binary-dxf.js +127 -0
  215. package/src/block-array.d.ts +10 -0
  216. package/src/block-array.js +53 -0
  217. package/src/block-clip.d.ts +42 -0
  218. package/src/block-clip.js +250 -0
  219. package/src/block-metadata.d.ts +39 -0
  220. package/src/block-metadata.js +228 -0
  221. package/src/build-info.d.ts +2 -0
  222. package/src/build-info.js +14 -0
  223. package/src/bundle.d.ts +1 -0
  224. package/src/bundle.js +2 -0
  225. package/src/cad-engine.d.ts +2 -0
  226. package/src/cad-engine.js +339 -0
  227. package/src/cad-options.d.ts +11 -0
  228. package/src/cad-options.js +1 -0
  229. package/src/cli.d.ts +2 -0
  230. package/src/cli.js +38 -0
  231. package/src/clip-bounds.d.ts +5 -0
  232. package/src/clip-bounds.js +179 -0
  233. package/src/command.d.ts +2 -0
  234. package/src/command.js +42 -0
  235. package/src/constraints.d.ts +3 -0
  236. package/src/constraints.js +69 -0
  237. package/src/contracts.d.ts +1 -0
  238. package/src/contracts.js +2 -0
  239. package/src/conversion.d.ts +2 -0
  240. package/src/conversion.js +2 -0
  241. package/src/dwg-dictionaries.d.ts +4 -0
  242. package/src/dwg-dictionaries.js +37 -0
  243. package/src/dwg-fallback.d.ts +47 -0
  244. package/src/dwg-fallback.js +38 -0
  245. package/src/dwg-viewports.d.ts +4 -0
  246. package/src/dwg-viewports.js +56 -0
  247. package/src/dwg.d.ts +27 -0
  248. package/src/dwg.js +192 -0
  249. package/src/dxf-database.d.ts +16 -0
  250. package/src/dxf-database.js +176 -0
  251. package/src/dxf-export.d.ts +98 -0
  252. package/src/dxf-export.js +391 -0
  253. package/src/dxf.d.ts +55 -0
  254. package/src/dxf.js +405 -0
  255. package/src/embedded-mtext.d.ts +7 -0
  256. package/src/embedded-mtext.js +155 -0
  257. package/src/font-options.d.ts +6 -0
  258. package/src/font-options.js +1 -0
  259. package/src/full-arc-adapter.d.ts +4 -0
  260. package/src/full-arc-adapter.js +41 -0
  261. package/src/index.d.ts +8 -0
  262. package/src/index.js +6 -0
  263. package/src/io.d.ts +5 -0
  264. package/src/io.js +23 -0
  265. package/src/layout-bounds.d.ts +10 -0
  266. package/src/layout-bounds.js +70 -0
  267. package/src/layouts.d.ts +112 -0
  268. package/src/layouts.js +145 -0
  269. package/src/leader.d.ts +10 -0
  270. package/src/leader.js +239 -0
  271. package/src/legacy-columns.d.ts +36 -0
  272. package/src/legacy-columns.js +302 -0
  273. package/src/line-type.d.ts +15 -0
  274. package/src/line-type.js +182 -0
  275. package/src/native-circular-path.d.ts +15 -0
  276. package/src/native-circular-path.js +21 -0
  277. package/src/native-evidence.d.ts +44 -0
  278. package/src/native-evidence.js +218 -0
  279. package/src/native-linear-path.d.ts +5 -0
  280. package/src/native-linear-path.js +31 -0
  281. package/src/native-segmented-path.d.ts +6 -0
  282. package/src/native-segmented-path.js +39 -0
  283. package/src/plot-regions.d.ts +100 -0
  284. package/src/plot-regions.js +167 -0
  285. package/src/point-dictionaries.d.ts +12 -0
  286. package/src/point-dictionaries.js +88 -0
  287. package/src/print-plan.d.ts +83 -0
  288. package/src/print-plan.js +171 -0
  289. package/src/print-style.d.ts +5 -0
  290. package/src/print-style.js +21 -0
  291. package/src/raster-image.d.ts +26 -0
  292. package/src/raster-image.js +134 -0
  293. package/src/readback.d.ts +70 -0
  294. package/src/readback.js +105 -0
  295. package/src/reader-adapters.d.ts +5 -0
  296. package/src/reader-adapters.js +219 -0
  297. package/src/reader.d.ts +105 -0
  298. package/src/reader.js +281 -0
  299. package/src/render-operation.d.ts +30 -0
  300. package/src/render-operation.js +480 -0
  301. package/src/resource-loading.d.ts +10 -0
  302. package/src/resource-loading.js +65 -0
  303. package/src/resource-manifest.d.ts +1 -0
  304. package/src/resource-manifest.js +2 -0
  305. package/src/resource-path.d.ts +1 -0
  306. package/src/resource-path.js +2 -0
  307. package/src/runner.d.ts +23 -0
  308. package/src/runner.js +255 -0
  309. package/src/runtime/documents.d.ts +12 -0
  310. package/src/runtime/documents.js +28 -0
  311. package/src/runtime/font-catalog.d.ts +2 -0
  312. package/src/runtime/font-catalog.js +37 -0
  313. package/src/runtime/index.d.ts +155 -0
  314. package/src/runtime/index.js +234 -0
  315. package/src/runtime/jobs.d.ts +103 -0
  316. package/src/runtime/jobs.js +395 -0
  317. package/src/runtime/managed-worker.d.ts +8 -0
  318. package/src/runtime/managed-worker.js +29 -0
  319. package/src/runtime/readiness.d.ts +4 -0
  320. package/src/runtime/readiness.js +106 -0
  321. package/src/runtime/storage-policy.d.ts +25 -0
  322. package/src/runtime/storage-policy.js +29 -0
  323. package/src/runtime/storage.d.ts +1 -0
  324. package/src/runtime/storage.js +1 -0
  325. package/src/runtime-paths.d.ts +3 -0
  326. package/src/runtime-paths.js +12 -0
  327. package/src/scope.d.ts +24 -0
  328. package/src/scope.js +137 -0
  329. package/src/setup.d.ts +4 -0
  330. package/src/setup.js +71 -0
  331. package/src/source-scene.d.ts +17 -0
  332. package/src/source-scene.js +400 -0
  333. package/src/text/AcPdfMTextParser.d.ts +61 -0
  334. package/src/text/AcPdfMTextParser.js +198 -0
  335. package/src/text/AcPdfTextLayout.d.ts +123 -0
  336. package/src/text/AcPdfTextLayout.js +446 -0
  337. package/src/text/affine-writer.d.ts +4 -0
  338. package/src/text/affine-writer.js +35 -0
  339. package/src/text/best-effort.d.ts +17 -0
  340. package/src/text/best-effort.js +119 -0
  341. package/src/text/bigfont.d.ts +19 -0
  342. package/src/text/bigfont.js +210 -0
  343. package/src/text/fallback.d.ts +9 -0
  344. package/src/text/fallback.js +186 -0
  345. package/src/text/fonts.d.ts +49 -0
  346. package/src/text/fonts.js +222 -0
  347. package/src/text/glyphs.d.ts +12 -0
  348. package/src/text/glyphs.js +53 -0
  349. package/src/text/imports.d.ts +55 -0
  350. package/src/text/imports.js +212 -0
  351. package/src/text/ink-bounds.d.ts +12 -0
  352. package/src/text/ink-bounds.js +32 -0
  353. package/src/text/render.d.ts +5 -0
  354. package/src/text/render.js +222 -0
  355. package/src/text/scene-geometry.d.ts +21 -0
  356. package/src/text/scene-geometry.js +70 -0
  357. package/src/text/shape-vm.d.ts +10 -0
  358. package/src/text/shape-vm.js +222 -0
  359. package/src/text/shape.d.ts +2 -0
  360. package/src/text/shape.js +30 -0
  361. package/src/text/single-line-codes.d.ts +8 -0
  362. package/src/text/single-line-codes.js +20 -0
  363. package/src/text/single-line.d.ts +4 -0
  364. package/src/text/single-line.js +228 -0
  365. package/src/text/source-fonts.d.ts +7 -0
  366. package/src/text/source-fonts.js +30 -0
  367. package/src/text/style.d.ts +6 -0
  368. package/src/text/style.js +3 -0
  369. package/src/text/styles.d.ts +3 -0
  370. package/src/text/styles.js +22 -0
  371. package/src/text-columns.d.ts +13 -0
  372. package/src/text-columns.js +93 -0
  373. package/src/text-mask.d.ts +7 -0
  374. package/src/text-mask.js +170 -0
  375. package/src/vendor-object-data.d.ts +19 -0
  376. package/src/vendor-object-data.js +241 -0
  377. package/src/worker.d.ts +1 -0
  378. package/src/worker.js +95 -0
  379. package/src/xref.d.ts +13 -0
  380. package/src/xref.js +319 -0
  381. package/vendor/libredwg/COPYING +674 -0
  382. package/vendor/libredwg/Dockerfile +26 -0
  383. package/vendor/libredwg/README.md +89 -0
  384. package/vendor/libredwg/application-objects.patch +100 -0
  385. package/vendor/libredwg/attrib-tail.patch +19 -0
  386. package/vendor/libredwg/build-local.sh +37 -0
  387. package/vendor/libredwg/constraint-group.patch +219 -0
  388. package/vendor/libredwg/constraint-r2004.patch +73 -0
  389. package/vendor/libredwg/dictionary-text.patch +52 -0
  390. package/vendor/libredwg/dxf-assoc.patch +7 -0
  391. package/vendor/libredwg/dxf-width.patch +44 -0
  392. package/vendor/libredwg/eed-binding.patch +147 -0
  393. package/vendor/libredwg/embedded-mtext.patch +178 -0
  394. package/vendor/libredwg/libredwg-web.js +2 -0
  395. package/vendor/libredwg/libredwg-web.wasm +0 -0
  396. package/vendor/libredwg/manifest.json +33 -0
  397. package/vendor/libredwg/mtext-mask.patch +36 -0
  398. package/vendor/libredwg/object-recovery.patch +105 -0
  399. package/vendor/libredwg/opaque-object-binding.patch +29 -0
  400. package/vendor/libredwg/rebuild.mjs +52 -0
  401. package/vendor/libredwg/source.tar.gz +0 -0
  402. package/vendor/libredwg/text-style.patch +64 -0
package/README.md CHANGED
@@ -1,3 +1,74 @@
1
- # Temporary Holding Version
1
+ # zelos-recad
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 以下说明对应 0.2.0。实际发布版本与通道以 npm dist-tags 为准。
4
+
5
+ DWG/DXF 读取、布局、场景证据、结构读回,以及 PDF/PNG 渲染。一个 npm 包统一提供代码调用、REST 服务、stdio 与 Streamable HTTP MCP。各入口共用持久任务、文档存储及成果核验。
6
+
7
+ ## 安装
8
+
9
+ 需要 Node.js >=24.13.0。本地处理需要 Python >=3.10;首次本地服务/MCP 启动会在用户数据目录准备固定版本的 PyMuPDF 和 fonttools。也可用 RECAD_PYTHON 指向已有的匹配环境。
10
+
11
+ ```sh
12
+ npm install zelos-recad@0.2.0
13
+ npx zelos-recad setup
14
+ npx zelos-recad doctor
15
+ ```
16
+
17
+ 运行数据默认位于 env-paths 的 recad 用户数据目录,Windows 为 %LOCALAPPDATA%/recad/Data。用 --data-dir 或 RECAD_DATA_DIR 配置。安装目录仅放代码和资源。Python 准备阶段需要访问包源,后续启动复用已准备环境。
18
+
19
+ 默认端口:REST `18771`,HTTP MCP `18773`。`--port` 优先于 `RECAD_PORT`,`--port 0` 由系统分配端口;stdio 使用进程管道。
20
+
21
+ ## MCP
22
+
23
+ 本机 stdio:
24
+
25
+ ```sh
26
+ npx zelos-recad mcp --transport stdio --backend local --input-root /project/drawings --output-root /project/results --data-dir /project/recad-data
27
+ ```
28
+
29
+ Streamable HTTP:先通过部署环境配置 RECAD_TOKEN(至少16字符),再启动:
30
+
31
+ ```sh
32
+ npx zelos-recad mcp --transport http --backend local --host 127.0.0.1 --port 18773 --data-dir /project/recad-data
33
+ ```
34
+
35
+ 客户端连接 /mcp,Authorization: Bearer <token>。同一凭据用于 POST /v1/documents?fileName=source.dxf 上传原始字节(Content-Type: application/octet-stream),以及 GET /v1/jobs/<jobId>/artifacts/<name> 下载。HTTP 工具使用上传回执中的 documentId。授权按实例配置;不同调用系统分配独立数据根和凭据。外部域名配置 --allowed-host domain:port,浏览器请求额外配置 --allowed-origin https://domain,并由部署入口提供 TLS。
36
+
37
+ 复用已部署 REST 服务时,用 --backend remote --url http://service:port,并在 RECAD_BACKEND_TOKEN 中配置后端凭据。stdio/HTTP 都支持 local/remote;remote 启动只连接已部署服务。
38
+
39
+ 专业工具沿现有 schema 生成,cad_layouts/inspect/readback/scene/render。先 open_document,提交时传调用方生成并保存的 UUID jobId,再用 job_status/job_wait/job_cancel 和 read_artifact。同 ID 同输入可恢复回执;冲突返回稳定错误。job_wait 最长30秒;取消等待保留后台作业,job_cancel取消作业。图片以标准 MCP image 内容返回。文本最多256KiB,图片最多4MiB(Base64编码前);大成果用下载或 stdio export。
40
+
41
+ HTTP会话重建和进程重启后可以查询同一jobId。stdio local退出时关闭自有运行实例;同数据根同时运行由实例锁保护。
42
+
43
+ ## 独立 REST 服务
44
+
45
+ ```sh
46
+ npx zelos-recad serve --host 127.0.0.1 --port 18771 --data-dir /project/recad-data
47
+ ```
48
+
49
+ 继续使用 /v1/documents、/v1/documents/:id/jobs、/v1/jobs/:id、/v1/owners/:owner 和成果下载接口。RECAD_TOKEN 配置实例凭据。并发、执行超时、保留期和容量可通过 --concurrency、--timeout-ms、--retention-days、--max-storage-mib 配置。
50
+
51
+ 临时任务默认保留两天。存储保护默认预留 5 GiB 磁盘空间,暂停后恢复额外要求 2 GiB,估算系数 1.2,每个 worker 初始预算 600 MiB。分别用 `RECAD_RETENTION_DAYS`、`RECAD_MIN_FREE_GIB`、`RECAD_RESUME_EXTRA_GIB`、`RECAD_STORAGE_ESTIMATE_FACTOR`、`RECAD_WORKER_STORAGE_MIB` 或对应 CLI 参数配置。`RECAD_MAX_STORAGE_MIB` 为实例逻辑配额,默认 0 表示使用磁盘水位保护。
52
+
53
+ 成果在调用方持久保存并核验后,可向 `POST /v1/jobs/:id/consumed` 发送 `{status, sourceSha256, artifacts}`,artifacts 包含完整成果及诊断的 `{name, sha256, bytes}`。成功返回 `{id, consumedAt}`;兼容已有 `{owner, sourceSha256, artifacts}` 成功任务回执,并附带 `consumed: true`。消费确认可提前释放临时工件,活动上传、执行和下载由运行层保护。
54
+
55
+ ## 代码入口
56
+
57
+ - zelos-recad:原专业引擎。
58
+ - zelos-recad/protocol:请求/结果 schema 与能力合同。
59
+ - zelos-recad/client:createRecadClient({url, token}),异步提交与查询、上传、带大小/SHA256核验的成果流。
60
+ - zelos-recad/runtime:createRecadRuntime({data, python}),复用持久任务队列和隔离worker;使用后await close()。
61
+ - zelos-recad/runtime:runManagedWorker(options, controls, storage),供本地逐次处理共用磁盘准入和增长检查;输出临时目录由宿主创建和清理。withRecadStorage 可将同一保护用于转换调用。
62
+ - zelos-recad/assets:getRecadAssets() 返回字体、替代表、Python requirements 及 decoder manifest 的安装路径;getRecadBuildInfo() 返回版本、代码/资源/decoder SHA 和稳定 fingerprint,供派生缓存绑定制品身份。
63
+ - zelos-recad/conversion:createNativeDxfCandidate(dwgBytes) 复用既有 DWG 到 DXF 候选转换和诊断;调用方继续核验生成结果。
64
+ - zelos-recad/service:createRecadApp,供宿主挂载REST。
65
+ - zelos-recad/mcp:startRecadMcp,供宿主启动MCP。
66
+ - zelos-recad/setup:prepareRecadRuntime,返回已准备的Python路径。
67
+
68
+ 旧 recad 文件处理命令与 recad-service 启动别名保留。统一命令 run 接受 --input FILE --output NEW_DIRECTORY --request REQUEST_JSON。
69
+
70
+ 能力版本 34 汇合自动图幅 `render.print: "auto"`、整模型单页 `scene.sheetMode: "single"`、文字字形/字体资源、原生 `source-records` 读回和既有原生对象修复。每个操作仍沿公开请求 schema,报告附带构建身份;服务 UUID 幂等继续使用原请求及资源身份。
71
+
72
+ ## 开源、来源与重建
73
+
74
+ AGPL-3.0-or-later。随包 LICENSE、THIRD_PARTY_NOTICES.md、source/提供许可、来源和可编辑源码。源码重建步骤见 source/README.md。LibreDWG对应源码、补丁、哈希及重建说明位于vendor/libredwg;字体许可证随assets/fonts提供。服务器运营方应按许可证向用户提供所运行版本的对应源码。升级前保留原版本、配置和数据目录备份,保持一个运行实例持有一个数据根。
@@ -0,0 +1,27 @@
1
+ # Third-party notices and source
2
+
3
+ Zelos recad is distributed under AGPL-3.0-or-later. Original third-party copyrights and licenses remain in force. Editable project source is in `source/`; Python scripts and (CAD) the decoder sources/build recipe ship alongside the runtime.
4
+
5
+ | Direct dependency | Fixed version | License | Source repository |
6
+ | --- | --- | --- | --- |
7
+ | @mlightcad/data-model | 1.15.2 | MIT | https://github.com/mlightcad/realdwg-web |
8
+ | @mlightcad/libredwg-converter | 3.15.2 | GPL-3.0 | https://github.com/mlightcad/realdwg-web |
9
+ | @mlightcad/libredwg-web | 0.7.15 | GPL-3.0 | https://github.com/mlightcad/libredwg-web |
10
+ | @mlightcad/mtext-parser | 1.5.3 | MIT | https://github.com/mlightcad/mtext-parser |
11
+ | @mlightcad/pdf-renderer | 1.7.4 | MIT | https://github.com/mlightcad/cad-viewer.git |
12
+ | @mlightcad/shx-parser | 1.4.5 | MIT | https://github.com/mlightcad/shx-parser |
13
+ | env-paths | 3.0.0 | MIT | sindresorhus/env-paths |
14
+ | fastify | 5.12.5 | MIT | git+https://github.com/fastify/fastify.git |
15
+ | iconv-lite | 0.7.0 | MIT | https://github.com/pillarjs/iconv-lite.git |
16
+ | pdf-lib | 1.17.1 | MIT | git+https://github.com/Hopding/pdf-lib.git |
17
+ | proper-lockfile | 4.1.2 | MIT | git@github.com:moxystudio/node-proper-lockfile.git |
18
+ | zod | 4.6.7 | MIT | git+https://github.com/colinhacks/zod.git |
19
+ | @modelcontextprotocol/sdk | 1.32.2 | MIT | git+https://github.com/modelcontextprotocol/typescript-sdk.git |
20
+
21
+ MuPDF.js 1.28.1: AGPL-3.0-or-later / commercial licensing; corresponding upstream source: https://github.com/ArtifexSoftware/mupdf.js (tag 1.28.1), MuPDF https://mupdf.com/releases/ and https://cgit.ghostscript.com/mupdf.git/ (1.28.1). Installed npm dependency retains its LICENSE.
22
+
23
+ PyMuPDF 1.28.2: AGPL-3.0-or-later / commercial licensing; https://github.com/pymupdf/PyMuPDF/tree/1.28.2 . fonttools 4.65.0: MIT; https://github.com/fonttools/fonttools/tree/4.65.0 . Both exact runtime requirements are in requirements.txt.
24
+
25
+ Modified LibreDWG decoder: GPL-3.0-or-later. `vendor/libredwg/COPYING`, `manifest.json`, `source.tar.gz`, all patches, and build-local.sh document and reproduce the distributed decoder. Original MLightCAD notice is in UPSTREAM-LICENSE.
26
+
27
+ Bundled Noto and Liberation fonts: preserve assets/fonts/*LICENSE.txt and manifest.json; their respective font licenses govern redistribution.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 mlightcad
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,4 @@
1
+ # Hash-bound deployment assets must retain identical bytes on every platform.
2
+ *.ttf -text
3
+ *.txt -text
4
+ *.json -text
@@ -0,0 +1,102 @@
1
+ Digitized data copyright (c) 2010 Google Corporation
2
+ with Reserved Font Arimo, Tinos and Cousine.
3
+ Copyright (c) 2012 Red Hat, Inc.
4
+ with Reserved Font Name Liberation.
5
+
6
+ This Font Software is licensed under the SIL Open Font License,
7
+ Version 1.1.
8
+
9
+ This license is copied below, and is also available with a FAQ at:
10
+ http://scripts.sil.org/OFL
11
+
12
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
13
+
14
+ PREAMBLE The goals of the Open Font License (OFL) are to stimulate
15
+ worldwide development of collaborative font projects, to support the font
16
+ creation efforts of academic and linguistic communities, and to provide
17
+ a free and open framework in which fonts may be shared and improved in
18
+ partnership with others.
19
+
20
+ The OFL allows the licensed fonts to be used, studied, modified and
21
+ redistributed freely as long as they are not sold by themselves.
22
+ The fonts, including any derivative works, can be bundled, embedded,
23
+ redistributed and/or sold with any software provided that any reserved
24
+ names are not used by derivative works. The fonts and derivatives,
25
+ however, cannot be released under any other type of license. The
26
+ requirement for fonts to remain under this license does not apply to
27
+ any document created using the fonts or their derivatives.
28
+
29
+
30
+
31
+ DEFINITIONS
32
+ "Font Software" refers to the set of files released by the Copyright
33
+ Holder(s) under this license and clearly marked as such.
34
+ This may include source files, build scripts and documentation.
35
+
36
+ "Reserved Font Name" refers to any names specified as such after the
37
+ copyright statement(s).
38
+
39
+ "Original Version" refers to the collection of Font Software components
40
+ as distributed by the Copyright Holder(s).
41
+
42
+ "Modified Version" refers to any derivative made by adding to, deleting,
43
+ or substituting ? in part or in whole ?
44
+ any of the components of the Original Version, by changing formats or
45
+ by porting the Font Software to a new environment.
46
+
47
+ "Author" refers to any designer, engineer, programmer, technical writer
48
+ or other person who contributed to the Font Software.
49
+
50
+
51
+ PERMISSION & CONDITIONS
52
+
53
+ Permission is hereby granted, free of charge, to any person obtaining a
54
+ copy of the Font Software, to use, study, copy, merge, embed, modify,
55
+ redistribute, and sell modified and unmodified copies of the Font
56
+ Software, subject to the following conditions:
57
+
58
+ 1) Neither the Font Software nor any of its individual components,in
59
+ Original or Modified Versions, may be sold by itself.
60
+
61
+ 2) Original or Modified Versions of the Font Software may be bundled,
62
+ redistributed and/or sold with any software, provided that each copy
63
+ contains the above copyright notice and this license. These can be
64
+ included either as stand-alone text files, human-readable headers or
65
+ in the appropriate machine-readable metadata fields within text or
66
+ binary files as long as those fields can be easily viewed by the user.
67
+
68
+ 3) No Modified Version of the Font Software may use the Reserved Font
69
+ Name(s) unless explicit written permission is granted by the
70
+ corresponding Copyright Holder. This restriction only applies to the
71
+ primary font name as presented to the users.
72
+
73
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
74
+ Software shall not be used to promote, endorse or advertise any
75
+ Modified Version, except to acknowledge the contribution(s) of the
76
+ Copyright Holder(s) and the Author(s) or with their explicit written
77
+ permission.
78
+
79
+ 5) The Font Software, modified or unmodified, in part or in whole, must
80
+ be distributed entirely under this license, and must not be distributed
81
+ under any other license. The requirement for fonts to remain under
82
+ this license does not apply to any document created using the Font
83
+ Software.
84
+
85
+
86
+
87
+ TERMINATION
88
+ This license becomes null and void if any of the above conditions are not met.
89
+
90
+
91
+
92
+ DISCLAIMER
93
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
94
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
95
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
96
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
97
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
98
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
99
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
100
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER
101
+ DEALINGS IN THE FONT SOFTWARE.
102
+
@@ -0,0 +1,92 @@
1
+ This Font Software is licensed under the SIL Open Font License,
2
+ Version 1.1.
3
+
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+ -----------------------------------------------------------
8
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
9
+ -----------------------------------------------------------
10
+
11
+ PREAMBLE
12
+ The goals of the Open Font License (OFL) are to stimulate worldwide
13
+ development of collaborative font projects, to support the font
14
+ creation efforts of academic and linguistic communities, and to
15
+ provide a free and open framework in which fonts may be shared and
16
+ improved in partnership with others.
17
+
18
+ The OFL allows the licensed fonts to be used, studied, modified and
19
+ redistributed freely as long as they are not sold by themselves. The
20
+ fonts, including any derivative works, can be bundled, embedded,
21
+ redistributed and/or sold with any software provided that any reserved
22
+ names are not used by derivative works. The fonts and derivatives,
23
+ however, cannot be released under any other type of license. The
24
+ requirement for fonts to remain under this license does not apply to
25
+ any document created using the fonts or their derivatives.
26
+
27
+ DEFINITIONS
28
+ "Font Software" refers to the set of files released by the Copyright
29
+ Holder(s) under this license and clearly marked as such. This may
30
+ include source files, build scripts and documentation.
31
+
32
+ "Reserved Font Name" refers to any names specified as such after the
33
+ copyright statement(s).
34
+
35
+ "Original Version" refers to the collection of Font Software
36
+ components as distributed by the Copyright Holder(s).
37
+
38
+ "Modified Version" refers to any derivative made by adding to,
39
+ deleting, or substituting -- in part or in whole -- any of the
40
+ components of the Original Version, by changing formats or by porting
41
+ the Font Software to a new environment.
42
+
43
+ "Author" refers to any designer, engineer, programmer, technical
44
+ writer or other person who contributed to the Font Software.
45
+
46
+ PERMISSION & CONDITIONS
47
+ Permission is hereby granted, free of charge, to any person obtaining
48
+ a copy of the Font Software, to use, study, copy, merge, embed,
49
+ modify, redistribute, and sell modified and unmodified copies of the
50
+ Font Software, subject to the following conditions:
51
+
52
+ 1) Neither the Font Software nor any of its individual components, in
53
+ Original or Modified Versions, may be sold by itself.
54
+
55
+ 2) Original or Modified Versions of the Font Software may be bundled,
56
+ redistributed and/or sold with any software, provided that each copy
57
+ contains the above copyright notice and this license. These can be
58
+ included either as stand-alone text files, human-readable headers or
59
+ in the appropriate machine-readable metadata fields within text or
60
+ binary files as long as those fields can be easily viewed by the user.
61
+
62
+ 3) No Modified Version of the Font Software may use the Reserved Font
63
+ Name(s) unless explicit written permission is granted by the
64
+ corresponding Copyright Holder. This restriction only applies to the
65
+ primary font name as presented to the users.
66
+
67
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
68
+ Software shall not be used to promote, endorse or advertise any
69
+ Modified Version, except to acknowledge the contribution(s) of the
70
+ Copyright Holder(s) and the Author(s) or with their explicit written
71
+ permission.
72
+
73
+ 5) The Font Software, modified or unmodified, in part or in whole,
74
+ must be distributed entirely under this license, and must not be
75
+ distributed under any other license. The requirement for fonts to
76
+ remain under this license does not apply to any document created using
77
+ the Font Software.
78
+
79
+ TERMINATION
80
+ This license becomes null and void if any of the above conditions are
81
+ not met.
82
+
83
+ DISCLAIMER
84
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
85
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
86
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
87
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
88
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
89
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
90
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
91
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
92
+ OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file
@@ -0,0 +1,92 @@
1
+ This Font Software is licensed under the SIL Open Font License,
2
+ Version 1.1.
3
+
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+ -----------------------------------------------------------
8
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
9
+ -----------------------------------------------------------
10
+
11
+ PREAMBLE
12
+ The goals of the Open Font License (OFL) are to stimulate worldwide
13
+ development of collaborative font projects, to support the font
14
+ creation efforts of academic and linguistic communities, and to
15
+ provide a free and open framework in which fonts may be shared and
16
+ improved in partnership with others.
17
+
18
+ The OFL allows the licensed fonts to be used, studied, modified and
19
+ redistributed freely as long as they are not sold by themselves. The
20
+ fonts, including any derivative works, can be bundled, embedded,
21
+ redistributed and/or sold with any software provided that any reserved
22
+ names are not used by derivative works. The fonts and derivatives,
23
+ however, cannot be released under any other type of license. The
24
+ requirement for fonts to remain under this license does not apply to
25
+ any document created using the fonts or their derivatives.
26
+
27
+ DEFINITIONS
28
+ "Font Software" refers to the set of files released by the Copyright
29
+ Holder(s) under this license and clearly marked as such. This may
30
+ include source files, build scripts and documentation.
31
+
32
+ "Reserved Font Name" refers to any names specified as such after the
33
+ copyright statement(s).
34
+
35
+ "Original Version" refers to the collection of Font Software
36
+ components as distributed by the Copyright Holder(s).
37
+
38
+ "Modified Version" refers to any derivative made by adding to,
39
+ deleting, or substituting -- in part or in whole -- any of the
40
+ components of the Original Version, by changing formats or by porting
41
+ the Font Software to a new environment.
42
+
43
+ "Author" refers to any designer, engineer, programmer, technical
44
+ writer or other person who contributed to the Font Software.
45
+
46
+ PERMISSION & CONDITIONS
47
+ Permission is hereby granted, free of charge, to any person obtaining
48
+ a copy of the Font Software, to use, study, copy, merge, embed,
49
+ modify, redistribute, and sell modified and unmodified copies of the
50
+ Font Software, subject to the following conditions:
51
+
52
+ 1) Neither the Font Software nor any of its individual components, in
53
+ Original or Modified Versions, may be sold by itself.
54
+
55
+ 2) Original or Modified Versions of the Font Software may be bundled,
56
+ redistributed and/or sold with any software, provided that each copy
57
+ contains the above copyright notice and this license. These can be
58
+ included either as stand-alone text files, human-readable headers or
59
+ in the appropriate machine-readable metadata fields within text or
60
+ binary files as long as those fields can be easily viewed by the user.
61
+
62
+ 3) No Modified Version of the Font Software may use the Reserved Font
63
+ Name(s) unless explicit written permission is granted by the
64
+ corresponding Copyright Holder. This restriction only applies to the
65
+ primary font name as presented to the users.
66
+
67
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
68
+ Software shall not be used to promote, endorse or advertise any
69
+ Modified Version, except to acknowledge the contribution(s) of the
70
+ Copyright Holder(s) and the Author(s) or with their explicit written
71
+ permission.
72
+
73
+ 5) The Font Software, modified or unmodified, in part or in whole,
74
+ must be distributed entirely under this license, and must not be
75
+ distributed under any other license. The requirement for fonts to
76
+ remain under this license does not apply to any document created using
77
+ the Font Software.
78
+
79
+ TERMINATION
80
+ This license becomes null and void if any of the above conditions are
81
+ not met.
82
+
83
+ DISCLAIMER
84
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
85
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
86
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
87
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
88
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
89
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
90
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
91
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
92
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,25 @@
1
+ # Recad 基础字体包 1.0.0
2
+
3
+ 本目录随 CAD 服务源码和镜像一起发布,运行时无需安装系统字体或联网下载。字体文件共 15 个,采用 SIL Open Font License 1.1,许可证与原始字体内的版权信息一并保留。
4
+
5
+ | 文件 | 用途 |
6
+ | --- | --- |
7
+ | `NotoSansSC-Regular.ttf`、`NotoSansSC-Bold.ttf` | 中文无衬线常规/粗体;来自 Noto Sans CJK 2.004 的简体中文可变 TrueType,固定 wght=400/700 |
8
+ | `NotoSerifSC-Regular.ttf` | 中文衬线常规;来自 Noto Serif CJK 2.003 的简体中文可变 TrueType,固定 wght=400 |
9
+ | `LiberationSans-*.ttf` | 西文无衬线,常规/粗体/斜体/粗斜体 |
10
+ | `LiberationSerif-*.ttf` | 西文衬线,四种字面 |
11
+ | `LiberationMono-*.ttf` | 西文等宽,四种字面 |
12
+ | `manifest.json` | 字体文件与其真实名称、文件名的映射;没有冒充微软字体的别名 |
13
+ | `substitutions.json` | 缺少原字体时允许的显式替换规则,替换会写进任务报告 |
14
+ | `sources.json` | 字体包版本、来源 URL、文件大小、SHA-256;派生字体还记录源哈希、工具版本和固定轴参数 |
15
+ | `*-LICENSE.txt` | 上游字体许可证,交付时必须保留 |
16
+
17
+ 上游来源:[Noto Sans 2.004](https://github.com/notofonts/noto-cjk/releases/tag/Sans2.004)、[Noto Serif 2.003](https://github.com/notofonts/noto-cjk/releases/tag/Serif2.003)、[Liberation 2.1.5](https://github.com/liberationfonts/liberation-fonts/releases/tag/2.1.5)。中文字体只固定可变字体的重量,使用 fontTools 更新对应字面名称,不转换 CFF 曲线,也不删减其原有字符集。
18
+
19
+ 派生 TrueType 的 `glyf` 记录按 4 字节对齐,不改变轮廓或字距,用于避开当前 fontkit 子集对奇数字节偏移的错误处理。该参数同样写入来源记录。PDF 输出还逐个解码嵌入字形,拒绝“部分字显示、其余字消失”的坏子集。
20
+
21
+ 仅维护人员需要重新获取资源时,使用 `../../scripts/restore_font_pack.py`;脚本核对源字节与输出哈希,工具版本与 `sources.json` 不符时拒绝重建。常规镜像构建直接复制本目录,不运行下载脚本。
22
+
23
+ 这不是原图字体相同的承诺。微软雅黑/黑体/等线映射到 Noto Sans SC,宋体/新宋体映射到 Noto Serif SC,Arial/Times New Roman/Courier New 映射到相应 Liberation 字面。字形和字距可能变化,必须按实际加载字面重新排版和计算范围。没有列入规则的字体、SHX、BigFont、SHAPE 不随意替代,缺少资源仍报错。
24
+
25
+ 需要原字形时,把有使用权的原字体放进服务管理的项目字体目录,或使用显式资源清单/任务包。项目字体优先,详细优先级、目录和严格复建规则见 [服务说明](../../service/README.md)。
@@ -0,0 +1,127 @@
1
+ {
2
+ "fonts": [
3
+ {
4
+ "file": "LiberationMono-Bold.ttf",
5
+ "names": [
6
+ "Liberation Mono Bold",
7
+ "LiberationMono-Bold",
8
+ "LiberationMono-Bold.ttf"
9
+ ]
10
+ },
11
+ {
12
+ "file": "LiberationMono-BoldItalic.ttf",
13
+ "names": [
14
+ "Liberation Mono Bold Italic",
15
+ "LiberationMono-BoldItalic",
16
+ "LiberationMono-BoldItalic.ttf"
17
+ ]
18
+ },
19
+ {
20
+ "file": "LiberationMono-Italic.ttf",
21
+ "names": [
22
+ "Liberation Mono Italic",
23
+ "LiberationMono-Italic",
24
+ "LiberationMono-Italic.ttf"
25
+ ]
26
+ },
27
+ {
28
+ "file": "LiberationMono-Regular.ttf",
29
+ "names": [
30
+ "Liberation Mono",
31
+ "LiberationMono",
32
+ "LiberationMono-Regular",
33
+ "LiberationMono-Regular.ttf"
34
+ ]
35
+ },
36
+ {
37
+ "file": "LiberationSans-Bold.ttf",
38
+ "names": [
39
+ "Liberation Sans Bold",
40
+ "LiberationSans-Bold",
41
+ "LiberationSans-Bold.ttf"
42
+ ]
43
+ },
44
+ {
45
+ "file": "LiberationSans-BoldItalic.ttf",
46
+ "names": [
47
+ "Liberation Sans Bold Italic",
48
+ "LiberationSans-BoldItalic",
49
+ "LiberationSans-BoldItalic.ttf"
50
+ ]
51
+ },
52
+ {
53
+ "file": "LiberationSans-Italic.ttf",
54
+ "names": [
55
+ "Liberation Sans Italic",
56
+ "LiberationSans-Italic",
57
+ "LiberationSans-Italic.ttf"
58
+ ]
59
+ },
60
+ {
61
+ "file": "LiberationSans-Regular.ttf",
62
+ "names": [
63
+ "Liberation Sans",
64
+ "LiberationSans",
65
+ "LiberationSans-Regular",
66
+ "LiberationSans-Regular.ttf"
67
+ ]
68
+ },
69
+ {
70
+ "file": "LiberationSerif-Bold.ttf",
71
+ "names": [
72
+ "Liberation Serif Bold",
73
+ "LiberationSerif-Bold",
74
+ "LiberationSerif-Bold.ttf"
75
+ ]
76
+ },
77
+ {
78
+ "file": "LiberationSerif-BoldItalic.ttf",
79
+ "names": [
80
+ "Liberation Serif Bold Italic",
81
+ "LiberationSerif-BoldItalic",
82
+ "LiberationSerif-BoldItalic.ttf"
83
+ ]
84
+ },
85
+ {
86
+ "file": "LiberationSerif-Italic.ttf",
87
+ "names": [
88
+ "Liberation Serif Italic",
89
+ "LiberationSerif-Italic",
90
+ "LiberationSerif-Italic.ttf"
91
+ ]
92
+ },
93
+ {
94
+ "file": "LiberationSerif-Regular.ttf",
95
+ "names": [
96
+ "Liberation Serif",
97
+ "LiberationSerif",
98
+ "LiberationSerif-Regular",
99
+ "LiberationSerif-Regular.ttf"
100
+ ]
101
+ },
102
+ {
103
+ "file": "NotoSansSC-Bold.ttf",
104
+ "names": [
105
+ "Noto Sans SC Bold",
106
+ "NotoSansSC-Bold",
107
+ "NotoSansSC-Bold.ttf"
108
+ ]
109
+ },
110
+ {
111
+ "file": "NotoSansSC-Regular.ttf",
112
+ "names": [
113
+ "Noto Sans SC",
114
+ "NotoSansSC-Regular",
115
+ "NotoSansSC-Regular.ttf"
116
+ ]
117
+ },
118
+ {
119
+ "file": "NotoSerifSC-Regular.ttf",
120
+ "names": [
121
+ "Noto Serif SC",
122
+ "NotoSerifSC-Regular",
123
+ "NotoSerifSC-Regular.ttf"
124
+ ]
125
+ }
126
+ ]
127
+ }