Re: [racket-users] racket/draw: how to extract the path from a font% object?

2020-04-02 Thread Matthew Butterick
The thorny issue that `fontconfig` handles is mapping from a high-level specification of a font (e.g., family, weight, slant) — that is, how a user would typically specify a font — to an actual font file on disk. The shortcoming with font filenames is that they don't reliably tell you anything

Re: [racket-users] racket/draw: how to extract the path from a font% object?

2020-04-01 Thread David Storrs
I knocked together a very minimal pure-Racket library for this so you don't have to FFI. It won't give you all the bells and whistles, but it should be a good starting point. https://pkgd.racket-lang.org/pkgn/package/font-finder Docs: https://github.com/dstorrs/font-finder/blob/master/README.m

Re: [racket-users] racket/draw: how to extract the path from a font% object?

2020-04-01 Thread Matthew Butterick
The answer is you can't, through pure Racket, because Racket delegates the nitty-gritty of font-file resolution to external font-handling libraries. It is possible, however, to call into the `fontconfig` library via the FFI and make it do the heavy lifting of 1) scanning font directories to amas

[racket-users] racket/draw: how to extract the path from a font% object?

2020-03-31 Thread Matthew Butterick
IIUC every `font%` object must correspond to a particular font file on disk. If so, given a `font%` object, how do I extract the path to that file? -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receivin