Thanks to @TilmanHausherr for his suggestions, i had to use this function while embedding the font to the pdf
PDType0Font.load(doc, new FileInputStream(fontPath), false);