[Fontconfig] Error accessing a FcConfig internal element
Adriano Del Vigna de Almeida
katmandu at fs.inf.br
Sat Jan 3 03:35:53 EST 2004
Ok, I solved the problem adding the file 'fcint.h' into my project. This
is the best solution?
At first I tryed to redefine FcConfig into the source code, but it
required to define also all of the inner variables... So I dicided to
include 'fcint.h' into the source code...
Thanks again.
Em Sex, 2004-01-02 às 12:16, Adriano Del Vigna de Almeida escreveu:
> Hello folks,
>
> I'm having a strange error. When I try to access some internal
> variable inside a FcConfig strucutre from a program I receive the
> following error:
>
> gcc -I /usr/include/freetype2 `pkg-config --cflags glib-2.0`
> -lfontconfig `pkg-config --libs glib-2.0` main.c fontsbase.c
> fcconfighandlers.c -o fontman
> main.c: In function `ListAllFonts':
> main.c:328: error: dereferencing pointer to incomplete type
> make: ** [all] Erro 1
>
> /***** CODE SNIPET ******************************/
>
>
> FcConfig *Config = NULL;
> FcFontSet *FontSet = NULL;
>
> FcPattern *Pattern = NULL;
> FcObjectSet *ObjectSet = NULL;
> FcChar8 *Family;
>
> unsigned int count;
>
> Config = FcInitLoadConfigAndAllFonts();
> if(Config == NULL)
> {
> puts("Error on creating a Fontconfig configuration!");
> return(0);
> }
>
> FcConfigSetCurrent(Config);
>
> Pattern = FcPatternCreate();
> ObjectSet = FcObjectSetBuild(FC_FAMILY, 0);
> FontSet = FcFontList(0, Pattern, ObjectSet);
>
> for(count = 0; count < FontSet->nfont; count++)
> {
> FcPatternGetString(FontSet->fonts[count], FC_FAMILY, 0,
> &Family);
>
> /** I GOT AN ERROR AT THIS LINE!!
> ****************************/
> if(FcStrSetMember(Config->disabledFonts, Family))
> /************************************************************/
>
> printf("%s\t\t!!DISABLED!!\n", Family);
> else
> printf("%s\n", Family);
> }
> }
>
> /******* END *******************************/
>
> By the way, disabledFonts is a FcStrSet variable inside FcConfig
> structure. What I'm doing wrong? I have never seen this error
> before...
>
> Thanks for the attention!
>
> --
> Adriano Del Vigna de Almeida <katmandu at fs.inf.br>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/fontconfig/attachments/20040102/6c8a43be/attachment.htm
More information about the Fontconfig
mailing list