I am working on a LuaLaTeX package, and at one point I have to pass the full names of the three basic font families (roman, sans, mono) to another tool. I have found and checked that I can correctly do that for the currently active font, but that's not exactly what I need:
fonts.hashes.identifiers[font.current()].fullname
correctly produces, e.g. "Linux Libertine O", if that's what is currently used for typesetting. (I don't know if that's the correct or easiest way to get to that, so I'd be glad about simplifications.
However, as said I need also the font names defined with \setmainfont
, \setsansfont
and \setmonofont
. From the documentation is looks like font.id()
is my best bet, but so far I didn' have any luck.
[Edit:] When I say "font names" I mean the "family name" of the three fonts that are defined in the mandatory argument of the \setXXXXfont
commands, ignoring any specification that can be done in the optional argument.
font
object. AFAICS I can getfullname
(which is pretty inconsistently used between font companies),psname
andname
, which is a concatenation of different information incluting the psname. But I don't see a way to get to the "family" yet.