I want to create barcode using itext5. When creating a barcode, I want to apply the bold style to the font of the numbers. However, to apply a font, only 'basefont' can be applied. The font I want to apply has a custom font file. This is the default font without bold applied. Is there a way to apply a bold style to a custom font to create a barcode? Or, do I have to bring a custom font file with bold applied as default?
BaseFont mBaseFontLogo = BaseFont.createFont("font\\Logo2021Font-Thin.otf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
PdfContentByte mPdfContentByte = mPdfStamper.getOverContent(i);
BarcodeEAN barcode = new BarcodeEAN();
barcode.setCodeType(Barcode.EAN13);
barcode.setCode("1234567890123");
barcode.setFont(mBaseFontLogo);
barcode.setSize(4.0f);
barcode.setX(0.702f);
barcode.setBarHeight(16.5f);
barcode.setBaseline(4.0f);
PdfTemplate template = barcode.createTemplateWithBarcode(mPdfContentByte, BaseColor.BLACK, BaseColor.BLACK);
mPdfContentByte.addTemplate(template, 9.265f, 65.0f);