Skip to content

Commit

Permalink
Merge pull request #48 from wri/staging
Browse files Browse the repository at this point in the history
fix(reports): check for answers as burmese
  • Loading branch information
edward3sc authored Dec 9, 2024
2 parents 1e33c5e + 31e87d1 commit cf3e060
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions app/src/services/reportFile.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -584,7 +584,10 @@ 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);
}
});
Expand Down
2 changes: 1 addition & 1 deletion app/src/utils/isBurmese.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit cf3e060

Please sign in to comment.