Details

[Home]

Issue of the Implementation # S0604

Brief

FcFreeTypeQuery returns the null pointer

Detailed Description

The description of the function FcFreeTypeQuery states: "Constructs a pattern representing the 'id'th font in 'file'". But for the given font file the function FcFreeTypeQuery returns the null pointer instead of creation the pattern and return the pointer on it.

Problem location(s) in the standard

Fontconfig Developers Reference, Version 2.4.2

Example

#define FILE_PATH  "UTBI__10-ISO8859-10.pcf.gz" //the font file name

FcConfig  *fc;
FcFontSet *set;
FcStrSet  *dirs;
FcBlanks  *blanks;
FcPattern *fcp;
int        count;
	
  FcInit ();
  if (!(fc = FcConfigGetCurrent ()))
  {
    printf ("Could not get current config
");
  }
  if (!(set = FcFontSetCreate ()))
  {
    printf ("Could not create font sets
");
  }
  if (!(dirs = FcStrSetCreate ()))
  {
    printf ("Could not create str set
");
  }
  if (!(blanks = FcConfigGetBlanks (fc)))
  {
    printf ("Could not create blanks
");
  }	

  /*
   * Constructs a pattern representing the 'id'th font in 'file'
   *
   * The number of fonts in 'file' is returned in 'count'.
   */
  fcp = FcFreeTypeQuery ((FcChar8 *)FILE_PATH, 0, blanks, &count);

  printf ("The number of fonts in the file - %d
" 
          "The address of the first font - %p
", count, fcp);

Component

fontconfig 2.2.3 or later

Accepted

freedesktop.org Bugzilla 12993

[Home]