0

I have a custom ttf font . Need to create a java desktop application using javaFx to read data from the ttf file and use that data to draw text using the above font style .

I have found out that reading font meta data from the ttf font file can be done using a ttf parser. But I am not sure which pieces of data to extract from the ttf file so that I can draw the font on screen.

I am also confused as how best to draw the text . Java 2D API seems to be the most promising candidate . Besides how do I draw text using this font .

I have some across many posts but none have handled this topic directly . There are some post where a browser based solution has been provided . But as I said mine is a desktop based application.

  • Probably here https://stackoverflow.com/questions/5652344/how-can-i-use-a-custom-font-in-java to read the font at runtime. – PeterMmm Jul 28 '17 at 11:55
  • My requirement is a bit different . I need to read ttf file meta data which will be used to render what ever text is typed in. – Indronil Chaudhuri Jul 28 '17 at 12:21
  • I think we don't get you. Maybe you have some code you can post, an example in an image or rewrite your question. – PeterMmm Jul 28 '17 at 16:00
  • I have a ttf font file . As we all know font files contain instructions about how text styled through this font should be drawn on screen. I need to read font metrics data from this file . This data will be used to draw ascent, decent and leading lines over which my typed text will be placed . I do not have any code at this moment , since I need to get the concept right and require to select the appropriate tolls for this user requirement as well . – Indronil Chaudhuri Jul 29 '17 at 05:56

0 Answers0