Probably not exactly what you're looking for, but maybe a useful starting point for further investigations: fontconfig comes with a little utility fc-match that maps logical names / property patterns to real font files installed in the system — presuming fontconfig itself is installed and properly configured. The details of the matching algorithm, valid property specs, etc. are described in the docs. For example,
$ fc-match Times:italic
would output
n021023l.pfb: "Nimbus Roman No9 L" "Regular Italic"
or more verbosely (which includes the absolute path to the font file):
$ fc-match --verbose sans:bold Pattern has 28 elts (size 32) family: "Arial"(s) style: "Bold"(s) stylelang: "xx"(s) slant: 0(i)(s) weight: 200(i)(s) width: 100(i)(s) size: 12(f)(s) pixelsize: 12.5(f)(s) foundry: "monotype"(s) antialias: FcTrue(s) hintstyle: 3(i)(s) hinting: FcTrue(s) verticallayout: FcFalse(s) autohint: FcTrue(s) globaladvance: FcTrue(s) file: "/usr/X11R6/lib/X11/fonts/truetype/truetype/arialbd.ttf" +(s) index: 0(i)(s) outline: FcTrue(s) scalable: FcTrue(s) dpi: 75(f)(s) rgba: 1(i)(w) scale: 1(f)(s) charset: set(s) lang: aa|af|ar|ast|ava|ay|az|az-ir|be|bg|bi|bin|br|bs|bua|ca|. +.. fontversion: 184812(i)(s) capability: "otlayout:arab"(s) fontformat: "TrueType"(s) embeddedbitmap: FcFalse(w)
With --sort you'd get a sorted list of best matching fonts...
I have no idea, however, how that relates to the XLFD that you mentioned. Also, I'm not aware of any Perl binding to the fontconfig library (but it shouldn't be too difficult to create one, should you prefer to make direct calls into the lib, instead of using the supplied utility — the interface is reasonably well documented).
In reply to Re: Module to map fontnames to X11 fonts.dir entries ?
by almut
in thread Module to map fontnames to X11 fonts.dir entries ?
by renodino
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |