forked from 1b-agent/opencadstudio-upstream
fix(text): resolve %%c to U+2205, the diameter sign AutoCAD writes
Saved dimension pictures across 1311 diameter dimensions carry U+2205 (806) or a literal %%c (168); U+2300 never appears. The bundled romans and simplex fonts have U+2205 and lack Latin O-stroke, so one character now serves the %%c expansion and, in the dimension formatter, the diameter prefix.
This commit is contained in:
1 parent
9e18f855cc
commit
8463c830f7
1 file changed
+2
-2
@@ -197,7 +197,7 @@ pub fn text_local_bounds(
|
|||||||
/// Expand DXF `%%x` special-character sequences that appear in both TEXT and MTEXT values:
|
/// Expand DXF `%%x` special-character sequences that appear in both TEXT and MTEXT values:
|
||||||
/// - `%%d` / `%%D` → `°`
|
/// - `%%d` / `%%D` → `°`
|
||||||
/// - `%%p` / `%%P` → `±`
|
/// - `%%p` / `%%P` → `±`
|
||||||
/// - `%%c` / `%%C` → `⌀`
|
/// - `%%c` / `%%C` → `∅` (U+2205, the character AutoCAD writes for the diameter sign)
|
||||||
/// - `%%u` / `%%U` → underline toggle (stripped — not renderable with stroke fonts)
|
/// - `%%u` / `%%U` → underline toggle (stripped — not renderable with stroke fonts)
|
||||||
/// - `%%o` / `%%O` → overline toggle (stripped)
|
/// - `%%o` / `%%O` → overline toggle (stripped)
|
||||||
/// - `%%%%` → `%`
|
/// - `%%%%` → `%`
|
||||||
@@ -224,7 +224,7 @@ pub fn resolve_dxf_special_chars(s: &str) -> String {
|
|||||||
}
|
}
|
||||||
Some('c') => {
|
Some('c') => {
|
||||||
chars.next();
|
chars.next();
|
||||||
out.push('⌀');
|
out.push('∅');
|
||||||
}
|
}
|
||||||
Some('u') | Some('o') => {
|
Some('u') | Some('o') => {
|
||||||
chars.next();
|
chars.next();
|
||||||
|
|||||||
Reference in new issue
Block a user