diff options
author | Owen Taylor <otaylor@redhat.com> | 2000-02-01 06:55:09 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2000-02-01 06:55:09 +0000 |
commit | 532c6902c34f47d5f838623c951e53d5fcdd395f (patch) | |
tree | 1a336bca112ada6b934f264b9c832bceb6fe1771 /pango/pango-font.h | |
parent | 635469870a2b1375105cb305b9f4b09fa05d2208 (diff) | |
download | pango-532c6902c34f47d5f838623c951e53d5fcdd395f.tar.gz |
The great header file reorganization. Split up roughtly by objects.
Wed Feb 2 00:07:13 2000 Owen Taylor <otaylor@redhat.com>
* libpango/pango-*.h: The great header file reorganization.
Split up roughtly by objects.
* libpango/pango-font.h libpango/fonts.h: Add generic
font-loading and listing interfaces.
* libpango/pangox.c: Implement font-listing/loading interfaces
for X.
* libpango/pango-context.[ch]: Flesh out context structure.
Add appropriate accesors, font loading-methods, etc.
* libpango/pango-coverage.[ch]: Coverage map objects.
* examples/viewer.c: First stab at adding font-selection. Majorly
deficient for the moment until we add font lists and fallbacks
based on coverage maps.
Diffstat (limited to 'pango/pango-font.h')
-rw-r--r-- | pango/pango-font.h | 153 |
1 files changed, 153 insertions, 0 deletions
diff --git a/pango/pango-font.h b/pango/pango-font.h new file mode 100644 index 00000000..45d90e75 --- /dev/null +++ b/pango/pango-font.h @@ -0,0 +1,153 @@ +/* Pango + * pango-font.h: Font handling + * + * Copyright (C) 2000 Red Hat Software + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_FONT_H__ +#define __PANGO_FONT_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <pango-coverage.h> +#include <pango-types.h> + +typedef struct _PangoFontDescription PangoFontDescription; +typedef struct _PangoFont PangoFont; +typedef struct _PangoFontClass PangoFontClass; +typedef struct _PangoFontMap PangoFontMap; +typedef struct _PangoFontMapClass PangoFontMapClass; + +typedef enum { + PANGO_STYLE_NORMAL, + PANGO_STYLE_OBLIQUE, + PANGO_STYLE_ITALIC +} PangoStyle; + +typedef enum { + PANGO_VARIANT_NORMAL, + PANGO_VARIANT_SMALL_CAPS +} PangoVariant; + +typedef enum { + PANGO_WEIGHT_NORMAL = 400, + PANGO_WEIGHT_BOLD = 700 +} PangoWeight; + +typedef enum { + PANGO_STRETCH_ULTRA_CONDENSED, + PANGO_STRETCH_EXTRA_CONDENSED, + PANGO_STRETCH_CONDENSED, + PANGO_STRETCH_SEMI_CONDENSED, + PANGO_STRETCH_NORMAL, + PANGO_STRETCH_SEMI_EXPANDED, + PANGO_STRETCH_EXPANDED, + PANGO_STRETCH_EXTRA_EXPANDED, + PANGO_STRETCH_ULTRA_EXPANDED +} PangoStretch; + +struct _PangoFontDescription { + gchar *family_name; + + PangoStyle style; + PangoVariant variant; + PangoWeight weight; + PangoStretch stretch; +}; + +PangoFontDescription *pango_font_description_copy (PangoFontDescription *desc); +void pango_font_description_free (PangoFontDescription *desc); +void pango_font_descriptions_free (PangoFontDescription **descs, + int n_descs); + +/* Logical fonts + */ +struct _PangoFont +{ + PangoFontClass *klass; + + /*< private >*/ + gint ref_count; + GData *data; +}; + +struct _PangoFontClass +{ + void (*destroy) (PangoFont *font); + PangoFontDescription *(*describe) (PangoFont *font); + PangoCoverage * (*get_coverage) (PangoFont *font); + PangoEngineShape * (*find_shaper) (PangoFont *font, + const gchar *lang, + guint32 ch); +}; + +void pango_font_init (PangoFont *font); +void pango_font_ref (PangoFont *font); +void pango_font_unref (PangoFont *font); +gpointer pango_font_get_data (PangoFont *font, + gchar *key); +void pango_font_set_data (PangoFont *font, + gchar *key, + gpointer data, + GDestroyNotify destroy_func); + +PangoFontDescription *pango_font_describe (PangoFont *font); +PangoCoverage * pango_font_get_coverage (PangoFont *font); +PangoEngineShape * pango_font_find_shaper (PangoFont *font, + const gchar *lang, + guint32 ch); + +/* + * Font Map + */ + +struct _PangoFontMap +{ + PangoFontMapClass *klass; + + /*< private >*/ + gint ref_count; +}; + +struct _PangoFontMapClass +{ + void (*destroy) (PangoFontMap *fontmap); + PangoFont *(*load_font) (PangoFontMap *fontmap, + PangoFontDescription *desc, + double size); + void (*list_fonts) (PangoFontMap *fontmap, + PangoFontDescription ***descs, + int *n_descs); +}; + +void pango_font_map_init (PangoFontMap *fontmap); +void pango_font_map_ref (PangoFontMap *fontmap); +void pango_font_map_unref (PangoFontMap *fontmap); +PangoFont *pango_font_map_load_font (PangoFontMap *fontmap, + PangoFontDescription *desc, + double size); +void pango_font_map_list_fonts (PangoFontMap *fontmap, + PangoFontDescription ***descs, + int *n_descs); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif __PANGO_FONT_H__ |