I'm trying to obtain .xml
from .ttf
in order to embed fonts in Apache FOP for PDF/a conversion (PDF conversion work with without the .xml
). Can you please help me to do this conversion. Below comes what I tried so far:
I found several website explaining that the conversion shall be done by inputing the folowing line in a CLI open on the directory that contain my .ttf
:
java -cp PATH ; PATH\avalon-framework.jar org.apache.fop.fonts.apps.TTFReader arial.ttf arial.xml
with PATH the path to my fop.jar
.
It didn't work and return me: ERROR: Impossible to find the main class
So I tried to use TTFReader:
TTFReader read=new TTFReader();
read.constructFontXML(read.loadTTF(chemin+"Fonts/ttf/arial.ttf", "Arial",true,true), "Arial", "Arial", "C:/Fonts/arial.ttf" ,chemin+"Fonts/ttf/arial.ttf", true, "Arial");
But I didn't understood all the input needed:
constructFontXML(TTFFile ttf,String fontName, String className, String resource, String file,boolean isCid, String ttcName)
loadTTF(String fileName, String fontName, boolean useKerning, boolean useAdvanced)
I have no idea on how to get the information to set the boolean correctly, nor what is ClassName
and what purpose serve ressource
since path
already exist. My code give me .xml
but I don't think they are valid.