## GoFont GoFont — Fonts |

## Synopsis

                        GOFontMetrics;
                        GOFont;
    GOFontconst *       go_font_new_by_desc                 (PangoFontDescription *desc);
    GOFontconst *       go_font_new_by_name                 (char const *str);
    GOFontconst *       go_font_new_by_index                (unsigned  i);
    char*               go_font_as_str                      (GOFont const *font);
    GOFontconst *       go_font_ref                         (GOFont const *font);
    void                go_font_unref                       (GOFont const *font);
    gboolean            go_font_eq                          (GOFont const *a,
                                                             GOFont const *b);
    GSList*             go_fonts_list_families              (PangoContext *context);
    GSList*             go_fonts_list_sizes                 (void);
    GOFontMetrics*      go_font_metrics_new                 (PangoContext *context,
                                                             GOFont const *font);
    void                go_font_metrics_free                (GOFontMetrics *metrics);
    void                go_font_cache_register              (GClosure *callback);
    void                go_font_cache_unregister            (GClosure *callback);
    void                go_fonts_init                       (void);
    void                go_fonts_shutdown                   (void);

## Description

## Details

### GOFontMetrics

    typedef struct {
    	int digit_widths[10];
    	int min_digit_width;
    	int max_digit_width;
    	int avg_digit_width;
    	int hyphen_width, minus_width, plus_width;
    	int E_width;
    	int hash_width;
    	int space_width;

    	/*
    	 * A space that is narrower than a regular space, or 0 if no such
    	 * character was found.
    	 */
    	gunichar thin_space;
    	int thin_space_width;
    } GOFontMetrics;

### GOFont

    typedef struct {
    	int ref_count;
    	int font_index; /* each renderer keeps an array for lookup */

    	PangoFontDescription *desc;

    	/* Attributes.  Currently unused.  */
    	int underline;
    	gboolean strikethrough;
    	GOColor color;
    } GOFont;

### go_font_new_by_desc ()

    GOFontconst *       go_font_new_by_desc                 (PangoFontDescription *desc);

Aborbs `desc` and returns a ref to a font that matches it.

`desc` : | PangoFontDescription
Returns : |

### go_font_new_by_name ()

    GOFontconst *       go_font_new_by_name                 (char const *str);

`str` : |
Returns : |

### go_font_new_by_index ()

    GOFontconst *       go_font_new_by_index                (unsigned  i);

`i` : |
Returns : |

### go_font_as_str ()

    char*               go_font_as_str                      (GOFont const *font);

`font` : |
Returns : |

### go_font_ref ()

    GOFontconst *       go_font_ref                         (GOFont const *font);

`font` : |
Returns : |

### go_font_unref ()

    void                go_font_unref                       (GOFont const *font);

`font` : |

### go_font_eq ()

    gboolean            go_font_eq                          (GOFont const *a,
                                                             GOFont const *b);

`a` : |
`b` : |
Returns : |

### go_fonts_list_families ()

    GSList*             go_fonts_list_families              (PangoContext *context);

`context` : |
Returns : |

### go_fonts_list_sizes ()

    GSList*             go_fonts_list_sizes                 (void);

Returns : |

### go_font_metrics_new ()

    GOFontMetrics*      go_font_metrics_new                 (PangoContext *context,
                                                             GOFont const *font);

`context` : |
`font` : |
Returns : |

### go_font_metrics_free ()

    void                go_font_metrics_free                (GOFontMetrics *metrics);

`metrics` : |

### go_font_cache_register ()

    void                go_font_cache_register              (GClosure *callback);

`callback` : |

### go_font_cache_unregister ()

    void                go_font_cache_unregister            (GClosure *callback);

`callback` : |

### go_fonts_init ()

    void                go_fonts_init                       (void);

### go_fonts_shutdown ()

    void                go_fonts_shutdown                   (void);