|
|
@@ -397,9 +397,11 @@ public class PrintTemplate {
|
|
|
} else {
|
|
|
String full = titleName.isEmpty() ? value : (titleName + ":" + value);
|
|
|
if ("center".equals(align)) {
|
|
|
- core = center(full, lineWidth).trim();
|
|
|
+ // 不可 trim:center() 靠前导空格居中,trim 会抵消对齐
|
|
|
+ core = center(full, lineWidth);
|
|
|
} else if ("right".equals(align)) {
|
|
|
- core = alignRight(full, lineWidth).trim();
|
|
|
+ // 不可 trim:alignRight() 靠前导空格右对齐
|
|
|
+ core = alignRight(full, lineWidth);
|
|
|
} else {
|
|
|
core = titleName.isEmpty() ? truncateToWidth(value, lineWidth) : kvColon(titleName, value, lineWidth).trim();
|
|
|
}
|
|
|
@@ -431,9 +433,9 @@ public class PrintTemplate {
|
|
|
}
|
|
|
String core;
|
|
|
if ("center".equals(align)) {
|
|
|
- core = center(text, lineWidth).trim();
|
|
|
+ core = center(text, lineWidth);
|
|
|
} else if ("right".equals(align)) {
|
|
|
- core = alignRight(text, lineWidth).trim();
|
|
|
+ core = alignRight(text, lineWidth);
|
|
|
} else {
|
|
|
core = truncateToWidth(text, lineWidth);
|
|
|
}
|