feat: 完成 DOCX R4 元素级视觉门禁
建立 Chromium、Word 与 WPS 的可编辑内容、段落几何、页眉页脚、封面、媒体和逐页视觉比较链路。 支持封面独立分节、正文页码重启、主题页边距与横向纸张,并将自然分页差异降为诊断项。 修正代码块内边距和折叠表格单元格边框映射,14 套主题生产矩阵与六组布局视觉矩阵通过。
This commit is contained in:
@@ -199,6 +199,40 @@ describe("内置主题清单", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("可研封面使用跨 Chromium 与 Word 一致的原生字体面", async () => {
|
||||
const [css, manifestSource] = await Promise.all([
|
||||
readFile(
|
||||
new URL(
|
||||
"../../../themes/formal-feasibility/theme.css",
|
||||
import.meta.url
|
||||
),
|
||||
"utf8"
|
||||
),
|
||||
readFile(
|
||||
new URL(
|
||||
"../../../themes/formal-feasibility/theme.json",
|
||||
import.meta.url
|
||||
),
|
||||
"utf8"
|
||||
)
|
||||
]);
|
||||
const manifest = JSON.parse(manifestSource) as {
|
||||
docxFonts?: {
|
||||
faces?: Array<{ family: string; weight?: number }>;
|
||||
};
|
||||
};
|
||||
|
||||
expect(css).toContain('"FandolSong", "Noto Serif CJK SC"');
|
||||
expect(css).toContain('"FandolHei", "Noto Sans CJK SC"');
|
||||
expect(manifest.docxFonts?.faces).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({ family: "FandolSong", weight: 400 }),
|
||||
expect.objectContaining({ family: "FandolSong", weight: 700 }),
|
||||
expect.objectContaining({ family: "FandolHei", weight: 400 })
|
||||
])
|
||||
);
|
||||
});
|
||||
|
||||
it("技术暗标主题隐藏结构化身份字段", async () => {
|
||||
const css = await readFile(
|
||||
new URL(
|
||||
|
||||
Reference in New Issue
Block a user