forked from 1b-agent/opencadstudio-upstream
feat: embed images (OLE2FRAME), print pipeline fixes, plot prefs, community fonts
- IMAGEEMBED: pack raster images into OLE2FRAME entities so a .dwg is self-contained; 'Embed Image' entry in the XREF attach menu; control/MCP op embed_image for external tools; dxf_name for OLE2FRAME queries. - Scene: populate_images_from_document now rebuilds OLE2FRAME and PDF underlay models too (they used to vanish after any XREF op). - Printing: add PRINTER_ENUM_NETWORK pass when listing printers; GDI spooler fallback (hayro raster at 300 DPI + StretchDIBits) for hosts whose PDF handler registers no print verb; DEVMODE orientation with a 90-degree raster rotation fallback for v4 drivers; fix the fit-scale precedence bug that printed blank pages. - PDF export dialogs on Windows use the async file dialog so the native overwrite confirmation no longer deadlocks the UI thread. - Plot dialog: persist the chosen printer (saved on selection) and the picked plot window across sessions; page setups with no device no longer reset the output device. - Community fonts: detect unresolvable .shx references on open and offer a download from the repository's fonts/ folder (contribution guide in fonts/README.md); custom font source URL setting for intranet font servers; downloaded fonts resolve from the per-user fonts directory.
This commit is contained in:
1 parent
1450fdeedf
commit
28efbffd57
27 files changed
+1767
-66
No files matched your search
+12
-1
@@ -54,6 +54,7 @@ const EXECUTE_OPS: &[&str] = &[
|
||||
"property",
|
||||
"set_properties",
|
||||
"action",
|
||||
"embed_image",
|
||||
"save",
|
||||
"stop",
|
||||
"batch",
|
||||
@@ -72,6 +73,7 @@ const BATCH_STEP_OPS: &[&str] = &[
|
||||
"property",
|
||||
"set_properties",
|
||||
"action",
|
||||
"embed_image",
|
||||
"save",
|
||||
"stop",
|
||||
];
|
||||
@@ -717,6 +719,12 @@ fn validate_execute_request(request: &Value, op: &str) -> Result<(), String> {
|
||||
)),
|
||||
None => missing("name", r#"{"op":"action","name":"zoom_extents"}"#),
|
||||
},
|
||||
"embed_image" if request["path"].as_str().is_none_or(str::is_empty) => {
|
||||
missing(
|
||||
"path",
|
||||
r#"{"op":"embed_image","path":"/path/logo.png","at":[0,0,0],"width":100}"#,
|
||||
)
|
||||
}
|
||||
_ => Ok(()),
|
||||
}
|
||||
}
|
||||
@@ -902,7 +910,9 @@ fn execute_request_schema() -> Value {
|
||||
"camera_revision":{"type":"integer","minimum":0,"description":"Expected camera revision when view state matters."},
|
||||
"selection":{"type":"array","items":handle.clone(),"description":"Expected selected handles from current state."},
|
||||
"cmd":{"type":"string","minLength":1,"description":"Command name followed by its prompt answers separated by spaces. Points use x,y or x,y,z; option answers use their token. Read command details first when unsure.","examples":["LINE 0,0 10,10","CIRCLE 5,5 3","PLINE 0,0 10,0 10,10 C"]},
|
||||
"path":{"type":"string","minLength":1,"description":"Absolute drawing path for open or save."},
|
||||
"path":{"type":"string","minLength":1,"description":"Absolute path: drawing for open or save, image file for embed_image."},
|
||||
"at":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":3,"description":"World [x,y] or [x,y,z] placement corner for embed_image (picture grows up-right)."},
|
||||
"width":{"type":"number","exclusiveMinimum":0,"description":"World width for embed_image; height follows the image aspect ratio. Defaults to pixel_width/100."},
|
||||
"kind":{"type":"string","enum":["text","token","point","entity","structure","selection","enter"],"description":"Input kind listed in state.command.accepts."},
|
||||
"text":{"type":"string","description":"Free text or one option/value token."},
|
||||
"point":point,
|
||||
@@ -943,6 +953,7 @@ fn execute_request_schema() -> Value {
|
||||
{"properties":{"op":{"const":"property"}},"required":["field","value"]},
|
||||
{"properties":{"op":{"const":"set_properties"}},"required":["collection","updates"]},
|
||||
{"properties":{"op":{"const":"action"}},"required":["name"]},
|
||||
{"properties":{"op":{"const":"embed_image"}},"required":["path"]},
|
||||
{"properties":{"op":{"const":"save"}}},
|
||||
{"properties":{"op":{"const":"stop"}}},
|
||||
{"properties":{"op":{"const":"batch"}},"required":["steps"]}
|
||||
|
||||
Reference in new issue
Block a user