| GTK-EXTRA - Reference Manual

| Home

## Name

### Gtkpsfont - PostScript Fonts handling

## Synopsis

    gint

    gtk_psfont_init

    ();

    void

    gtk_psfont_unref

    ();

    GtkPSFont*

    gtk_psfont_get_font

    (const gchar *name);

    GdkFont*

    gtk_psfont_get_gdkfont

    (const gchar *name, gint height);

    gchar *

    gtk_psfont_get_psfontname

    (const gchar *name);

    void

    gtk_psfont_add_font

    (const char *fontname,
     const gchar *psname,
     const gchar *family,
     gchar *x_string[],
     gboolean italic,
     gboolean bold);

    void

    gtk_psfont_add_i18n_font

    (const char *fontname,
     const gchar *psname,
     const gchar *family,
     const gchar *i18n_latinfamily,
     gchar *x_string[],
     gboolean italic,
     gboolean bold,
     gboolean vertical);

    GtkPSFont *

    gtk_psfont_find_by_family

    (const gchar *name,
     gboolean italic,
     gboolean bold);

    void

    gtk_psfont_get_families

    (GList **family,
    gint *numf);

    void

    gtk_psfont_get_char_size

    (GtkPSFont *psfont,
     GdkFont *font,
     GdkFont *latin_font,
     GdkWChar wc,
     gint *width,
     gint *ascent,
     gint *descent);

## Object Hierarchy

##
Args

## Signal Prototypes

    No signal

## Description

### struct GtkPSFont

    struct _GtkPSFont {
      gchar *fontname;
      gchar *psname;
      gchar *family;
      gchar *xfont[2];
      gchar *i18n_latinfamily;
      gboolean italic;
      gboolean bold;
      gboolean vertical;
    };

### gtk_psfont_init ()

    gint	gtk_psfont_init			();

Initialize GtkPsFont data structure

Returns : | FALSE =>PS fonts already initilized TRUE => success

### gtk_psfont_unref ()

    void gtk_psfont_unref ();

Unreferentiate(deletes) the fonts allocated list

### gtk_psfont_get_font ()

    GtkPSFont* gtk_psfont_get_font (const gchar *name);

name | name of the font

### gtk_psfont_get_gdkfont ()

    GdkFont*	gtk_psfont_get_gdkfont 	(const gchar *name, gint height);

name | name of the font
`height` | height of the font

### gtk_psfont_get_psfontname ()

    gchar * gtk_psfont_get_psfontname	(const gchar *name);

Returns the Postscript name (GtkPSFont->psname)

name | fonr name(GtkPSFont->fontname)
`Returns` | (GtkPSFont->psname)

### gtk_psfont_add_font ()

    void gtk_psfont_add_font (const char *fontname,
                              const gchar *psname,
                              const gchar *family,
                              gchar *x_string[],
                              gboolean italic,
                              gboolean bold);

Appends font to the user font list.

fontname | name of the font
psname | PostScript name of the font
family | Font family
x_string[] |
italic | TRUE =>set italic font FALSE =>non-italic
bold | TRUE =>set bold font FALSE =>non-bold

### gtk_psfont_add_i18n_font()

    void gtk_psfont_add_i18n_font (const char *fontname,
                                   const gchar *psname,
                                   const gchar *family,
                                   const gchar *i18n_latinfamily,
                                   gchar *x_string[],
                                   gboolean italic,
                                   gboolean bold,
                                   gboolean vertical);

Add an I18n font(internationalization).See locale

fontname | name of the font
psname | PostScript name of the font
family | Font family
i18n_latinfamily | I18n(internationalization) latin family.See locale
x_string[] |
italic | TRUE =>set italic font FALSE =>non-italic
bold | TRUE =>set bold font FALSE =>non-bold

### gtk_psfont_find_by_family()

    GtkPSFont * 	gtk_psfont_find_by_family  (const gchar *name,
                                              gboolean italic,
                                              gboolean bold);

Return the first font from user_font list which suits the arguments.

name | name of the font family
italic | TRUE =>set italic font FALSE =>non-italic
bold | TRUE =>set bold font FALSE =>non-bold

### gtk_psfont_get_families()

    void 	gtk_psfont_get_families	(GList **family, gint *numf);

Get a list of double linked lists of family of fonts.

family | a list of double linked lists
numf | number of families

### gtk_psfont_get_char_size()

    void gtk_psfont_get_char_size (GtkPSFont *psfont,
                                   GdkFont *font,
                                   GdkFont *latin_font,
                                   GdkWChar wc,
                                   gint *width,
                                   gint *ascent,
                                   gint *descent);

Get the width, ascent and descent of a character

psfont | GtkPSFont *psfont
font |
latin_font |
wc |
width |
ascent |
descent |

| Home |  |