0

I am trying to create font like this

BaseFont base = BaseFont.createFont("/Users/imac/Library/Desktop/THSARPSK.TTF",BaseFont.IDENTITY_H,BaseFont.EMBEDDED);
Font font = new Font(base, 18f);

but I have a problem with the Path locating the font .

i'm working on android platform on Mac PC, i tried with many solutions, but was unable to solve.

below is one of the solution to get the path of Font on windows

BaseFont.createFont("c:\\winnt\\fonts\\comic.ttf", BaseFont.WINANSI, BaseFont.EMBEDDED);

i try to adapt it for Mac but it sent me an exception

java.io.IOException:\Users\imac\Library\Desktop\THSARPSK.TTF not found as file or resource.

i am trying to solve this problem for many days, please help me.

Nargis
  • 4,687
  • 1
  • 28
  • 45

0 Answers0