Support rich content in markup annotation

- use the xfa parser but in the xhtml namespace.
This commit is contained in:
Calixte Denizet 2021-10-24 17:29:30 +02:00
parent 0e7614df7f
commit cf8dc750d6
14 changed files with 188 additions and 39 deletions

View file

@ -606,10 +606,16 @@ function setPara(node, nodeStyle, value) {
}
function setFontFamily(xfaFont, node, fontFinder, style) {
const name = stripQuotes(xfaFont.typeface);
const typeface = fontFinder.find(name);
if (!fontFinder) {
// The font cannot be found in the pdf so use the default one.
delete style.fontFamily;
return;
}
const name = stripQuotes(xfaFont.typeface);
style.fontFamily = `"${name}"`;
const typeface = fontFinder.find(name);
if (typeface) {
const { fontFamily } = typeface.regular.cssFontInfo;
if (fontFamily !== name) {