Preserve QPowerPoint font families

This commit is contained in:
Курнат Андрей
2026-06-01 07:28:05 +03:00
parent f388489d2b
commit a4314be285
5 changed files with 74 additions and 12 deletions
+9 -3
View File
@@ -263,8 +263,10 @@ describe("powerPointOffice helpers", () => {
subtitle: "Подзаголовок",
titleColor: "C2410C",
titleFontSize: 34,
titleFontFamily: "Courier New",
subtitleColor: "0F766E",
subtitleFontSize: 22
subtitleFontSize: 22,
subtitleFontFamily: "Times New Roman"
});
const exportedBlob = await exportPptxBlob({
@@ -278,8 +280,10 @@ describe("powerPointOffice helpers", () => {
theme: "classic",
titleColor: "C2410C",
titleFontSize: 34,
titleFontFamily: "Courier New",
subtitleColor: "0F766E",
subtitleFontSize: 22
subtitleFontSize: 22,
subtitleFontFamily: "Times New Roman"
}
]
});
@@ -290,6 +294,8 @@ describe("powerPointOffice helpers", () => {
expect(exportedSlideXml).toContain("0F766E");
expect(exportedSlideXml).toContain('sz="3400"');
expect(exportedSlideXml).toContain('sz="2200"');
expect(exportedSlideXml).toContain('typeface="Courier New"');
expect(exportedSlideXml).toContain('typeface="Times New Roman"');
});
it("нормализует пробелы в импортированном тексте", () => {
@@ -308,7 +314,7 @@ function slideXmlWithBackground(title: string, color: string) {
}
function slideXmlWithTextStyles(title: string, subtitle: string) {
return `<p:sld xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><p:cSld><p:spTree><p:sp><p:txBody><a:p><a:r><a:rPr sz="3400"><a:solidFill><a:srgbClr val="C2410C"/></a:solidFill></a:rPr><a:t>${title}</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:txBody><a:p><a:r><a:rPr sz="2200"><a:solidFill><a:srgbClr val="0F766E"/></a:solidFill></a:rPr><a:t>${subtitle}</a:t></a:r></a:p></p:txBody></p:sp></p:spTree></p:cSld></p:sld>`;
return `<p:sld xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><p:cSld><p:spTree><p:sp><p:txBody><a:p><a:r><a:rPr sz="3400"><a:solidFill><a:srgbClr val="C2410C"/></a:solidFill><a:latin typeface="Courier New"/></a:rPr><a:t>${title}</a:t></a:r></a:p></p:txBody></p:sp><p:sp><p:txBody><a:p><a:r><a:rPr sz="2200"><a:solidFill><a:srgbClr val="0F766E"/></a:solidFill><a:latin typeface="Times New Roman"/></a:rPr><a:t>${subtitle}</a:t></a:r></a:p></p:txBody></p:sp></p:spTree></p:cSld></p:sld>`;
}
function slideXmlWithPicture(title: string) {