I used addDirectory() method to add two Cardo fonts at once:
public static final String FONTS = "src/main/resources/fonts/";
public void createPdf(String src, String fonts, String dest) throws IOException {
ConverterProperties properties = new ConverterProperties();
FontProvider fontProvider = new DefaultFontProvider();
fontProvider.addDirectory(fonts);
properties.setFontProvider(fontProvider);
HtmlConverter.convertToPdf(new File(src), new File(dest), properties);
}
unfortunately Times font is used instead of Cardo or Cardo-Bold. I have also tried with other Arial fonts but it doesn't work also
I'm using iText 7.1.6 and pdfHTML 2.1.3