my_list = ['a', 'b', 'c', 'd', 'e', 'f', 'woof']
# index = [0, 3, 6]
# define excluded names list
excl_names_list = ['woof', 'c']
list_diff(my_list, excl_names_list)
>> ['a', 'b', 'd', 'e', 'f']
如何添加自定义字体并支持阿姆哈拉语?
答案 0 :(得分:1)
请确保您遵循pdfmake guide for custom client-side font support中的步骤:
/node_modules/pdfmake/examples/fonts/
/node_modules/pdfmake/
目录中,先运行npm install
,然后运行gulp buildFonts
/build/vfs_fonts.js/
文件。我的导入看起来像这样(基于this answer):import * as pdfMakeConfig from 'pdfmake/build/pdfmake.js';
import * as pdfFonts from 'pdfmake/build/vfs_fonts.js';
pdfMakeConfig.vfs = pdfFonts.pdfMake.vfs;
import * as pdfMake from 'pdfmake/build/pdfmake';
重要:在定义pdfMake.fonts
时,仅使用文件名而不是完整路径。我的看起来像这样:
pdfMakeConfig.fonts = {
ethiopic : {
normal: 'NotoSansEthiopic-Regular.ttf'
}
};
然后您可以在文档说明中使用它,如下所示:
{
text: 'foo',
font: 'ethiopic'
}