Revert "INCOMPLETE: refactor signature pad and input into a single component"

This reverts commit e17e4566cd.
This commit is contained in:
Ephraim Atta-Duncan
2024-01-16 01:17:11 +00:00
parent 0b8e84b6b7
commit 27e5ef0a51
4 changed files with 28 additions and 145 deletions

View File

@ -40,19 +40,10 @@ export const insertFieldInPDF = async (pdf: PDFDocument, field: FieldWithSignatu
const fieldX = pageWidth * (Number(field.positionX) / 100);
const fieldY = pageHeight * (Number(field.positionY) / 100);
// const url =
// 'https://fonts.gstatic.com/s/dancingscript/v25/If2cXTr6YS-zF4S-kcSWSVi_sxjsohD9F50Ruu7BMSoHTQ.ttf';
const url = 'https://fonts.gstatic.com/s/caveat/v18/WnznHAc5bAfYB2QRah7pcpNvOx-pjfJ9SII.ttf';
const googleFont = await fetch(url).then(async (res) => res.arrayBuffer());
const font = await pdf.embedFont(isSignatureField ? googleFont : StandardFonts.Helvetica, {
subset: true,
features: { liga: false },
});
const font = await pdf.embedFont(isSignatureField ? fontCaveat : StandardFonts.Helvetica);
if (field.type === FieldType.SIGNATURE || field.type === FieldType.FREE_SIGNATURE) {
await pdf.embedFont(googleFont, { subset: true, features: { liga: false } });
await pdf.embedFont(fontCaveat);
}
const CUSTOM_TEXT = field.customText || field.Signature?.typedSignature || '';