Added Birds font to pleadings
X-Lovable-Edit-ID: edt-9e58bfaf-6517-4e76-bc4b-87f42e4e49ca Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
||||
import jsPDF from "jspdf";
|
||||
import type { PleadingInput } from "./docx-pleading";
|
||||
import { BOOKMAN_FAMILY, registerBookmanFont } from "./bookman-fonts";
|
||||
import { BIRDS_FAMILY, registerBirdsFont } from "./birds-font";
|
||||
|
||||
// Letter @ 72dpi: 612 x 792. 1" margins = 72.
|
||||
const PAGE_W = 612;
|
||||
@@ -198,6 +199,7 @@ function drawFooter(pdf: jsPDF, page: number, totalPages: number, left?: string,
|
||||
export async function downloadPleadingPdf(input: PleadingInput, filename: string) {
|
||||
const pdf = new jsPDF({ unit: "pt", format: "letter" });
|
||||
registerBookmanFont(pdf);
|
||||
registerBirdsFont(pdf);
|
||||
|
||||
let y = MARGIN;
|
||||
const bottomLimit = PAGE_H - MARGIN;
|
||||
@@ -340,8 +342,9 @@ export async function downloadPleadingPdf(input: PleadingInput, filename: string
|
||||
y += LINE_H * 2;
|
||||
}
|
||||
} else if (sig.typed?.trim()) {
|
||||
// Typed cursive signature — fall back to italic Bookman (script fonts not embedded)
|
||||
setFont(pdf, { italic: true }, 18);
|
||||
// Typed signature rendered in the embedded Birds handwriting font.
|
||||
pdf.setFont(BIRDS_FAMILY, "normal");
|
||||
pdf.setFontSize(14);
|
||||
pdf.text(sig.typed.trim(), SIG_X, y);
|
||||
y += LINE_H;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user