Details

[Home]

Issue of the Implementation # S0600

Brief

The function FcConfigSetCurrent does not make the current configuration default

Detailed Description

The description of the function FcConfigSetCurrent states: "Sets the current default configuration to config". But after changing the font configuration, the function FcConfigSetCurrent doesn't make it as default configuration.

Problem location(s) in the standard

Fontconfig Developers Reference, Version 2.4.2

Reproducing

  1. Get the current font configuration (FcConfigGetCurrent).
  2. Change in this configuration one of the parameters - rescan interval (FcConfigGetRescanInverval and FcConfigSetRescanInverval)
  3. Try to make the current configuration as default (FcConfigSetCurrent).
  4. Get the current font configuration again (FcConfigGetCurrent).
  5. Call FcConfigGetRescanInverval.
FcConfigGetRescanInverval returns an incorrect value, not the value we set on the step 2.

Example

    FcConfig        *fc;
    int             fc_ri_old, fc_ri_new;
    
    if (!(fc = FcConfigGetCurrent ()))
    {
        printf ("Could not get current config\n");
    }
    fc_ri_old = FcConfigGetRescanInverval (fc);
    FcConfigSetRescanInverval (fc, fc_ri_old + 10);

    if (!FcConfigSetCurrent (fc))
    {
        printf ("FcConfigSetCurrent failed\n");
    }
    if (!(fc = FcConfigGetCurrent ()))
    {
        printf ("Could not get current config\n");
    }
    fc_ri_new = FcConfigGetRescanInverval (fc);
    printf ("Rescan interval from the new current config "
            "is %d, (should be %d).\n", fc_ri_new, fc_ri_old + 10);

    /*
     *    fc_ri_new should be equal to fc_ri_old + 10
     */

Component

fontconfig 2.4.1 or later

Environment

Architectures

x86_64

Accepted

freedesktop.org Bugzilla 12992

[Home]