mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Support rich content in markup annotation
- use the xfa parser but in the xhtml namespace.
This commit is contained in:
parent
0e7614df7f
commit
cf8dc750d6
14 changed files with 188 additions and 39 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue