From c8911a65d92848d11e497eb828a527395dfe9428 Mon Sep 17 00:00:00 2001 From: Edward Martin Date: Mon, 9 Dec 2024 12:59:04 +0000 Subject: [PATCH 1/3] fix(reports): check for answers as burmese --- app/src/services/reportFile.service.js | 2 +- app/src/utils/isBurmese.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/services/reportFile.service.js b/app/src/services/reportFile.service.js index 3179200..8996466 100644 --- a/app/src/services/reportFile.service.js +++ b/app/src/services/reportFile.service.js @@ -584,7 +584,7 @@ class ReportFileService { doc.moveDown(1); }); else { - doc.font("Regular").fontSize(11).text(responseToShow, 50, doc.y, { underline: false }); //, lineY + 30 + 50 * i); + doc.font(isBurmese(responseToShow) ? "Burmese" : "Regular").fontSize(11).text(responseToShow, 50, doc.y, { underline: false }); //, lineY + 30 + 50 * i); doc.moveDown(1); } }); diff --git a/app/src/utils/isBurmese.js b/app/src/utils/isBurmese.js index 3819393..e107d5d 100644 --- a/app/src/utils/isBurmese.js +++ b/app/src/utils/isBurmese.js @@ -4,5 +4,5 @@ * @returns {Boolean} True if the text contains only Burmese characters, false otherwise */ export function isBurmese(text) { - return /^[\u1000-\u109F]$/.test(text); + return /^[\u1000-\u109F\s]+$/.test(text); } From 2213d8b7badc2e1abb729ada228353e26b79174f Mon Sep 17 00:00:00 2001 From: edward3sc Date: Mon, 9 Dec 2024 13:01:05 +0000 Subject: [PATCH 2/3] auto commit: apply eslint fixes --- app/src/services/reportFile.service.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/services/reportFile.service.js b/app/src/services/reportFile.service.js index 8996466..6d46d7d 100644 --- a/app/src/services/reportFile.service.js +++ b/app/src/services/reportFile.service.js @@ -584,7 +584,10 @@ class ReportFileService { doc.moveDown(1); }); else { - doc.font(isBurmese(responseToShow) ? "Burmese" : "Regular").fontSize(11).text(responseToShow, 50, doc.y, { underline: false }); //, lineY + 30 + 50 * i); + doc + .font(isBurmese(responseToShow) ? "Burmese" : "Regular") + .fontSize(11) + .text(responseToShow, 50, doc.y, { underline: false }); //, lineY + 30 + 50 * i); doc.moveDown(1); } }); From 31e87d1c3c3d31ae30d289aace5f848b23d0ee5f Mon Sep 17 00:00:00 2001 From: Edward Martin Date: Mon, 9 Dec 2024 13:07:24 +0000 Subject: [PATCH 3/3] fix(reports): check for answers as burmese --- app/src/services/reportFile.service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/services/reportFile.service.js b/app/src/services/reportFile.service.js index 6d46d7d..6581369 100644 --- a/app/src/services/reportFile.service.js +++ b/app/src/services/reportFile.service.js @@ -498,7 +498,7 @@ class ReportFileService { doc.registerFont("Regular", "./app/src/services/font/NotoSansCJKjp-Regular.otf"); doc.registerFont("Bold", "./app/src/services/font/NotoSansCJKjp-Bold.otf"); - doc.registerFont("Burmese", "./app/src/services/font/NotoSansMyanmar-Regular.otf"); + doc.registerFont("Burmese", "./app/src/services/font/NotoSansMyanmar-Regular.ttf"); doc.fontSize(14).text("Monitoring Report", 50, 80); doc.font("Bold").fontSize(14).text(record.attributes.reportName.toUpperCase(), 50, 105);