summaryrefslogtreecommitdiff
path: root/pango/pangoft2-private.h
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2000-08-20 08:36:41 +0000
committerTor Lillqvist <tml@src.gnome.org>2000-08-20 08:36:41 +0000
commit79546feb86a232b0d3e01b1f436e258aef32b840 (patch)
treed35f417b2a3112bb3e0fb18d4fc057a37ab79f40 /pango/pangoft2-private.h
parente95590dd006740ab6bdcf71cae31efbf8404033e (diff)
downloadpango-79546feb86a232b0d3e01b1f436e258aef32b840.tar.gz
Add parameter telling whether to print warning or not if string isn't
2000-08-20 Tor Lillqvist <tml@iki.fi> * pango/pango-utils.c (pango_parse_*): Add parameter telling whether to print warning or not if string isn't recognised. Use g_strncasecmp(). * pango/pango-utils.h: Change prototype accordingly. * pango/pangox-fontmap.c * pango/pangowin32-fontmap.c: Change calls correspondingly. * pango/pangowin32.h: * pango/pangowin32.c: Cosmetic changes, dead code removal. * pango/pangoft2.h * pango/pangoft2-private.h * pango/pangoft2.c * pango/pangoft2-fontmap.c * pango/pangoft2-fontcache.c: New files implementing a FreeType2 backend. Used only on Win32 so far, but doesn't contain Win32-specific code per se, so if somebody wants to try it out on X11, too, be my guest. It works, more or less, but there are some details still to sort out. Performance needs to be improved. Debugging printouts still present. Font path currently hardcoded to C:\windows\fonts, heh. Owen says he doesn't think it's a good idea to use ths on Win32, but I'll try anyway. If it turns out using the native Win32 GDI backend is better after all, oh well. * pango/makefile.mingw: Delete. Move contents to makefile.mingw.in. * pango/makefile.mingw.in: New file. Add rules for FreeType2 backend. Add FreeType2 CFLAGS and LIBS. * pango/Makefile.am: Generate makefile.mingw. (EXTRA_DIST): Add FreeType2 backend sources, and makefile.mingw{,.in} * modules/basic/basic-win32.c: Couple of cosmetic changes. * modules/basic/Makefile.am: Generate makefile.mingw. (EXTRA_DIST): Add basic-ft2.c, and makefile.mingw{,.in} * modules/basic/makefile.mingw: Delete. Move contents to makefile.mingw.in. * modules/basic/makefile.mingw.in: New file. Add rule for basic-ft2. Add FreeType2 CFLAGS and LIBS. * examples/viewer-win32.c (read_file): Fix error messages. (draw): Get HDC from GDK once for all paragraphs. * examples/viewer-ft2.c: New file. The FT_Bitmap (256-level bitmap) produced by the FreeType2 backend is copied to the GtkLayout window using gdk_draw_gray_image from GdkRGB (!). Yes, this is kinda circular dependency between Pango and GTK+. * examples/makefile.mingw: Delete. Move contents to makefile.mingw.in. * examples/makefile.mingw.in: New file. Add rules for viewer-ft2. Add FreeType2 CFLAGS and LIBS. * examples/Makefile.am: Generate makefile.mingw. (EXTRA_DIST): Add viewer-win32.c and viewer-ft2.c, and makefile.mingw{,.in}
Diffstat (limited to 'pango/pangoft2-private.h')
-rw-r--r--pango/pangoft2-private.h97
1 files changed, 97 insertions, 0 deletions
diff --git a/pango/pangoft2-private.h b/pango/pangoft2-private.h
new file mode 100644
index 00000000..92b1c053
--- /dev/null
+++ b/pango/pangoft2-private.h
@@ -0,0 +1,97 @@
+/* Pango
+ * pangoft2-private.h:
+ *
+ * Copyright (C) 1999 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 __PANGOFT2_PRIVATE_H__
+#define __PANGOFT2_PRIVATE_H__
+
+#include "pango-modules.h"
+#include "pangoft2.h"
+
+/* Debugging... */
+#define DEBUGGING 1
+
+#ifdef DEBUGGING
+#define PING(printlist) \
+(g_print ("%s:%d ", __PRETTY_FUNCTION__, __LINE__), \
+ g_print printlist)
+#else
+#define PING(printlist)
+#endif
+
+#define PANGO_SCALE_26_6 (PANGO_SCALE / (1<<6))
+#define PANGO_PIXELS_26_6(d) \
+ (((d) >= 0) ? \
+ ((d) + PANGO_SCALE_26_6 / 2) / PANGO_SCALE_26_6 : \
+ ((d) - PANGO_SCALE_26_6 / 2) / PANGO_SCALE_26_6)
+#define PANGO_UNITS_26_6(d) (PANGO_SCALE_26_6 * (d))
+
+typedef struct _PangoFT2OA PangoFT2OA;
+typedef struct _PangoFT2Font PangoFT2Font;
+typedef struct _PangoFT2FontEntry PangoFT2FontEntry;
+typedef struct _PangoFT2SubfontInfo PangoFT2SubfontInfo;
+
+struct _PangoFT2OA
+{
+ FT_Open_Args *open_args;
+ FT_Long face_index;
+};
+
+struct _PangoFT2Font
+{
+ PangoFont font;
+
+ /* A PangoFT2Font consists of one or several FT2 fonts (faces) that
+ * are assumed to blend visually well, and cover separate parts of
+ * the Unicode characters. The FT2 faces are not kept unnecessarily
+ * open, thus also we keep both the FT_Open_Args (and face index),
+ * and FT_Face.
+ */
+ PangoFT2OA **oa;
+ FT_Face *faces;
+ int n_fonts;
+
+ int size;
+
+ GSList *metrics_by_lang;
+
+ PangoFontMap *fontmap;
+ /* If TRUE, font is in cache of recently unused fonts and not otherwise
+ * in use.
+ */
+ gboolean in_cache;
+
+ PangoFT2FontEntry *entry; /* Used to remove cached fonts */
+};
+
+PangoMap *pango_ft2_get_shaper_map (const char *lang);
+PangoCoverage *pango_ft2_font_entry_get_coverage (PangoFT2FontEntry *entry,
+ PangoFont *font,
+ const char *lang);
+void pango_ft2_font_entry_remove (PangoFT2FontEntry *entry,
+ PangoFont *font);
+FT_Library *pango_ft2_fontmap_get_library (PangoFontMap *fontmap);
+void pango_ft2_fontmap_cache_add (PangoFontMap *fontmap,
+ PangoFT2Font *ft2font);
+void pango_ft2_fontmap_cache_remove (PangoFontMap *fontmap,
+ PangoFT2Font *ft2font);
+const char *pango_ft2_ft_strerror (FT_Error error);
+
+#endif /* __PANGOFT2_PRIVATE_H__ */