When I convert 'html' file into pdf, my braille text don't appears. Instead, appears "(((((((".[enter image description here](https://i.stack.imgur.com/z4czk.png)
function generatePDF(){
var doc = new jsPDF('p', 'pt', 'a4');
const myFont = './assets/BrailleNormal-lLDX.ttf'; // load the *.ttf font file as binary string
// add the font to jsPDF
doc.addFileToVFS("MyFont.ttf", myFont);
doc.addFont("MyFont.ttf", "MyFont", "normal");
doc.setFont("MyFont");
doc.html(document.querySelector('#content'), {
callback: function(pdf){
console.log(pdf);
pdf.save('file.pdf');
}
})
}
I tried to find a way to import braille font in jspdf, but I have no success. I also tried to import some google fonts too
Later edit there appears to be a current problem with some fonts when displayed by MS Edge rather than say Firefox. Here is current rendering Firefox on left MS Edge on right. The same file in Acrobat shows it is NOT a jsPDF failure "!" Current Chrome Browser seems OK Version 122.0.6261.95 (Official Build) so it is an Adobe Acrobat fail in Edge across several versions tested in 122.0.2365.59 - 122.0.2365.66 (Official build)
Generally jsPDF needs data to be inline (on page) this avoids CORS issues so you need to inspect the browser console as to what is being blocked.
However jsPDF has an ability to use virtual fonts imported as text, so for braille we can convert roughly like this:- sorry could not add bigger braille1 so spot the difference in
!
Braille 2.3 (NOT Braille1) gives this result (Hello Blind World"the") according to Wikipedia which is clearly to my eyes WRONG ?
For French accents see https://abracadabraille.org/le-braille shows which characters cover French accents but you need a keyboard map to know which key produces those dots and that can be difficult to find without a blind person to proof check the results!