TXT2MTXT: combine text into MText, with its settings dialog

TEXT and MTEXT objects are merged into one MTEXT (top-down or in
selection order, word-wrapped or one paragraph per object, with the
original pitch kept as line spacing) or each TEXT and MTEXT line becomes
an MTEXT of its own. The SEttings option opens the Combine Text settings
dialog; the settings persist as profile values and are exposed as the
TXT2MTXT* variables and the txt2mtxt_settings automation action.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
ramox81andClaude Opus 5.5 committed 2026-10-15 15:50:28 +03:00
1 parent 39c3e9af58
commit 4e4dc86908
40 files changed
+1244 -4

No files matched your search

+32
View File
@@ -108,6 +108,34 @@ impl AutoConstrainSettings {
}
}
/// TXT2MTXT (Combine Text) settings, the profile values
/// TXT2MTXTCOMBINEMTEXT, TXT2MTXTTEXTORDER, TXT2MTXTWORDWRAP and
/// TXT2MTXTLINESPACING.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(default)]
pub struct Txt2MtxtSettings {
/// Combine everything into one MTEXT (else each TEXT becomes its own).
pub combine: bool,
/// Keep the selection order (else sort top-down).
pub select_order: bool,
/// Run the lines on separated by spaces in a computed width (else one
/// paragraph per object).
pub word_wrap: bool,
/// Force uniform line spacing (always on while word-wrap is).
pub uniform_spacing: bool,
}
impl Default for Txt2MtxtSettings {
fn default() -> Self {
Self {
combine: true,
select_order: false,
word_wrap: true,
uniform_spacing: true,
}
}
}
/// Cursor shown over the drawing viewport.
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum CursorType {
@@ -568,6 +596,9 @@ pub struct UserSettings {
/// the Auto Constrain command.
#[serde(default)]
pub auto_constrain: AutoConstrainSettings,
/// TXT2MTXT settings (Text to MText Settings dialog).
#[serde(default)]
pub txt2mtxt: Txt2MtxtSettings,
/// Keep existing geometry size while solving after a constraint edit.
#[serde(default = "default_constraint_solve_mode")]
pub constraint_solve_mode: bool,
@@ -962,6 +993,7 @@ impl Default for UserSettings {
file_assoc_enabled: true,
show_constraint_values: true,
auto_constrain: AutoConstrainSettings::default(),
txt2mtxt: Txt2MtxtSettings::default(),
constraint_solve_mode: true,
constraint_infer: false,
constraint_bar_display: 3,