Cairo question for Brucey (Also: Mild flattery)

BlitzMax Forums/BlitzMax Programming/Cairo question for Brucey (Also: Mild flattery)

Sledge(Posted 2008) [#1]
Just out of interest, theoretically speaking, how arduous a job would it be to relieve the Cairo module of its dependencies on FontConfig? I've got a simple text editor project in mind that only needs to ship with its own freeware font so FontConfig's automated cataloguing of available fonts is really overkill*. Do you think it's a realistic proposition or are they so closely interwoven that I'd have to be mad to even think about it?

Any advice/guidance appreciated -- Cairo looks the business but it could really do without the bloat (and tantrums, see below) of FontConfig for me. *Cough*CAIROLITE*Cough* ;D

*And apparently broken, I should mention -- the current version doesn't work as described in the docs in that it doesn't seem to automagically generate a reference config file anywhere locatable (I have to copy the one out of the examples folder into the application directory to avoid an error!) I'm assuming that Cairo applications are supposed to generate the config file on first run in the same way that a FontConfig example is? At the moment the ShowText() method generates a "Cannot load default config file" error if I don't manually supply the file... the pdf_output program (for it is he) completes but the pdf is subsequently devoid of text.


Brucey(Posted 2008) [#2]
It's relatively easy to pull fontconfig support out of Cairo... but then you lose FreeType support - which is essentially most of your font stuff.

The problem Win32 users are having with Cairo is because Cairo/Fontconfig comes from a non-Win32 background, and Fontconfig in particular would generally be expected to have been installed properly for it to work as expected.

In order to provide Windows users a similar experience to the rest I essentially hacked in a build of fontconfig for them. On Linux, it uses the already-expected-to-be-installed-on-the-system version of the library :-)

Did I say in the docs that the config file is generated? If I did then I guess I've forgotten to do something ;-)

If you don't need text support, we could have a build without fontconfig...

On the otherhand, cairo supports other backends, such as the windows one, but then your windows fonts would only render to a window so would be of limited use.


Sledge(Posted 2008) [#3]
Thanks for the info. The auto config generation thing in the docs refers to the Home folder -- I only took similar behaviour to be implicit under Windows because it seems to have similar expectations itself, but it was only an assumption (I had no idea it was an integral part of Linux). It not automatically cataloguing fonts under Windows is preferred behaviour to me so that's good!

I'm primarily interested in using Cairo to generate a pdf with text in a monospace font so, if push comes to shove, I could always circumvent font rendering altogether by generating the text with bitmaps.


CASO(Posted 2008) [#4]
I like fontconfig but does it have to create files all over the place?
I write programs for school use and don't like my programs creating files outside of its folder.