diff options
author | nobody <nobody@localhost> | 2000-08-22 20:05:30 +0800 |
---|---|---|
committer | nobody <nobody@localhost> | 2000-08-22 20:05:30 +0800 |
commit | 4feb5a35394873211173950dd8a93f34fa510f95 (patch) | |
tree | 3b4824784cd30983db4a6ae1f38db287d5815941 /e-util/e-font.c | |
parent | 44ae37c371e25fe05e8aee145f1d9af7130a201d (diff) | |
download | gsoc2013-evolution-4feb5a35394873211173950dd8a93f34fa510f95.tar gsoc2013-evolution-4feb5a35394873211173950dd8a93f34fa510f95.tar.gz gsoc2013-evolution-4feb5a35394873211173950dd8a93f34fa510f95.tar.bz2 gsoc2013-evolution-4feb5a35394873211173950dd8a93f34fa510f95.tar.lz gsoc2013-evolution-4feb5a35394873211173950dd8a93f34fa510f95.tar.xz gsoc2013-evolution-4feb5a35394873211173950dd8a93f34fa510f95.tar.zst gsoc2013-evolution-4feb5a35394873211173950dd8a93f34fa510f95.zip |
This commit was manufactured by cvs2svn to create tag 'EOG_0_5'.EOG_0_5
svn path=/tags/EOG_0_5/; revision=4929
Diffstat (limited to 'e-util/e-font.c')
-rw-r--r-- | e-util/e-font.c | 128 |
1 files changed, 0 insertions, 128 deletions
diff --git a/e-util/e-font.c b/e-util/e-font.c deleted file mode 100644 index a13f0b962c..0000000000 --- a/e-util/e-font.c +++ /dev/null @@ -1,128 +0,0 @@ -#define _E_FONT_C_ - -/* - * e-font - * - * Temporary wrappers around GdkFonts to get unicode displaying - * - * Author: Lauris Kaplinski <lauris@helixcode.com> - * - * Copyright (C) 2000 Helix Code, Inc. - * - */ - -#include <unicode.h> -#include "e-font.h" - -struct _EFont { - GdkFont font; -}; - -EFont * -e_font_from_gdk_name (const gchar *name) -{ - GdkFont *font; - - font = gdk_fontset_load (name); - - return (EFont *) font; -} - -EFont * -e_font_from_gdk_font (GdkFont *font) -{ - gdk_font_ref (font); - - return (EFont *) font; -} - -void -e_font_ref (EFont *font) -{ - gdk_font_ref (&font->font); -} - -void -e_font_unref (EFont *font) -{ - gdk_font_unref (&font->font); -} - -gint -e_font_ascent (EFont * font) -{ - return font->font.ascent; -} - -gint -e_font_descent (EFont * font) -{ - return font->font.descent; -} - -void -e_font_draw_utf8_text (GdkDrawable *drawable, EFont *font, EFontStyle style, GdkGC *gc, gint x, gint y, gchar *text, gint numbytes) -{ - guchar *iso; - gchar *p; - gint uni, len; - - g_return_if_fail (drawable != NULL); - g_return_if_fail (font != NULL); - g_return_if_fail (gc != NULL); - g_return_if_fail (text != NULL); - - if (numbytes < 1) return; - - iso = alloca (numbytes); - - for (len = 0, p = text; p != NULL && p < (text + numbytes); len++, p = unicode_next_utf8 (p)) { - unicode_get_utf8 (p, &uni); - if ((uni < ' ') || (uni > 255)) uni = ' '; - iso[len] = uni; - } - - gdk_draw_text (drawable, &font->font, gc, x, y, iso, len); - - if (style & E_FONT_BOLD) - gdk_draw_text (drawable, &font->font, gc, x + 1, y, iso, len); -} - -gint -e_font_utf8_text_width (EFont *font, EFontStyle style, char *text, int numbytes) -{ - guchar *iso; - gchar *p; - gint uni, len; - - iso = alloca (numbytes); - - for (len = 0, p = text; p != NULL && p < (text + numbytes); len++, p = unicode_next_utf8 (p)) { - unicode_get_utf8 (p, &uni); - if ((uni < ' ') || (uni > 255)) uni = ' '; - iso[len] = uni; - } - - return gdk_text_width (&font->font, iso, len); -} - -gint -e_font_utf8_char_width (EFont *font, EFontStyle style, char *text) -{ - unicode_char_t uni; - guchar iso; - - if (!unicode_get_utf8 (text, &uni)) return 0; - - if ((uni < ' ') || (uni > 255)) uni = ' '; - - iso = uni; - - return gdk_text_width (&font->font, &iso, 1); -} - - - - - - |