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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.