Forum How do I...?

List of all installed fonts and prince version from within HTML possible?

twantzen
Is it possible to get a list of all installed fonts and the version of prince with a simple command via HTML/Javascript?

If not: Can you give me a clue of how to develop such an »environmental variable« for use with javascript in Java?

Thanks
Tobias
mikeday
JavaScript can check the navigator.appVersion or navigator.userAgent properties for the version, but there is no way to see the list of fonts installed on the system from within Prince, you would need to use an external tool like fc-list on Linux.
twantzen
mikeday, lightning fast answer – I’m deeply impressed!

That’s good news for the prince version. For the font list: Is it possible to link fc-list to prince e.g. via Java?

Thanks
Tobias

mikeday
I mean you could always call it from a Java process, but I'm not quite sure why you would want to, what is the use case?
twantzen
I’m developing the HTML/CSS part of reports, which are rendered via prince, and have no direct access to the prince installation. And I’m not the only one. To get an updated list of the available fonts (and this changes from time to time), I always have to ask a developer. If this is possible, I can ask them to rout fc-list to javascript so that I can easily access it myself.

Thanks
Tobias
mikeday
The developer can invoke "fc-list : family" to gain a list of the available font families, then report them to you. :D
twantzen
Thanks for your input, mikeday. I’ve got all my answers.