完善红头字体与标题间距校验

This commit is contained in:
mizzlelover
2026-09-10 20:25:34 +08:00
parent d20210b23e
commit 39360ac647
8 changed files with 144 additions and 47 deletions
+15
View File
@@ -24,11 +24,26 @@ unzip -p "$TMP_DIR/layout.docx" word/document.xml | grep -q 'w:pStyle w:val="Hea
"$NODE" "$VERIFY" --input "$TMP_DIR/standard.docx" --profile formal --letterhead preprinted
! unzip -p "$TMP_DIR/standard.docx" word/document.xml | grep -q '示例单位文件'
unzip -p "$TMP_DIR/standard.docx" word/document.xml | grep -q '示例发〔20261号'
unzip -p "$TMP_DIR/standard.docx" word/document.xml | grep -q 'w:before="1120"'
"$NODE" "$GEN" --input "$FIXTURE" --output "$TMP_DIR/digital.docx" --format formal --letterhead digital --org "示例单位文件" --doc-no "示例发〔20261号" --title "电子红头测试" --page-number standard
"$NODE" "$VERIFY" --input "$TMP_DIR/digital.docx" --profile formal --letterhead digital
unzip -p "$TMP_DIR/digital.docx" word/document.xml | grep -q '示例单位文件'
unzip -p "$TMP_DIR/digital.docx" word/document.xml | grep -q 'FF0000'
unzip -p "$TMP_DIR/digital.docx" word/document.xml | grep -q 'height:0.5mm'
unzip -p "$TMP_DIR/digital.docx" word/document.xml | grep -q 'w:before="1984"'
unzip -p "$TMP_DIR/digital.docx" word/document.xml | grep -q 'w:before="1120"'
if "$NODE" "$GEN" --input "$FIXTURE" --output "$TMP_DIR/strict.docx" --format formal --letterhead digital --org "示例单位文件" --title "严格字体测试" --require-standard-fonts >"$TMP_DIR/strict.out" 2>&1; then
if ! fc-list -f '%{family}\n' | grep -Eq '方正小标宋简体|方正小标宋_GBK|FZXiaoBiaoSong'; then
echo "strict font mode unexpectedly succeeded without a small-standard-title font" >&2
exit 1
fi
elif ! grep -q 'FONT ERROR:' "$TMP_DIR/strict.out"; then
cat "$TMP_DIR/strict.out" >&2
echo "strict font mode failed for an unexpected reason" >&2
exit 1
fi
if command -v soffice >/dev/null 2>&1; then
mkdir -p "$TMP_DIR/pdf"