From 54770ea16f6fac40edc99e4ce0b763b5bbb0d4f3 Mon Sep 17 00:00:00 2001 From: abdullahalam123 Date: Sat, 15 Nov 2025 16:20:21 +0530 Subject: [PATCH] refactor(pdfjs-viewer): update font options in viewer styles and controls Replaced outdated font options in viewer.css and viewer.html with new standard fonts (Sacramento, AlexBrush, Allura, Handlee). Updated viewer.mjs to support the new fonts in signature type controls, enhancing customization for typed signatures. --- public/pdfjs-viewer/viewer.css | 24 +++++++++++++++++++----- public/pdfjs-viewer/viewer.html | 12 ++++-------- public/pdfjs-viewer/viewer.mjs | 17 ++++++++++++++--- 3 files changed, 37 insertions(+), 16 deletions(-) diff --git a/public/pdfjs-viewer/viewer.css b/public/pdfjs-viewer/viewer.css index aa599bd..4ed9cbd 100644 --- a/public/pdfjs-viewer/viewer.css +++ b/public/pdfjs-viewer/viewer.css @@ -2419,29 +2419,43 @@ @font-face { font-family: "Kalam"; - src: url("./pdfjs-annotation-extension/font/Kalam-Regular.ttf") format("truetype"); + src: url("./standard_fonts/Kalam.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; } @font-face { - font-family: "Merriweather"; - src: url("./standard_fonts/merriweather-400.woff2") format("woff2"); + font-family: "Sacramento"; + src: url("./standard_fonts/Sacramento.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; } @font-face { - font-family: "Great Vibes"; - src: url("./standard_fonts/great-vibes400.woff2") format("woff2"); + font-family: "Alex"; + src: url("./standard_fonts/AlexBrush.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; } +@font-face { + font-family: "Allura"; + src: url("./standard_fonts/Allura.ttf") format("truetype"); + font-weight: 400; + font-style: normal; + font-display: swap; +} +@font-face { + font-family: "Handlee"; + src: url("./standard_fonts/Handlee.ttf") format("truetype"); + font-weight: 400; + font-style: normal; + font-display: swap; +} /* Custom end */ diff --git a/public/pdfjs-viewer/viewer.html b/public/pdfjs-viewer/viewer.html index d82d6c8..c17d1dc 100644 --- a/public/pdfjs-viewer/viewer.html +++ b/public/pdfjs-viewer/viewer.html @@ -654,14 +654,10 @@ See https://github.com/adobe-type-tools/cmap-resources - - - - - - - - + + + + diff --git a/public/pdfjs-viewer/viewer.mjs b/public/pdfjs-viewer/viewer.mjs index f14b8b2..2ebc3ff 100644 --- a/public/pdfjs-viewer/viewer.mjs +++ b/public/pdfjs-viewer/viewer.mjs @@ -18120,12 +18120,23 @@ function setupSignatureTypeControls() { case "cursive": typeInput.style.fontFamily = defaultFontFamily; break; - case "Great Vibes": - typeInput.style.fontFamily = '"Great Vibes", ' + defaultFontFamily; - break; + case "Kalam": typeInput.style.fontFamily = '"Kalam", ' + defaultFontFamily; break; + case "Sacramento": + typeInput.style.fontFamily = '"Sacramento", ' + defaultFontFamily; + break; + case "AlexBrush": + typeInput.style.fontFamily = '"AlexBrush", ' + defaultFontFamily; + break; + case "Allura": + typeInput.style.fontFamily = '"Allura", ' + defaultFontFamily; + break; + case "Handlee": + typeInput.style.fontFamily = '"Handlee", ' + defaultFontFamily; + break; + default: typeInput.style.fontFamily = value + ", " + defaultFontFamily; break;