Detailed description of issue
Are there any functionalities that, webviewer load fonts that are not installed on client, and use the fonts to write annotations?
Expected behaviour
What we want to achieve is, add font to webviewer e.g. Noto Sans JP, and write annotations with them on any device.
Does your issue happen with every document, or just one?
n/a
Link to document
n/a
Code snippet
What we tried is below.
instance.Fonts.addAnnotationFont('Noto Sans JP');
But when writing annotations on devices which Noto Sans JP is not installed, shown annotations are not Noto Sans JP.
So, we tried loading fonts using links as below, which did not work.
Thank you for your response.
I tried setting a custom font using below code, but the annotation was not written in the set font.
After the setCustomFontURL was called and webviewer was initialized, no error was given in the browser’s console. Moreover, looking at the browser’s network tab, there was no request from webpage to the customFontUrl.
Do you see any mistake on my code?
Your freetext doesn’t look like its written in Roboto Mono font.
Maybe some alternative font is being used by the viewer, or the Roboto Mono font is not loaded?
Would you please check if there’s any solution for this?
This is actually expected and is required by the host machine to have the font installed. This is why the font was not working on my end.
You can read a similar guide here about embedded fonts and how pdf.js will substitute with the closest font (note that this guide is for Apryse WebViewer):