Sign up

I find I need Fontconfig…

The Gtk+ C++ application I am rewriting in D uses Fontconfig rather than Pango because Pango doesn't expose the data needed for the application, that is only in Fontconfig. GtkD provides a Pango binding, but no Fontconfig binding. There is a GIR file for Fontconfig. I am wondering whether to do the whole D binding to Fontconfig thing using girtod, or whether to just hack up enough stuff to do with the structs, enums, and functions of Fonconfig.

Anyone been down this route before?

Re: I find I need Fontconfig…

On 9/2/18 2:52 PM, Russel Winder wrote:

The Gtk+ C++ application I am rewriting in D uses Fontconfig rather than Pango because Pango doesn't expose the data needed for the application, that is only in Fontconfig. GtkD provides a Pango binding, but no Fontconfig binding. There is a GIR file for Fontconfig. I am wondering whether to do the whole D binding to Fontconfig thing using girtod, or whether to just hack up enough stuff to do with the structs, enums, and functions of Fonconfig.

Anyone been down this route before?

The GIR file for fontconfig is just a stub with a few things needed for
the other GIR files.

So using girtod isn't a option, but:
https://github.com/WebFreak001/fontconfig-d might be useful.

Re: I find I need Fontconfig…

On Sun, 2 Sep 2018 19:07:48 +0200, Mike Wey wrote:
[…]

The GIR file for fontconfig is just a stub with a few things needed for
the other GIR files.

I have to admit I didn't actually look at the file, just for it's presence. It sounds like the GIR file hasn't been properly constructed on the prejudice that only people doing Pango will use Fontconfig. :-(

So using girtod isn't a option, but:
https://github.com/WebFreak001/fontconfig-d might be useful.

Interesting. It seems a snapshot of fcfreetype.h and fonconfig.h were taken and then manually transformed. Not really the best route since it means manual updating, but it is a backstop.

I think I'll try using DStep to see how good a job it makes. If that fails then I'll fork the fontconfig-d repository and update it.

An interesting lesson from zmqd as mentioned on the mailing list is the conversion from C API return codes to something more idiomatically D. However whilst 0MQ might get a lot of use, I think use of Fontconfig in D is going to be very, very niche. :-)

Re: I find I need Fontconfig…

It appears DStep does a very acceptable job of creating a low-level D binding to Fontconfig. :-)

Re: I find I need Fontconfig…

On 9/2/18 7:22 PM, Russel Winder wrote:

I have to admit I didn't actually look at the file, just for it's presence. It sounds like the GIR file hasn't been properly constructed on the prejudice that only people doing Pango will use Fontconfig.:-(

As far as i know a library has to be based on GLib for the introspection
used to generate the GIR files to work properly.

It appears DStep does a very acceptable job of creating a low-level D

binding to Fontconfig.

:)