Quantcast

How to create a Java FontDescriptor from font file?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to create a Java FontDescriptor from font file?

Tobias Fischer | pagina GmbH
Hi,

I'm trying to use the FOP font subsetting tools for TTF and OTF fonts
outside of the FOP processor in a side project.
I know this is probably out of scope of this mailing list, but probably
someone can help me anyways...

My problem at the moment is, that I just don't see how to construct a
FontDesriptor from a system font file.

I mean, I found out how to read the font with a FontFileReader and also
found out about the OTFSubSetFile and the TTFSubSetFile classes, but if
I want to determine automagically whether to use the OTF or TTF class
(as in [1]) I always get to the point where I need a FontDescriptor object.

And after some wasted hours of time digging through the FOP sources, I
still haven't found a way to create this object directly from a source
File/URI.

Any idea is appreciated!
Thank you very much!

Kind regards,
Tobias


[1]
https://github.com/apache/fop/blob/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFFactory.java#L1360

--
Tobias Fischer
Senior Software Engineer
(XML/EPUB/PrintCSS)

Telefon: +49 (0)7071 9876-44 · Fax: -22
Mail: [hidden email]

pagina GmbH - Publikationstechnologien
Herrenberger Straße 51 | D-72070 Tübingen
www.pagina.gmbh | www.parsx.de

Handelsregister Stuttgart - HRB 380249
Geschäftsführer: Tobias Ott


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: How to create a Java FontDescriptor from font file?

Simon Steiner
Hi,

See OFFontLoader.java

Thanks

-----Original Message-----
From: Tobias Fischer | pagina GmbH [mailto:[hidden email]]
Sent: 13 April 2017 17:42
To: [hidden email]
Subject: How to create a Java FontDescriptor from font file?

Hi,

I'm trying to use the FOP font subsetting tools for TTF and OTF fonts outside of the FOP processor in a side project.
I know this is probably out of scope of this mailing list, but probably someone can help me anyways...

My problem at the moment is, that I just don't see how to construct a FontDesriptor from a system font file.

I mean, I found out how to read the font with a FontFileReader and also found out about the OTFSubSetFile and the TTFSubSetFile classes, but if I want to determine automagically whether to use the OTF or TTF class (as in [1]) I always get to the point where I need a FontDescriptor object.

And after some wasted hours of time digging through the FOP sources, I still haven't found a way to create this object directly from a source File/URI.

Any idea is appreciated!
Thank you very much!

Kind regards,
Tobias


[1]
https://github.com/apache/fop/blob/trunk/fop-core/src/main/java/org/apache/fop/pdf/PDFFactory.java#L1360

--
Tobias Fischer
Senior Software Engineer
(XML/EPUB/PrintCSS)

Telefon: +49 (0)7071 9876-44 · Fax: -22
Mail: [hidden email]

pagina GmbH - Publikationstechnologien
Herrenberger Straße 51 | D-72070 Tübingen www.pagina.gmbh | www.parsx.de

Handelsregister Stuttgart - HRB 380249
Geschäftsführer: Tobias Ott


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...