## Font Selection

Font Selection — Fontconfig font selection configuration

## Functions

FontManagerSelections * | font_manager_selections_new ()
gboolean | font_manager_selections_load ()
gboolean | font_manager_selections_save ()
gchar * | font_manager_selections_get_filepath ()

## Properties

char * | config-dir | Read / Write
char * | target-element | Read / Write
char * | target-file | Read / Write

## Types and Values

#define | FONT_MANAGER_TYPE_SELECTIONS
struct | FontManagerSelectionsClass
| FontManagerSelections

## Object Hierarchy

        GObject
        ╰── FontManagerStringSet
            ╰── FontManagerSelections
                ├── FontManagerDirectories
                ╰── FontManagerReject

## Includes

    #include <font-manager-selections.h>

## Description

Base class for generating fontconfig configuration files which modify font selections.

## Functions

### font_manager_selections_new ()

    FontManagerSelections *
    font_manager_selections_new (void);

#### Returns

A newly created FontManagerSelections. Free the returned object using ``g_object_unref()``.

[transfer full]

### font_manager_selections_load ()

    gboolean
    font_manager_selections_load (FontManagerSelections *self);

Load `target_file` from `config_dir`

#### Parameters

self | FontManagerSelections |

#### Returns

`TRUE` if configuration was loaded successfully.

### font_manager_selections_save ()

    gboolean
    font_manager_selections_save (FontManagerSelections *self);

Saves current selections to `target_file` in `config_dir`

#### Parameters

self | FontManagerSelections |

#### Returns

`TRUE` if configuration was saved successfully.

### font_manager_selections_get_filepath ()

    gchar *
    font_manager_selections_get_filepath (FontManagerSelections *self);

#### Parameters

self | FontManagerSelections |

#### Returns

A newly allocated string containing the full filepath to current configuration file or `NULL`. Free the result using ``g_free()``.

[transfer full][nullable]

## Types and Values

### FONT_MANAGER_TYPE_SELECTIONS

    #define FONT_MANAGER_TYPE_SELECTIONS (font_manager_selections_get_type())

### struct FontManagerSelectionsClass

    struct FontManagerSelectionsClass {
        FontManagerStringSetClass parent_class;

        gboolean (* load) (FontManagerSelections *self);
        gboolean (* save) (FontManagerSelections *self);
        void (* parse_selections) (FontManagerSelections *self, xmlNode *selections);
        void (* write_selections) (FontManagerSelections *self, FontManagerXmlWriter *writer);
        xmlNodePtr (* get_selections) (FontManagerSelections *self, xmlDocPtr doc);
    };

#### Members

`load` () | load configuration from file |
`save` () | save configuration to file |
`parse_selections` () | parse fontconfig selections |
`write_selections` () | write fontconfig selections |
`get_selections` () | returns an xmlNodePtr to the selectfont element |

### FontManagerSelections

    typedef struct _FontManagerSelections FontManagerSelections;

## Property Details

### The `“config-dir”` property

      “config-dir”               char *

Should be set to one of the directories monitored by Fontconfig for configuration files and writeable by the user.

Owner: FontManagerSelections

Flags: Read / Write

Default value: NULL

### The `“target-element”` property

      “target-element”           char *

Valid values: acceptfont or rejectfont

Owner: FontManagerSelections

Flags: Read / Write

Default value: NULL

### The `“target-file”` property

      “target-file”              char *

Should be set to a filename in the form [7][0-9]-*.conf

Owner: FontManagerSelections

Flags: Read / Write

Default value: NULL