feat(md-print): use mm font and corner page numbers
Body font size is now specified in millimetres and defaults to 3mm. Page numbers move from the centre footer to the outer bottom corners, alternating left and right per A5 page.
This commit is contained in:
@@ -18,11 +18,16 @@ describe("normalizePrintConfig", () => {
|
||||
expect(config.columns).toBe(3);
|
||||
expect(config.margin).toBe(40);
|
||||
expect(config.gap).toBe(0);
|
||||
expect(config.font).toBe(16);
|
||||
expect(config.font).toBe(6);
|
||||
expect(config.pageNumbers).toBe(false);
|
||||
expect(config.cutMarks).toBe(false);
|
||||
});
|
||||
|
||||
test("clamps font to 2..6mm", () => {
|
||||
expect(normalizePrintConfig({ font: "1" }).font).toBe(2);
|
||||
expect(normalizePrintConfig({ font: "20" }).font).toBe(6);
|
||||
});
|
||||
|
||||
test("clamps columns to 1..4", () => {
|
||||
expect(normalizePrintConfig({ columns: "0" }).columns).toBe(1);
|
||||
expect(normalizePrintConfig({ columns: "9" }).columns).toBe(4);
|
||||
@@ -33,7 +38,7 @@ describe("normalizePrintConfig", () => {
|
||||
columns: 2,
|
||||
margin: 12,
|
||||
gap: 6,
|
||||
font: 10,
|
||||
font: 3,
|
||||
title: "规则书",
|
||||
pageNumbers: true,
|
||||
cutMarks: false,
|
||||
@@ -43,7 +48,7 @@ describe("normalizePrintConfig", () => {
|
||||
columns: 2,
|
||||
margin: 12,
|
||||
gap: 6,
|
||||
font: 10,
|
||||
font: 3,
|
||||
title: "规则书",
|
||||
pageNumbers: true,
|
||||
cutMarks: false,
|
||||
|
||||
Reference in New Issue
Block a user