summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@src.gnome.org>2003-04-14 20:42:45 +0000
committerOwen Taylor <otaylor@src.gnome.org>2003-04-14 20:42:45 +0000
commit5112146dc4f560563d8fb976adcd7a916d05785b (patch)
tree96e781f5c36b7ebaa74c88c3781968552f518534 /modules
parenta5961bac22c6d37ee81656501ab6d6652ea5ac1b (diff)
downloadpango-5112146dc4f560563d8fb976adcd7a916d05785b.tar.gz
Remove files from server copy
Diffstat (limited to 'modules')
-rw-r--r--modules/arabic/arabic-fc.c352
-rw-r--r--modules/basic/basic-fc.c269
-rw-r--r--modules/hangul/hangul-fc.c425
-rw-r--r--modules/hebrew/hebrew-fc.c248
-rw-r--r--modules/indic/indic-fc.c446
-rw-r--r--modules/thai/thai-fc.c251
6 files changed, 0 insertions, 1991 deletions
diff --git a/modules/arabic/arabic-fc.c b/modules/arabic/arabic-fc.c
deleted file mode 100644
index f4a63c0a..00000000
--- a/modules/arabic/arabic-fc.c
+++ /dev/null
@@ -1,352 +0,0 @@
-/* Pango
- * arabic-xft.h:
- *
- * Copyright (C) 2000 Red Hat Software
- * Author: Owen Taylor <otaylor@redhat.com>
- *
- * 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.
- */
-
-#include <string.h>
-
-#include "arabic-ot.h"
-
-#include "pangoxft.h"
-#include "pango-engine.h"
-#include "pango-utils.h"
-
-#define SCRIPT_ENGINE_NAME "ArabicScriptEngineXft"
-
-static PangoEngineRange arabic_ranges[] = {
- /* Language characters */
- { 0x060c, 0x06f9, "*" }, /* Arabic */
-};
-
-static PangoEngineInfo script_engines[] = {
- {
- SCRIPT_ENGINE_NAME,
- PANGO_ENGINE_TYPE_SHAPE,
- PANGO_RENDER_TYPE_XFT,
- arabic_ranges, G_N_ELEMENTS(arabic_ranges)
- }
-};
-
-static void
-maybe_add_feature (PangoOTRuleset *ruleset,
- PangoOTInfo *info,
- guint script_index,
- PangoOTTag tag,
- gulong property_bit)
-{
- guint feature_index;
-
- /* 0xffff == default language system */
- if (pango_ot_info_find_feature (info, PANGO_OT_TABLE_GSUB,
- tag, script_index, 0xffff, &feature_index))
- pango_ot_ruleset_add_feature (ruleset, PANGO_OT_TABLE_GSUB, feature_index,
- property_bit);
-}
-
-static PangoOTRuleset *
-get_ruleset (FT_Face face)
-{
- PangoOTRuleset *ruleset;
- static GQuark ruleset_quark = 0;
-
- PangoOTInfo *info = pango_ot_info_get (face);
-
- if (!ruleset_quark)
- ruleset_quark = g_quark_from_string ("pango-arabic-ruleset");
-
- if (!info)
- return NULL;
-
- ruleset = g_object_get_qdata (G_OBJECT (info), ruleset_quark);
-
- if (!ruleset)
- {
- PangoOTTag arab_tag = FT_MAKE_TAG ('a', 'r', 'a', 'b');
- guint script_index;
-
- ruleset = pango_ot_ruleset_new (info);
-
- if (pango_ot_info_find_script (info, PANGO_OT_TABLE_GSUB,
- arab_tag, &script_index))
- {
- maybe_add_feature (ruleset, info, script_index, FT_MAKE_TAG ('i','s','o','l'), isolated);
- maybe_add_feature (ruleset, info, script_index, FT_MAKE_TAG ('i','n','i','t'), initial);
- maybe_add_feature (ruleset, info, script_index, FT_MAKE_TAG ('m','e','d','i'), medial);
- maybe_add_feature (ruleset, info, script_index, FT_MAKE_TAG ('f','i','n','a'), final);
- maybe_add_feature (ruleset, info, script_index, FT_MAKE_TAG ('l','i','g','a'), 0xFFFF);
- }
-
- g_object_set_qdata_full (G_OBJECT (info), ruleset_quark, ruleset,
- (GDestroyNotify)g_object_unref);
- }
-
- return ruleset;
-}
-
-static void
-swap_range (PangoGlyphString *glyphs, int start, int end)
-{
- int i, j;
-
- for (i = start, j = end - 1; i < j; i++, j--)
- {
- PangoGlyphInfo glyph_info;
- gint log_cluster;
-
- glyph_info = glyphs->glyphs[i];
- glyphs->glyphs[i] = glyphs->glyphs[j];
- glyphs->glyphs[j] = glyph_info;
-
- log_cluster = glyphs->log_clusters[i];
- glyphs->log_clusters[i] = glyphs->log_clusters[j];
- glyphs->log_clusters[j] = log_cluster;
- }
-}
-
-static void
-set_glyph (PangoFont *font, PangoGlyphString *glyphs, int i, int offset, PangoGlyph glyph)
-{
- glyphs->glyphs[i].glyph = glyph;
- glyphs->log_clusters[i] = offset;
-}
-
-static void
-arabic_engine_shape (PangoFont *font,
- const char *text,
- gint length,
- PangoAnalysis *analysis,
- PangoGlyphString *glyphs)
-{
- int n_chars;
- int i;
- const char *p;
- gulong *properties = NULL;
- gunichar *wcs = NULL;
- FT_Face face;
- PangoOTRuleset *ruleset;
-
- g_return_if_fail (font != NULL);
- g_return_if_fail (text != NULL);
- g_return_if_fail (length >= 0);
- g_return_if_fail (analysis != NULL);
-
- face = pango_xft_font_lock_face (font);
- g_assert (face);
-
- n_chars = g_utf8_strlen (text, length);
- pango_glyph_string_set_size (glyphs, n_chars);
-
- ruleset = get_ruleset (face);
- if (ruleset)
- {
- wcs = g_utf8_to_ucs4_fast (text, length, NULL);
- properties = g_new0 (gulong, n_chars);
-
- Arabic_Assign_Properties (wcs, properties, n_chars);
- }
-
- p = text;
- for (i=0; i < n_chars; i++)
- {
- gunichar wc;
- gunichar mirrored_ch;
- PangoGlyph index;
- char buf[6];
- const char *input;
-
- wc = g_utf8_get_char (p);
-
- input = p;
- if (analysis->level % 2)
- if (pango_get_mirror_char (wc, &mirrored_ch))
- {
- wc = mirrored_ch;
-
- g_unichar_to_utf8 (wc, buf);
- input = buf;
- }
-
- if (wc >= 0x200B && wc <= 0x200F) /* Zero-width characters */
- {
- set_glyph (font, glyphs, i, p - text, 0);
- }
- else
- {
- /* Hack - Microsoft fonts are strange and don't contain the
- * correct rules to shape ARABIC LETTER FARSI YEH in
- * medial/initial position. It looks identical to ARABIC LETTER
- * YEH in these positions, so we substitute
- */
- if (wc == 0x6cc && ruleset &&
- ((properties[i] & (initial | medial)) != (initial | medial)))
- wc = 0x64a;
-
- index = pango_xft_font_get_glyph (font, wc);
-
- if (!index)
- {
- set_glyph (font, glyphs, i, p - text,
- pango_xft_font_get_unknown_glyph (font, wc));
- }
- else
- {
- set_glyph (font, glyphs, i, p - text, index);
-
- if (g_unichar_type (wc) == G_UNICODE_NON_SPACING_MARK)
- {
- if (i > 0)
- {
- glyphs->log_clusters[i] = glyphs->log_clusters[i-1];
-#if 0
- PangoRectangle logical_rect, ink_rect;
-
- glyphs->glyphs[i].geometry.width = MAX (glyphs->glyphs[i-1].geometry.width,
- glyphs->glyphs[i].geometry.width);
- glyphs->glyphs[i-1].geometry.width = 0;
-
- /* Some heuristics to try to guess how overstrike glyphs are
- * done and compensate
- */
- pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph, &ink_rect, &logical_rect);
- if (logical_rect.width == 0 && ink_rect.x == 0)
- glyphs->glyphs[i].geometry.x_offset = (glyphs->glyphs[i].geometry.width - ink_rect.width) / 2;
-#endif
- }
- }
- }
- }
-
- p = g_utf8_next_char (p);
- }
-
- ruleset = get_ruleset (face);
-
- if (ruleset)
- {
- pango_ot_ruleset_shape (ruleset, glyphs, properties);
-
- g_free (wcs);
- g_free (properties);
-
- }
-
- for (i = 0; i < glyphs->num_glyphs; i++)
- {
-
- if (glyphs->glyphs[i].glyph)
- {
- PangoRectangle logical_rect;
-
- pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph, NULL, &logical_rect);
- glyphs->glyphs[i].geometry.width = logical_rect.width;
- }
- else
- glyphs->glyphs[i].geometry.width = 0;
-
- glyphs->glyphs[i].geometry.x_offset = 0;
- glyphs->glyphs[i].geometry.y_offset = 0;
- }
-
- /* Simple bidi support */
-
- if (analysis->level % 2)
- {
- int start, end;
-
- /* Swap all glyphs */
- swap_range (glyphs, 0, glyphs->num_glyphs);
-
- /* Now reorder glyphs within each cluster back to LTR */
- for (start=0; start<glyphs->num_glyphs;)
- {
- end = start;
- while (end < glyphs->num_glyphs &&
- glyphs->log_clusters[end] == glyphs->log_clusters[start])
- end++;
-
- if (end > start + 1)
- swap_range (glyphs, start, end);
- start = end;
- }
- }
-
- pango_xft_font_unlock_face (font);
-}
-
-static PangoCoverage *
-arabic_engine_get_coverage (PangoFont *font,
- PangoLanguage *lang)
-{
- return pango_font_get_coverage (font, lang);
-}
-
-static PangoEngine *
-arabic_engine_xft_new ()
-{
- PangoEngineShape *result;
-
- result = g_new (PangoEngineShape, 1);
-
- result->engine.id = SCRIPT_ENGINE_NAME;
- result->engine.type = PANGO_ENGINE_TYPE_SHAPE;
- result->engine.length = sizeof (result);
- result->script_shape = arabic_engine_shape;
- result->get_coverage = arabic_engine_get_coverage;
-
- return (PangoEngine *)result;
-}
-
-/* The following three functions provide the public module API for
- * Pango. If we are compiling it is a module, then we name the
- * entry points script_engine_list, etc. But if we are compiling
- * it for inclusion directly in Pango, then we need them to
- * to have distinct names for this module, so we prepend
- * _pango_arabic_
- */
-#ifdef XFT_MODULE_PREFIX
-#define MODULE_ENTRY(func) _pango_arabic_xft_##func
-#else
-#define MODULE_ENTRY(func) func
-#endif
-
-/* List the engines contained within this module
- */
-void
-MODULE_ENTRY(script_engine_list) (PangoEngineInfo **engines, gint *n_engines)
-{
- *engines = script_engines;
- *n_engines = G_N_ELEMENTS (script_engines);
-}
-
-/* Load a particular engine given the ID for the engine
- */
-PangoEngine *
-MODULE_ENTRY(script_engine_load) (const char *id)
-{
- if (!strcmp (id, SCRIPT_ENGINE_NAME))
- return arabic_engine_xft_new ();
- else
- return NULL;
-}
-
-void
-MODULE_ENTRY(script_engine_unload) (PangoEngine *engine)
-{
-}
diff --git a/modules/basic/basic-fc.c b/modules/basic/basic-fc.c
deleted file mode 100644
index cdc0db36..00000000
--- a/modules/basic/basic-fc.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/* Pango
- * basic-xft.h:
- *
- * Copyright (C) 2000 Red Hat Software
- * Author: Owen Taylor <otaylor@redhat.com>
- *
- * 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.
- */
-
-#include <string.h>
-
-#include <glib/gprintf.h>
-#include "pangoxft.h"
-#include "pango-engine.h"
-#include "pango-utils.h"
-
-#include "basic-common.h"
-
-static PangoEngineRange basic_ranges[] = {
- /* Language characters */
- { 0x0380, 0x058f, "*" },
- { 0x10a0, 0x10ff, "*" }, /* Georgian */
- { 0x1200, 0x16ff, "*" }, /* Ethiopic,Cherokee,Canadian,Ogham,Runic */
- { 0x1e00, 0x1fff, "*" },
- { 0x2000, 0x302d, "*" },
- { 0x3030, 0x9fff, "*" },
- { 0xa000, 0xa4c6, "*" }, /* Yi */
- { 0xe000, 0xf7ee, "*" }, /* HKSCS-1999 */
- { 0xf900, 0xfa2d, "*" }, /* CJK Compatibility Ideographs */
- { 0xfe30, 0xfe6b, "*" }, /* CJK Compatibility Forms and Small Form Variants */
- { 0xff00, 0xffe3, "*" },
- { 0x0000, 0xffff, "" },
-};
-
-static PangoEngineInfo script_engines[] = {
- {
- "BasicScriptEngineXft",
- PANGO_ENGINE_TYPE_SHAPE,
- PANGO_RENDER_TYPE_XFT,
- basic_ranges, G_N_ELEMENTS(basic_ranges)
- }
-};
-
-static void
-swap_range (PangoGlyphString *glyphs, int start, int end)
-{
- int i, j;
-
- for (i = start, j = end - 1; i < j; i++, j--)
- {
- PangoGlyphInfo glyph_info;
- gint log_cluster;
-
- glyph_info = glyphs->glyphs[i];
- glyphs->glyphs[i] = glyphs->glyphs[j];
- glyphs->glyphs[j] = glyph_info;
-
- log_cluster = glyphs->log_clusters[i];
- glyphs->log_clusters[i] = glyphs->log_clusters[j];
- glyphs->log_clusters[j] = log_cluster;
- }
-}
-
-static void
-set_glyph (PangoFont *font, PangoGlyphString *glyphs, int i, int offset, PangoGlyph glyph)
-{
- PangoRectangle logical_rect;
-
- glyphs->glyphs[i].glyph = glyph;
-
- glyphs->glyphs[i].geometry.x_offset = 0;
- glyphs->glyphs[i].geometry.y_offset = 0;
-
- glyphs->log_clusters[i] = offset;
-
- pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph, NULL, &logical_rect);
- glyphs->glyphs[i].geometry.width = logical_rect.width;
-}
-
-static void
-basic_engine_shape (PangoFont *font,
- const char *text,
- gint length,
- PangoAnalysis *analysis,
- PangoGlyphString *glyphs)
-{
- int n_chars;
- int i;
- const char *p;
-
- g_return_if_fail (font != NULL);
- g_return_if_fail (text != NULL);
- g_return_if_fail (length >= 0);
- g_return_if_fail (analysis != NULL);
-
- n_chars = g_utf8_strlen (text, length);
- pango_glyph_string_set_size (glyphs, n_chars);
-
- p = text;
- for (i=0; i < n_chars; i++)
- {
- gunichar wc;
- gunichar mirrored_ch;
- PangoGlyph index;
-
- wc = g_utf8_get_char (p);
-
- if (analysis->level % 2)
- if (pango_get_mirror_char (wc, &mirrored_ch))
- wc = mirrored_ch;
-
- if (wc == 0xa0) /* non-break-space */
- wc = 0x20;
-
- if (ZERO_WIDTH_CHAR (wc))
- {
- set_glyph (font, glyphs, i, p - text, 0);
- }
- else
- {
- index = pango_xft_font_get_glyph (font, wc);
-
- if (!index)
- {
- set_glyph (font, glyphs, i, p - text,
- pango_xft_font_get_unknown_glyph (font, wc));
-
-#if 0
- gint j;
- char buf[9];
- int len = (wc < 65536) ? 6 : 8;
-
- g_sprintf (buf, "[%0*X]", len - 2, wc);
-
- n_chars += len - 1;
- pango_glyph_string_set_size (glyphs, n_chars);
- for (j=0; j < len; j++)
- {
- set_glyph (font, glyphs, i + j,
- p - text, find_char (face, font, buf[j]));
- }
- i += len - 1;
-#endif
- }
- else
- {
- set_glyph (font, glyphs, i, p - text, index);
-
- if (g_unichar_type (wc) == G_UNICODE_NON_SPACING_MARK)
- {
- if (i > 0)
- {
- PangoRectangle logical_rect, ink_rect;
-
- glyphs->glyphs[i].geometry.width = MAX (glyphs->glyphs[i-1].geometry.width,
- glyphs->glyphs[i].geometry.width);
- glyphs->glyphs[i-1].geometry.width = 0;
- glyphs->log_clusters[i] = glyphs->log_clusters[i-1];
-
- /* Some heuristics to try to guess how overstrike glyphs are
- * done and compensate
- */
- pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph, &ink_rect, &logical_rect);
- if (logical_rect.width == 0 && ink_rect.x == 0)
- glyphs->glyphs[i].geometry.x_offset = (glyphs->glyphs[i].geometry.width - ink_rect.width) / 2;
- }
- }
- }
- }
-
- p = g_utf8_next_char (p);
- }
-
- /* Simple bidi support... may have separate modules later */
-
- if (analysis->level % 2)
- {
- int start, end;
-
- /* Swap all glyphs */
- swap_range (glyphs, 0, n_chars);
-
- /* Now reorder glyphs within each cluster back to LTR */
- for (start=0; start<n_chars;)
- {
- end = start;
- while (end < n_chars &&
- glyphs->log_clusters[end] == glyphs->log_clusters[start])
- end++;
-
- swap_range (glyphs, start, end);
- start = end;
- }
- }
-}
-
-static PangoCoverage *
-basic_engine_get_coverage (PangoFont *font,
- PangoLanguage *lang)
-{
- return pango_font_get_coverage (font, lang);
-}
-
-static PangoEngine *
-basic_engine_xft_new ()
-{
- PangoEngineShape *result;
-
- result = g_new (PangoEngineShape, 1);
-
- result->engine.id = PANGO_RENDER_TYPE_XFT;
- result->engine.type = PANGO_ENGINE_TYPE_SHAPE;
- result->engine.length = sizeof (result);
- result->script_shape = basic_engine_shape;
- result->get_coverage = basic_engine_get_coverage;
-
- return (PangoEngine *)result;
-}
-
-/* The following three functions provide the public module API for
- * Pango. If we are compiling it is a module, then we name the
- * entry points script_engine_list, etc. But if we are compiling
- * it for inclusion directly in Pango, then we need them to
- * to have distinct names for this module, so we prepend
- * _pango_basic_xft_
- */
-#ifdef XFT_MODULE_PREFIX
-#define MODULE_ENTRY(func) _pango_basic_xft_##func
-#else
-#define MODULE_ENTRY(func) func
-#endif
-
-/* List the engines contained within this module
- */
-void
-MODULE_ENTRY(script_engine_list) (PangoEngineInfo **engines, gint *n_engines)
-{
- *engines = script_engines;
- *n_engines = G_N_ELEMENTS (script_engines);
-}
-
-/* Load a particular engine given the ID for the engine
- */
-PangoEngine *
-MODULE_ENTRY(script_engine_load) (const char *id)
-{
- if (!strcmp (id, "BasicScriptEngineXft"))
- return basic_engine_xft_new ();
- else
- return NULL;
-}
-
-void
-MODULE_ENTRY(script_engine_unload) (PangoEngine *engine)
-{
-}
diff --git a/modules/hangul/hangul-fc.c b/modules/hangul/hangul-fc.c
deleted file mode 100644
index be796693..00000000
--- a/modules/hangul/hangul-fc.c
+++ /dev/null
@@ -1,425 +0,0 @@
-/* Pango
- * hangul-xft.c:
- *
- * Copyright (C) 2002 Changwoo Ryu
- * Author: Changwoo Ryu <cwryu@debian.org>
- *
- * 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.
- */
-
-#include <string.h>
-
-#include "pangoxft.h"
-#include "pango-engine.h"
-#include "pango-utils.h"
-
-#include "hangul-defs.h"
-#include "tables-jamos.i"
-
-#define SCRIPT_ENGINE_NAME "HangulScriptEngineXft"
-
-static PangoEngineRange hangul_ranges[] = {
- /* Language characters */
- { 0x1100, 0x11ff, "*" }, /* Hangul Jamo */
- { 0x302e, 0x302f, "*" }, /* Hangul Tone Marks */
- { 0xac00, 0xd7a3, "*" }, /* Hangul Syllables */
-};
-
-static PangoEngineInfo script_engines[] = {
- {
- SCRIPT_ENGINE_NAME,
- PANGO_ENGINE_TYPE_SHAPE,
- PANGO_RENDER_TYPE_XFT,
- hangul_ranges, G_N_ELEMENTS(hangul_ranges)
- }
-};
-
-static void
-set_glyph (PangoFont *font, PangoGlyphString *glyphs, int i, int offset, PangoGlyph glyph)
-{
- PangoRectangle logical_rect;
-
- glyphs->glyphs[i].glyph = glyph;
- glyphs->glyphs[i].geometry.x_offset = 0;
- glyphs->glyphs[i].geometry.y_offset = 0;
- glyphs->log_clusters[i] = offset;
-
- pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph, NULL, &logical_rect);
- glyphs->glyphs[i].geometry.width = logical_rect.width;
-}
-
-/* Add a Hangul tone mark glyph in a glyph string.
- * Non-spacing glyph works pretty much automatically.
- * Spacing-glyph takes some care:
- * 1. Make a room for a tone mark at the beginning(leftmost end) of a cluster
- * to attach it to.
- * 2. Adjust x_offset so that it is drawn to the left of a cluster.
- * 3. Set the logical width to zero.
- */
-
-static void
-set_glyph_tone (PangoFont *font, PangoGlyphString *glyphs, int i,
- int offset, PangoGlyph glyph)
-{
- PangoRectangle logical_rect, ink_rect;
- PangoRectangle logical_rect_cluster;
-
- glyphs->glyphs[i].glyph = glyph;
- glyphs->glyphs[i].geometry.y_offset = 0;
- glyphs->log_clusters[i] = offset;
-
- pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph,
- &ink_rect, &logical_rect);
-
- /* tone mark is not the first in a glyph string. We have info. on the
- * preceding glyphs in a glyph string
- */
- {
- int j = i - 1;
- /* search for the beg. of the preceding cluster */
- while (j >= 0 && glyphs->log_clusters[j] == glyphs->log_clusters[i - 1])
- j--;
-
- /* In .._extents_range(...,start,end,...), to my surprise start is
- * inclusive but end is exclusive !!
- */
- pango_glyph_string_extents_range (glyphs, j + 1, i, font,
- NULL, &logical_rect_cluster);
-
- /* logical_rect_cluster.width is all the offset we need so that the
- * inherent x_offset in the glyph (ink_rect.x) should be canceled out.
- */
- glyphs->glyphs[i].geometry.x_offset = - logical_rect_cluster.width
- - ink_rect.x ;
-
-
- /* make an additional room for a tone mark if it has a spacing glyph
- * because that's likely to be an indication that glyphs for other
- * characters in the font are not designed for combining with tone marks.
- */
- if (logical_rect.width)
- {
- glyphs->glyphs[i].geometry.x_offset -= ink_rect.width;
- glyphs->glyphs[j + 1].geometry.width += ink_rect.width;
- glyphs->glyphs[j + 1].geometry.x_offset += ink_rect.width;
- }
- }
-
- glyphs->glyphs[i].geometry.width = 0;
-}
-
-
-#define find_char pango_xft_font_get_glyph
-
-
-static void
-render_tone (PangoFont *font, gunichar tone, PangoGlyphString *glyphs,
- int *n_glyphs, int cluster_offset)
-{
- int index;
-
- index = find_char (font, tone);
- pango_glyph_string_set_size (glyphs, *n_glyphs + 1);
- if (index)
- {
- set_glyph_tone (font, glyphs, *n_glyphs, cluster_offset, index);
- }
- else
- {
- /* fall back : HTONE1(0x302e) => middle-dot, HTONE2(0x302f) => colon */
- index = find_char (font, tone == HTONE1 ? 0x00b7 : 0x003a);
- if (index)
- {
- set_glyph_tone (font, glyphs, *n_glyphs, cluster_offset, index);
- }
- else
- set_glyph (font, glyphs, *n_glyphs, cluster_offset,
- pango_xft_font_get_unknown_glyph (font, tone));
- }
- (*n_glyphs)++;
-}
-
-/* This is a fallback for when we get a tone mark not preceded
- * by a syllable.
- */
-static void
-render_isolated_tone (PangoFont *font, gunichar tone, PangoGlyphString *glyphs,
- int *n_glyphs, int cluster_offset)
-{
- /* Find a base character to render the mark on
- */
- int index = find_char (font, 0x25cc); /* DOTTED CIRCLE */
- if (!index)
- index = find_char (font, 0x25cb); /* WHITE CIRCLE, in KSC-5601 */
- if (!index)
- index = find_char (font, ' '); /* Space */
- if (!index) /* Unknown glyph box with 0000 in it */
- index = find_char (font, pango_xft_font_get_unknown_glyph (font, 0));
-
- /* Add the base character
- */
- pango_glyph_string_set_size (glyphs, *n_glyphs + 1);
- set_glyph (font, glyphs, *n_glyphs, cluster_offset, index);
- (*n_glyphs)++;
-
- /* And the tone mrak
- */
- render_tone(font, tone, glyphs, n_glyphs, cluster_offset);
-}
-
-static void
-render_syllable (PangoFont *font, gunichar *text, int length,
- PangoGlyphString *glyphs, int *n_glyphs, int cluster_offset)
-{
- int n_prev_glyphs = *n_glyphs;
- int index;
- gunichar wc, tone;
- int i, j, composed;
-
- if (IS_M (text[length - 1]))
- {
- tone = text[length - 1];
- length--;
- }
- else
- tone = 0;
-
- if (length >= 3 && IS_L_S(text[0]) && IS_V_S(text[1]) && IS_T_S(text[2]))
- composed = 3;
- else if (length >= 2 && IS_L_S(text[0]) && IS_V_S(text[1]))
- composed = 2;
- else
- composed = 0;
-
- if (composed)
- {
- if (composed == 3)
- wc = S_FROM_LVT(text[0], text[1], text[2]);
- else
- wc = S_FROM_LV(text[0], text[1]);
- index = find_char (font, wc);
- pango_glyph_string_set_size (glyphs, *n_glyphs + 1);
- if (!index)
- set_glyph (font, glyphs, *n_glyphs, cluster_offset,
- pango_xft_font_get_unknown_glyph (font, wc));
- else
- set_glyph (font, glyphs, *n_glyphs, cluster_offset, index);
- (*n_glyphs)++;
- text += composed;
- length -= composed;
- }
-
- /* Render the remaining text as uncomposed forms as a fallback. */
- for (i = 0; i < length; i++)
- {
- int jindex;
-
- if (text[i] == LFILL || text[i] == VFILL)
- continue;
-
- index = find_char (font, text[i]);
- if (index)
- {
- pango_glyph_string_set_size (glyphs, *n_glyphs + 1);
- set_glyph (font, glyphs, *n_glyphs, cluster_offset, index);
- (*n_glyphs)++;
- continue;
- }
-
- /* This font has no glyphs on the Hangul Jamo area! Find a
- fallback from the Hangul Compatibility Jamo area. */
- jindex = text[i] - LBASE;
- for (j = 0; j < 3 && (__jamo_to_ksc5601[jindex][j] != 0); j++)
- {
- wc = __jamo_to_ksc5601[jindex][j] - KSC_JAMOBASE + UNI_JAMOBASE;
- index = (wc >= 0x3131) ? find_char (font, wc) : 0;
- pango_glyph_string_set_size (glyphs, *n_glyphs + 1);
- if (!index)
- set_glyph (font, glyphs, *n_glyphs, cluster_offset,
- pango_xft_font_get_unknown_glyph (font, index));
- else
- set_glyph (font, glyphs, *n_glyphs, cluster_offset, index);
- (*n_glyphs)++;
- }
- }
- if (n_prev_glyphs == *n_glyphs)
- {
- index = find_char (font, 0x3164);
- pango_glyph_string_set_size (glyphs, *n_glyphs + 1);
- if (!index)
- set_glyph (font, glyphs, *n_glyphs, cluster_offset,
- pango_xft_font_get_unknown_glyph (font, index));
- else
- set_glyph (font, glyphs, *n_glyphs, cluster_offset, index);
- glyphs->log_clusters[*n_glyphs] = cluster_offset;
- (*n_glyphs)++;
- }
- if (tone)
- render_tone(font, tone, glyphs, n_glyphs, cluster_offset);
-}
-
-static void
-hangul_engine_shape (PangoFont *font,
- const char *text,
- gint length,
- PangoAnalysis *analysis,
- PangoGlyphString *glyphs)
-{
- int n_chars, n_glyphs;
- int i;
- const char *p, *start;
-
- gunichar jamos_static[8];
- guint max_jamos = G_N_ELEMENTS (jamos_static);
- gunichar *jamos = jamos_static;
- int n_jamos;
-
- n_chars = g_utf8_strlen (text, length);
- n_glyphs = 0;
- start = p = text;
- n_jamos = 0;
-
- for (i = 0; i < n_chars; i++)
- {
- gunichar prev = jamos[n_jamos - 1];
- gunichar wc;
-
- wc = g_utf8_get_char (p);
-
- /* Check syllable boundaries. */
- if (n_jamos &&
- ((!IS_L (prev) && IS_S (wc)) ||
- (IS_T (prev) && IS_L (wc)) ||
- (IS_V (prev) && IS_L (wc)) ||
- (IS_T (prev) && IS_V (wc)) ||
- IS_M(prev)))
- {
- /* Draw a syllable. */
- render_syllable (font, jamos, n_jamos, glyphs,
- &n_glyphs, start - text);
- n_jamos = 0;
- start = p;
- }
-
- if (n_jamos == max_jamos)
- {
- max_jamos += 3; /* at most 3 for each syllable code (L+V+T) */
- if (jamos == jamos_static)
- {
- jamos = g_new (gunichar, max_jamos);
- memcpy (jamos, jamos_static, n_jamos*sizeof(gunichar));
- }
- else
- jamos = g_renew (gunichar, jamos, max_jamos);
- }
-
- if (IS_S (wc))
- {
- jamos[n_jamos++] = L_FROM_S (wc);
- jamos[n_jamos++] = V_FROM_S (wc);
- if (S_HAS_T (wc))
- jamos[n_jamos++] = T_FROM_S (wc);
- }
- else if (IS_M (wc) && !n_jamos)
- {
- /* Tone mark not following syllable */
- render_isolated_tone (font, wc, glyphs, &n_glyphs, start - text);
- start = g_utf8_next_char (p);
- }
- else
- jamos[n_jamos++] = wc;
- p = g_utf8_next_char (p);
- }
-
- if (n_jamos != 0)
- render_syllable (font, jamos, n_jamos, glyphs, &n_glyphs,
- start - text);
-
- if (jamos != jamos_static)
- g_free(jamos);
-}
-
-static PangoCoverage *
-hangul_engine_get_coverage (PangoFont *font,
- PangoLanguage *lang)
-{
- PangoCoverage *result = pango_coverage_new ();
- int i;
-
- /* Well, no unicode rendering engine could render Hangul Jamo area
- _exactly_, I sure. */
- for (i = 0x1100; i <= 0x11ff; i++)
- pango_coverage_set (result, i, PANGO_COVERAGE_FALLBACK);
- pango_coverage_set (result, 0x302e, PANGO_COVERAGE_FALLBACK);
- pango_coverage_set (result, 0x302f, PANGO_COVERAGE_FALLBACK);
- for (i = 0xac00; i <= 0xd7a3; i++)
- pango_coverage_set (result, i, PANGO_COVERAGE_EXACT);
- return result;
-}
-
-static PangoEngine *
-hangul_engine_xft_new ()
-{
- PangoEngineShape *result;
-
- result = g_new (PangoEngineShape, 1);
-
- result->engine.id = SCRIPT_ENGINE_NAME;
- result->engine.type = PANGO_ENGINE_TYPE_SHAPE;
- result->engine.length = sizeof (result);
- result->script_shape = hangul_engine_shape;
- result->get_coverage = hangul_engine_get_coverage;
-
- return (PangoEngine *)result;
-}
-
-/* The following three functions provide the public module API for
- * Pango. If we are compiling it is a module, then we name the
- * entry points script_engine_list, etc. But if we are compiling
- * it for inclusion directly in Pango, then we need them to
- * to have distinct names for this module, so we prepend
- * _pango_hangul_xft__
- */
-#ifdef XFT_MODULE_PREFIX
-#define MODULE_ENTRY(func) _pango_hangul_xft_##func
-#else
-#define MODULE_ENTRY(func) func
-#endif
-
-/* List the engines contained within this module
- */
-void
-MODULE_ENTRY(script_engine_list) (PangoEngineInfo **engines, gint *n_engines)
-{
- *engines = script_engines;
- *n_engines = G_N_ELEMENTS (script_engines);
-}
-
-/* Load a particular engine given the ID for the engine
- */
-PangoEngine *
-MODULE_ENTRY(script_engine_load) (const char *id)
-{
- if (!strcmp (id, SCRIPT_ENGINE_NAME))
- return hangul_engine_xft_new ();
- else
- return NULL;
-}
-
-void
-MODULE_ENTRY(script_engine_unload) (PangoEngine *engine)
-{
-}
diff --git a/modules/hebrew/hebrew-fc.c b/modules/hebrew/hebrew-fc.c
deleted file mode 100644
index 7615e0b0..00000000
--- a/modules/hebrew/hebrew-fc.c
+++ /dev/null
@@ -1,248 +0,0 @@
-/* Pango
- * hebrew-xft.h:
- *
- * Copyright (C) 2000 Red Hat Software
- * Author: Owen Taylor <otaylor@redhat.com>
- *
- * 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.
- */
-
-#include <string.h>
-
-#include "pangoxft.h"
-#include "pango-engine.h"
-#include "pango-utils.h"
-#include "hebrew-shaper.h"
-
-#define MAX_CLUSTER_CHRS 20
-
-static PangoEngineRange hebrew_ranges[] = {
- /* Language characters */
- { 0x0591, 0x05f4, "*" }, /* Hebrew */
- { 0xfb1d, 0xfb4f, "*" } /* Hebrew presentation forms */
-};
-
-static PangoEngineInfo script_engines[] = {
- {
- "HebrewScriptEngineXft",
- PANGO_ENGINE_TYPE_SHAPE,
- PANGO_RENDER_TYPE_XFT,
- hebrew_ranges, G_N_ELEMENTS(hebrew_ranges)
- }
-};
-
-static void
-get_cluster_glyphs(PangoFont *font,
- gunichar cluster[],
- gint cluster_size,
- /* output */
- gint glyph_num[],
- PangoGlyph glyph[],
- gint widths[],
- PangoRectangle ink_rects[])
-{
- int i;
- for (i=0; i<cluster_size; i++)
- {
- PangoRectangle logical_rect;
- glyph_num[i] = pango_xft_font_get_glyph (font, cluster[i]);
- glyph[i] = glyph_num[i];
-
- pango_font_get_glyph_extents (font,
- glyph[i], &ink_rects[i], &logical_rect);
-
- /* Assign the base char width to the last character in the cluster */
- if (i==0)
- {
- widths[i] = 0;
- widths[cluster_size-1] = logical_rect.width;
- }
- else if (i < cluster_size-1)
- widths[i] = 0;
- }
-}
-
-static void
-add_glyph (PangoGlyphString *glyphs,
- gint cluster_start,
- PangoGlyph glyph,
- gboolean is_combining,
- gint width,
- gint x_offset,
- gint y_offset
- )
-{
- gint index = glyphs->num_glyphs;
-
- pango_glyph_string_set_size (glyphs, index + 1);
-
- glyphs->glyphs[index].glyph = glyph;
- glyphs->glyphs[index].attr.is_cluster_start = is_combining ? 0 : 1;
-
- glyphs->log_clusters[index] = cluster_start;
-
- glyphs->glyphs[index].geometry.x_offset = x_offset;
- glyphs->glyphs[index].geometry.y_offset = y_offset;
- glyphs->glyphs[index].geometry.width = width;
-}
-
-static void
-add_cluster(PangoFont *font,
- PangoGlyphString *glyphs,
- int cluster_size,
- int cluster_start,
- int glyph_num[],
- PangoGlyph glyph[],
- int width[],
- int x_offset[],
- int y_offset[])
-{
- int i;
-
- for (i=0; i<cluster_size; i++)
- {
- add_glyph (glyphs, cluster_start, glyph[i],
- i == 0 ? FALSE : TRUE, width[i], x_offset[i], y_offset[i]);
- }
-}
-
-
-static void
-hebrew_engine_shape (PangoFont *font,
- const char *text,
- gint length,
- PangoAnalysis *analysis,
- PangoGlyphString *glyphs)
-{
- const char *p;
- const char *log_cluster;
- gunichar cluster[MAX_CLUSTER_CHRS];
- gint cluster_size;
- gint glyph_num[MAX_CLUSTER_CHRS];
- gint glyph_width[MAX_CLUSTER_CHRS], x_offset[MAX_CLUSTER_CHRS], y_offset[MAX_CLUSTER_CHRS];
- PangoRectangle ink_rects[MAX_CLUSTER_CHRS];
- PangoGlyph glyph[MAX_CLUSTER_CHRS];
- FT_Face face;
-
- g_return_if_fail (font != NULL);
- g_return_if_fail (text != NULL);
- g_return_if_fail (length >= 0);
- g_return_if_fail (analysis != NULL);
-
- pango_glyph_string_set_size (glyphs, 0);
-
- p = text;
- while (p < text + length)
- {
- log_cluster = p;
- p = hebrew_shaper_get_next_cluster (p, text + length - p,
- /* output */
- cluster, &cluster_size);
- get_cluster_glyphs(font,
- cluster,
- cluster_size,
- /* output */
- glyph_num,
- glyph,
- glyph_width,
- ink_rects);
-
- /* Kern the glyphs! */
- hebrew_shaper_get_cluster_kerning(cluster,
- cluster_size,
- /* Input and output */
- ink_rects,
- glyph_width,
- /* output */
- x_offset,
- y_offset);
-
- add_cluster(font,
- glyphs,
- cluster_size,
- log_cluster - text,
- glyph_num,
- glyph,
- glyph_width,
- x_offset,
- y_offset);
-
- }
-
- if (analysis->level % 2)
- hebrew_shaper_bidi_reorder(glyphs);
-}
-
-static PangoCoverage *
-hebrew_engine_get_coverage (PangoFont *font,
- PangoLanguage *lang)
-{
- return pango_font_get_coverage (font, lang);
-}
-
-static PangoEngine *
-hebrew_engine_xft_new ()
-{
- PangoEngineShape *result;
-
- result = g_new (PangoEngineShape, 1);
-
- result->engine.id = PANGO_RENDER_TYPE_XFT;
- result->engine.type = PANGO_ENGINE_TYPE_SHAPE;
- result->engine.length = sizeof (result);
- result->script_shape = hebrew_engine_shape;
- result->get_coverage = hebrew_engine_get_coverage;
-
- return (PangoEngine *)result;
-}
-
-/* The following three functions provide the public module API for
- * Pango. If we are compiling it is a module, then we name the
- * entry points script_engine_list, etc. But if we are compiling
- * it for inclusion directly in Pango, then we need them to
- * to have distinct names for this module, so we prepend
- * _pango_hebrew_xft_
- */
-#ifdef XFT_MODULE_PREFIX
-#define MODULE_ENTRY(func) _pango_hebrew_xft_##func
-#else
-#define MODULE_ENTRY(func) func
-#endif
-
-/* List the engines contained within this module
- */
-void
-MODULE_ENTRY(script_engine_list) (PangoEngineInfo **engines, gint *n_engines)
-{
- *engines = script_engines;
- *n_engines = G_N_ELEMENTS (script_engines);
-}
-
-/* Load a particular engine given the ID for the engine
- */
-PangoEngine *
-MODULE_ENTRY(script_engine_load) (const char *id)
-{
- if (!strcmp (id, "HebrewScriptEngineXft"))
- return hebrew_engine_xft_new ();
- else
- return NULL;
-}
-
-void
-MODULE_ENTRY(script_engine_unload) (PangoEngine *engine)
-{
-}
diff --git a/modules/indic/indic-fc.c b/modules/indic/indic-fc.c
deleted file mode 100644
index 390b2871..00000000
--- a/modules/indic/indic-fc.c
+++ /dev/null
@@ -1,446 +0,0 @@
-/* Pango
- * indic-xft.c:
- *
- * Copyright (C) 2001, 2002 IBM Corporation
- * Author: Eric Mader <mader@jtcsv.com>
- * Based on arabic-xft.c by Owen Taylor <otaylor@redhat.com>
- *
- * 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.
- */
-
-#include <string.h>
-
-#include "indic-ot.h"
-
-#include "pangoxft.h"
-#include "pango-engine.h"
-#include "pango-utils.h"
-
-typedef struct _PangoEngineShapeIndic PangoEngineShapeIndic;
-typedef struct _PangoIndicInfo PangoIndicInfo;
-
-struct _PangoEngineShapeIndic
-{
- PangoEngineShape shapeEngine;
- PangoIndicInfo *indicInfo;
-};
-
-struct _PangoIndicInfo
-{
- PangoOTTag scriptTag;
- IndicOTClassTable *classTable;
- gchar *gsubQuarkName;
- gchar *gposQuarkName;
-};
-
-#define INDIC_ENGINE_INFO(script) {#script "ScriptEngineXft", PANGO_ENGINE_TYPE_SHAPE, PANGO_RENDER_TYPE_XFT, script##_ranges, G_N_ELEMENTS(script##_ranges)}
-
-#define PANGO_INDIC_INFO(script) {OT_TAG_##script, &script##_class_table, "pango-indic-" #script "-GSUB-ruleset", "pango-indic-" #script "-GPOS-rulsest"}
-
-#define INDIC_SCRIPT_RANGE(script) {SCRIPT_RANGE_##script, "*"}
-
-#define OT_TAG_deva FT_MAKE_TAG('d','e','v','a')
-#define OT_TAG_beng FT_MAKE_TAG('b','e','n','g')
-#define OT_TAG_guru FT_MAKE_TAG('g','u','r','u')
-#define OT_TAG_gujr FT_MAKE_TAG('g','u','j','r')
-#define OT_TAG_orya FT_MAKE_TAG('o','r','y','a')
-#define OT_TAG_taml FT_MAKE_TAG('t','a','m','l')
-#define OT_TAG_telu FT_MAKE_TAG('t','e','l','u')
-#define OT_TAG_knda FT_MAKE_TAG('k','n','d','a')
-#define OT_TAG_mlym FT_MAKE_TAG('m','l','y','m')
-
-static PangoEngineRange deva_ranges[] = {
- INDIC_SCRIPT_RANGE(deva), /* Devanagari */
-};
-
-static PangoEngineRange beng_ranges[] = {
- INDIC_SCRIPT_RANGE(beng), /* Bengali */
-};
-
-static PangoEngineRange guru_ranges[] = {
- INDIC_SCRIPT_RANGE(guru), /* Gurmukhi */
-};
-
-static PangoEngineRange gujr_ranges[] = {
- INDIC_SCRIPT_RANGE(gujr), /* Gujarati */
-};
-
-static PangoEngineRange orya_ranges[] = {
- INDIC_SCRIPT_RANGE(orya), /* Oriya */
-};
-
-static PangoEngineRange taml_ranges[] = {
- INDIC_SCRIPT_RANGE(taml), /* Tamil */
-};
-
-static PangoEngineRange telu_ranges[] = {
- INDIC_SCRIPT_RANGE(telu), /* Telugu */
-};
-
-static PangoEngineRange knda_ranges[] = {
- INDIC_SCRIPT_RANGE(knda), /* Kannada */
-};
-
-static PangoEngineRange mlym_ranges[] = {
- INDIC_SCRIPT_RANGE(mlym), /* Malayalam */
-};
-
-static PangoEngineInfo script_engines[] = {
- INDIC_ENGINE_INFO(deva), INDIC_ENGINE_INFO(beng), INDIC_ENGINE_INFO(guru),
- INDIC_ENGINE_INFO(gujr), INDIC_ENGINE_INFO(orya), INDIC_ENGINE_INFO(taml),
- INDIC_ENGINE_INFO(telu), INDIC_ENGINE_INFO(knda), INDIC_ENGINE_INFO(mlym)
-};
-
-/*
- * WARNING: These entries need to be in the same order as the entries
- * in script_engines[].
- *
- * FIXME: remove this requirement, either by encapsulating the order
- * in a macro that calls a body macro that can be redefined, or by
- * putting the pointers to the PangoEngineInfo in PangoIndicInfo...
- */
-static PangoIndicInfo indic_info[] = {
- PANGO_INDIC_INFO(deva), PANGO_INDIC_INFO(beng), PANGO_INDIC_INFO(guru),
- PANGO_INDIC_INFO(gujr), PANGO_INDIC_INFO(orya), PANGO_INDIC_INFO(taml),
- PANGO_INDIC_INFO(telu), PANGO_INDIC_INFO(knda), PANGO_INDIC_INFO(mlym)
-};
-
-static void
-maybe_add_GSUB_feature (PangoOTRuleset *ruleset,
- PangoOTInfo *info,
- guint script_index,
- PangoOTTag feature_tag,
- gulong property_bit)
-{
- guint feature_index;
-
- /* 0xffff == default language system */
- if (pango_ot_info_find_feature (info, PANGO_OT_TABLE_GSUB,
- feature_tag, script_index, 0xffff, &feature_index))
- {
- /*
- printf("Added GSUB feature '%c%c%c%c' = %8.8X\n", feature_tag>>24, feature_tag>>16&0xFF, feature_tag>>8&0xFF, feature_tag&0xFF, property_bit);
- */
-
- pango_ot_ruleset_add_feature (ruleset, PANGO_OT_TABLE_GSUB, feature_index,
- property_bit);
- }
-}
-
-static void
-maybe_add_GPOS_feature (PangoOTRuleset *ruleset,
- PangoOTInfo *info,
- guint script_index,
- PangoOTTag feature_tag,
- gulong property_bit)
-{
- guint feature_index;
-
- if (pango_ot_info_find_feature (info, PANGO_OT_TABLE_GPOS,
- feature_tag,script_index, 0xffff, &feature_index))
- {
- /*
- printf("Added GPOS feature '%c%c%c%c' = %8.8X\n", feature_tag>>24, feature_tag>>16&0xFF, feature_tag>>8&0xFF, feature_tag&0xFF, property_bit);
- */
-
- pango_ot_ruleset_add_feature (ruleset, PANGO_OT_TABLE_GPOS, feature_index,
- property_bit);
- }
-}
-
-static PangoOTRuleset *
-get_gsub_ruleset (FT_Face face, PangoIndicInfo *indic_info)
-{
- PangoOTInfo *info = pango_ot_info_get (face);
- GQuark ruleset_quark = g_quark_from_string (indic_info->gsubQuarkName);
- PangoOTRuleset *ruleset;
-
- if (!info)
- return NULL;
-
- ruleset = g_object_get_qdata (G_OBJECT (info), ruleset_quark);
-
- if (!ruleset)
- {
- guint script_index;
-
- ruleset = pango_ot_ruleset_new (info);
-
- if (pango_ot_info_find_script (info, PANGO_OT_TABLE_GSUB,
- indic_info->scriptTag, &script_index))
- {
- maybe_add_GSUB_feature (ruleset, info, script_index, FT_MAKE_TAG ('n','u','k','t'), nukt);
- maybe_add_GSUB_feature (ruleset, info, script_index, FT_MAKE_TAG ('a','k','h','n'), akhn);
- maybe_add_GSUB_feature (ruleset, info, script_index, FT_MAKE_TAG ('r','p','h','f'), rphf);
- maybe_add_GSUB_feature (ruleset, info, script_index, FT_MAKE_TAG ('b','l','w','f'), blwf);
- maybe_add_GSUB_feature (ruleset, info, script_index, FT_MAKE_TAG ('h','a','l','f'), half);
- maybe_add_GSUB_feature (ruleset, info, script_index, FT_MAKE_TAG ('p','s','t','f'), pstf);
- maybe_add_GSUB_feature (ruleset, info, script_index, FT_MAKE_TAG ('v','a','t','u'), vatu);
- maybe_add_GSUB_feature (ruleset, info, script_index, FT_MAKE_TAG ('p','r','e','s'), pres);
- maybe_add_GSUB_feature (ruleset, info, script_index, FT_MAKE_TAG ('b','l','w','s'), blws);
- maybe_add_GSUB_feature (ruleset, info, script_index, FT_MAKE_TAG ('a','b','v','s'), abvs);
- maybe_add_GSUB_feature (ruleset, info, script_index, FT_MAKE_TAG ('p','s','t','s'), psts);
- maybe_add_GSUB_feature (ruleset, info, script_index, FT_MAKE_TAG ('h','a','l','n'), haln);
- }
-
- g_object_set_qdata_full (G_OBJECT (info), ruleset_quark, ruleset,
- (GDestroyNotify)g_object_unref);
- }
-
- return ruleset;
-}
-
-
-static PangoOTRuleset *
-get_gpos_ruleset (FT_Face face, PangoIndicInfo *indic_info)
-{
- PangoOTInfo *info = pango_ot_info_get (face);
- GQuark ruleset_quark = g_quark_from_string (indic_info->gposQuarkName);
- PangoOTRuleset *ruleset;
-
- if (!info)
- return NULL;
-
- ruleset = g_object_get_qdata (G_OBJECT (info), ruleset_quark);
-
- if (!ruleset)
- {
- guint script_index;
-
- ruleset = pango_ot_ruleset_new (info);
-
- if (1 && pango_ot_info_find_script (info, PANGO_OT_TABLE_GPOS,
- indic_info->scriptTag, &script_index))
- {
- maybe_add_GPOS_feature (ruleset, info, script_index, FT_MAKE_TAG ('b','l','w','m'), blwm);
- maybe_add_GPOS_feature (ruleset, info, script_index, FT_MAKE_TAG ('a','b','v','m'), abvm);
- maybe_add_GPOS_feature (ruleset, info, script_index, FT_MAKE_TAG ('d','i','s','t'), dist);
- }
-
- g_object_set_qdata_full (G_OBJECT (info), ruleset_quark, ruleset,
- (GDestroyNotify)g_object_unref);
- }
-
- return ruleset;
-}
-static void
-set_glyphs (PangoFont *font, FT_Face face, const gunichar *wcs, const glong *indices, glong n_glyphs, PangoGlyphString *glyphs)
-{
- gint i;
-
- g_assert (face);
-
- pango_glyph_string_set_size (glyphs, n_glyphs);
-
- for (i = 0; i < n_glyphs; i += 1)
- {
- PangoGlyph glyph = FT_Get_Char_Index (face, wcs[i]);
-
- glyphs->glyphs[i].glyph = glyph;
- glyphs->log_clusters[i] = indices[i];
- }
-}
-
-/*
- * FIXME: should this check for null pointers, etc.?
- */
-static gunichar *
-expand_text(const gchar *text, glong length, glong **offsets, glong *n_chars)
-{
- const gchar *p;
- gunichar *wcs, *wco;
- glong i, *oo;
-
- *n_chars = g_utf8_strlen (text, length);
- wcs = g_new (gunichar, *n_chars);
- *offsets = g_new (glong, *n_chars + 1);
-
- p = text;
- wco = wcs;
- oo = *offsets;
- for (i = 0; i < *n_chars; i += 1)
- {
- *wco++ = g_utf8_get_char (p);
- *oo++ = p - text;
-
- p = g_utf8_next_char (p);
- }
-
- *oo = p - text;
-
- return wcs;
-}
-
-
-/* analysis->shape_engine has the PangoEngine... */
-static void
-indic_engine_shape (PangoFont *font,
- const char *text,
- gint length,
- PangoAnalysis *analysis,
- PangoGlyphString *glyphs)
-{
- glong i, n_chars, n_glyphs;
- gulong *tags = NULL;
- gunichar *wc_in = NULL, *wc_out = NULL;
- glong *utf8_offsets = NULL;
- glong *indices = NULL;
- FT_Face face;
- PangoOTRuleset *gsub_ruleset = NULL, *gpos_ruleset = NULL;
- PangoEngineShapeIndic *indic_shape_engine = NULL;
- PangoIndicInfo *indic_info = NULL;
-
- g_return_if_fail (font != NULL);
- g_return_if_fail (text != NULL);
- g_return_if_fail (length >= 0);
- g_return_if_fail (analysis != NULL);
-
- face = pango_xft_font_lock_face (font);
- g_assert (face != NULL);
-
- indic_shape_engine = (PangoEngineShapeIndic *) analysis->shape_engine;
-
-#if 1
- g_assert (indic_shape_engine->shapeEngine.engine.length == sizeof (PangoEngineShapeIndic));
-#endif
-
- indic_info = indic_shape_engine->indicInfo;
-
- wc_in = expand_text (text, length, &utf8_offsets, &n_chars);
- n_glyphs = indic_ot_reorder (wc_in, utf8_offsets, n_chars, indic_info->classTable, NULL, NULL, NULL);
-
- wc_out = g_new (gunichar, n_glyphs);
- indices = g_new (glong, n_glyphs);
- tags = g_new (gulong, n_glyphs);
-
- n_glyphs = indic_ot_reorder (wc_in, utf8_offsets, n_chars, indic_info->classTable, wc_out, indices, tags);
-
- pango_glyph_string_set_size (glyphs, n_glyphs);
- set_glyphs(font, face, wc_out, indices, n_glyphs, glyphs);
-
- /* do gsub processing */
- gsub_ruleset = get_gsub_ruleset (face, indic_info);
- if (gsub_ruleset != NULL)
- {
- pango_ot_ruleset_shape (gsub_ruleset, glyphs, tags);
- }
-
- /* apply default positioning */
- for (i = 0; i < glyphs->num_glyphs; i += 1)
- {
- if (glyphs->glyphs[i].glyph != 0)
- {
- PangoRectangle logical_rect;
-
- pango_font_get_glyph_extents (font, glyphs->glyphs[i].glyph, NULL, &logical_rect);
- glyphs->glyphs[i].geometry.width = logical_rect.width;
- }
- else
- {
- glyphs->glyphs[i].geometry.width = 0;
- }
-
- glyphs->glyphs[i].geometry.x_offset = 0;
- glyphs->glyphs[i].geometry.y_offset = 0;
- }
-
-#if 1
- /* do gpos processing */
- gpos_ruleset = get_gpos_ruleset (face, indic_info);
- if (gpos_ruleset != NULL)
- {
- pango_ot_ruleset_shape (gpos_ruleset, glyphs, tags);
- }
-#endif
-
- pango_xft_font_unlock_face (font);
-
- g_free (tags);
- g_free (indices);
- g_free (wc_out);
- g_free (wc_in);
- g_free (utf8_offsets);
-}
-
-static PangoCoverage *
-indic_engine_get_coverage (PangoFont *font,
- PangoLanguage *lang)
-{
- return pango_font_get_coverage (font, lang);
-}
-
-static PangoEngine *
-indic_engine_xft_new (gint index)
-{
- PangoEngineShapeIndic *result;
-
- result = g_new (PangoEngineShapeIndic, 1);
-
- result->shapeEngine.engine.id = script_engines[index].id;
- result->shapeEngine.engine.type = PANGO_ENGINE_TYPE_SHAPE;
- result->shapeEngine.engine.length = sizeof (*result);
- result->shapeEngine.script_shape = indic_engine_shape;
- result->shapeEngine.get_coverage = indic_engine_get_coverage;
-
- result->indicInfo = &indic_info[index];
-
- return (PangoEngine *)result;
-}
-
-/* The following three functions provide the public module API for
- * Pango. If we are compiling it as a module, then we name the
- * entry points script_engine_list, etc. But if we are compiling
- * it for inclusion directly in Pango, then we need them to
- * to have distinct names for this module, so we prepend
- * _pango_indic_xft_
- */
-#ifdef XFT_MODULE_PREFIX
-#define MODULE_ENTRY(func) _pango_indic_xft_##func
-#else
-#define MODULE_ENTRY(func) func
-#endif
-
-/* List the engines contained within this module
- */
-void
-MODULE_ENTRY(script_engine_list) (PangoEngineInfo **engines, gint *n_engines)
-{
- *engines = script_engines;
- *n_engines = G_N_ELEMENTS (script_engines);
-}
-
-/* Load a particular engine given the ID for the engine
- */
-PangoEngine *
-MODULE_ENTRY(script_engine_load) (const char *id)
-{
- gint i;
-
- for (i = 0; i < G_N_ELEMENTS(script_engines); i += 1)
- {
- if (!strcmp(id, script_engines[i].id))
- {
- return indic_engine_xft_new(i);
- }
- }
-
- return NULL;
-}
-
-void
-MODULE_ENTRY(script_engine_unload) (PangoEngine *engine)
-{
-}
diff --git a/modules/thai/thai-fc.c b/modules/thai/thai-fc.c
deleted file mode 100644
index a6ec0c15..00000000
--- a/modules/thai/thai-fc.c
+++ /dev/null
@@ -1,251 +0,0 @@
-/* Pango
- * thai-xft.c:
- *
- * Copyright (C) 1999 Red Hat Software
- * Author: Owen Taylor <otaylor@redhat.com>
- *
- * Copyright (C) 2002 NECTEC
- * Author: Theppitak Karoonboonyanan <thep@links.nectec.or.th>
- *
- * Copyright (c) 1996-2000 by Sun Microsystems, Inc.
- * Author: Chookij Vanatham <Chookij.Vanatham@Eng.Sun.COM>
- *
- * 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.
- */
-
-
-#include <string.h>
-
-#include <glib.h>
-#include "pango-engine.h"
-#include "pangoxft.h"
-#include "thai-shaper.h"
-
-#define SCRIPT_ENGINE_NAME "ThaiScriptEngineXft"
-
-/* We handle the range U+0e01 to U+0e5b exactly
- */
-static PangoEngineRange thai_ranges[] = {
- { 0x0e01, 0x0e5b, "*" }, /* Thai */
-};
-
-static PangoEngineInfo script_engines[] = {
- {
- SCRIPT_ENGINE_NAME,
- PANGO_ENGINE_TYPE_SHAPE,
- PANGO_RENDER_TYPE_XFT,
- thai_ranges, G_N_ELEMENTS(thai_ranges)
- }
-};
-
-/* TIS-to-Unicode glyph maps for characters 0x80-0xff
- */
-static int tis620_0[128] = {
- /**/ 0, 0, 0, 0, 0, 0, 0, 0,
- /**/ 0, 0, 0, 0, 0, 0, 0, 0,
- /**/ 0, 0, 0, 0, 0, 0, 0, 0,
- /**/ 0, 0, 0, 0, 0, 0, 0, 0,
- 0x0020, 0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07,
- 0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f,
- 0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17,
- 0x0e18, 0x0e19, 0x0e1a, 0x0e1b, 0x0e1c, 0x0e1d, 0x0e1e, 0x0e1f,
- 0x0e20, 0x0e21, 0x0e22, 0x0e23, 0x0e24, 0x0e25, 0x0e26, 0x0e27,
- 0x0e28, 0x0e29, 0x0e2a, 0x0e2b, 0x0e2c, 0x0e2d, 0x0e2e, 0x0e2f,
- 0x0e30, 0x0e31, 0x0e32, 0x0e33, 0x0e34, 0x0e35, 0x0e36, 0x0e37,
- 0x0e38, 0x0e39, 0x0e3a, 0, 0, 0, 0, 0x0e3f,
- 0x0e40, 0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47,
- 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0x0e4e, 0x0e4f,
- 0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57,
- 0x0e58, 0x0e59, 0x0e5a, 0x0e5b, 0, 0, 0, 0
-};
-
-static int tis620_1[128] = {
- 0x00ab, 0x00bb, 0x2026, 0xf88c, 0xf88f, 0xf892, 0xf895, 0xf898,
- 0xf88b, 0xf88e, 0xf891, 0xf894, 0xf897, 0x201c, 0x201d, 0xf899,
- /**/ 0, 0x2022, 0xf884, 0xf889, 0xf885, 0xf886, 0xf887, 0xf888,
- 0xf88a, 0xf88d, 0xf890, 0xf893, 0xf896, 0x2018, 0x2019, 0,
- 0x00a0, 0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07,
- 0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f,
- 0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17,
- 0x0e18, 0x0e19, 0x0e1a, 0x0e1b, 0x0e1c, 0x0e1d, 0x0e1e, 0x0e1f,
- 0x0e20, 0x0e21, 0x0e22, 0x0e23, 0x0e24, 0x0e25, 0x0e26, 0x0e27,
- 0x0e28, 0x0e29, 0x0e2a, 0x0e2b, 0x0e2c, 0x0e2d, 0x0e2e, 0x0e2f,
- 0x0e30, 0x0e31, 0x0e32, 0x0e33, 0x0e34, 0x0e35, 0x0e36, 0x0e37,
- 0x0e38, 0x0e39, 0x0e3a, 0xfeff, 0x200b, 0x2013, 0x2014, 0x0e3f,
- 0x0e40, 0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47,
- 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0x2122, 0x0e4f,
- 0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57,
- 0x0e58, 0x0e59, 0x00ae, 0x00a9, 0, 0, 0, 0
-};
-
-static int tis620_2[128] = {
- 0xf700, 0xf701, 0xf702, 0xf703, 0xf704, 0x2026, 0xf705, 0xf706,
- 0xf707, 0xf708, 0xf709, 0xf70a, 0xf70b, 0xf70c, 0xf70d, 0xf70e,
- 0xf70f, 0x2018, 0x2019, 0x201c, 0x201d, 0x2022, 0x2013, 0x2014,
- 0xf710, 0xf711, 0xf712, 0xf713, 0xf714, 0xf715, 0xf716, 0xf717,
- 0x00a0, 0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07,
- 0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f,
- 0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17,
- 0x0e18, 0x0e19, 0x0e1a, 0x0e1b, 0x0e1c, 0x0e1d, 0x0e1e, 0x0e1f,
- 0x0e20, 0x0e21, 0x0e22, 0x0e23, 0x0e24, 0x0e25, 0x0e26, 0x0e27,
- 0x0e28, 0x0e29, 0x0e2a, 0x0e2b, 0x0e2c, 0x0e2d, 0x0e2e, 0x0e2f,
- 0x0e30, 0x0e31, 0x0e32, 0x0e33, 0x0e34, 0x0e35, 0x0e36, 0x0e37,
- 0x0e38, 0x0e39, 0x0e3a, 0, 0, 0, 0, 0x0e3f,
- 0x0e40, 0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47,
- 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0x0e4e, 0x0e4f,
- 0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57,
- 0x0e58, 0x0e59, 0x0e5a, 0x0e5b, 0xf718, 0xf719, 0xf71a, 0
-};
-
-static int
-contain_glyphs(PangoFont *font, const int glyph_map[128])
-{
- unsigned char c;
-
- for (c = 0; c < 0x80; c++)
- {
- if (glyph_map[c])
- {
- if (!pango_xft_font_has_char (font, glyph_map[c]))
- return 0;
- }
- }
- return 1;
-}
-
-/* Returns a structure with information we will use to rendering given the
- * #PangoFont. This is computed once per font and cached for later retrieval.
- */
-ThaiFontInfo *
-thai_get_font_info (PangoFont *font)
-{
- ThaiFontInfo *font_info;
- GQuark info_id = g_quark_from_string ("thai-font-info");
-
- font_info = g_object_get_qdata (G_OBJECT (font), info_id);
-
- if (!font_info)
- {
- /* No cached information not found, so we need to compute it
- * from scratch
- */
- font_info = g_new (ThaiFontInfo, 1);
- font_info->font = font;
-
- /* detect font set by determining availibility of glyphs */
- if (contain_glyphs(font, tis620_2))
- font_info->font_set = THAI_FONT_TIS_WIN;
- else if (contain_glyphs(font, tis620_1))
- font_info->font_set = THAI_FONT_TIS_MAC;
- else if (contain_glyphs(font, tis620_0))
- font_info->font_set = THAI_FONT_TIS;
- else
- font_info->font_set = THAI_FONT_ISO10646;
-
- g_object_set_qdata_full (G_OBJECT (font), info_id, font_info, (GDestroyNotify)g_free);
- }
-
- return font_info;
-}
-
-PangoGlyph
-thai_make_glyph (ThaiFontInfo *font_info, unsigned int c)
-{
- int index;
- PangoGlyph result;
-
- switch (font_info->font_set) {
- case THAI_FONT_ISO10646:index = c; break;
- case THAI_FONT_TIS: index = (c & 0x80) ? tis620_0[c & 0x7f] : c; break;
- case THAI_FONT_TIS_MAC: index = (c & 0x80) ? tis620_1[c & 0x7f] : c; break;
- case THAI_FONT_TIS_WIN: index = (c & 0x80) ? tis620_2[c & 0x7f] : c; break;
- default: index = 0; break;
- }
-
- result = pango_xft_font_get_glyph (font_info->font, index);
- if (result)
- return result;
- else
- return pango_xft_font_get_unknown_glyph (font_info->font, index);
-}
-
-PangoGlyph
-thai_make_unknown_glyph (ThaiFontInfo *font_info, unsigned int c)
-{
- return pango_xft_font_get_unknown_glyph (font_info->font, c);
-}
-
-static PangoCoverage *
-thai_engine_get_coverage (PangoFont *font,
- PangoLanguage *lang)
-{
- return pango_font_get_coverage (font, lang);
-}
-
-static PangoEngine *
-thai_engine_xft_new ()
-{
- PangoEngineShape *result;
-
- result = g_new (PangoEngineShape, 1);
-
- result->engine.id = SCRIPT_ENGINE_NAME;
- result->engine.type = PANGO_ENGINE_TYPE_SHAPE;
- result->engine.length = sizeof (result);
- result->script_shape = thai_engine_shape;
- result->get_coverage = thai_engine_get_coverage;
-
- return (PangoEngine *)result;
-}
-
-/* The following three functions provide the public module API for
- * Pango. If we are compiling it is a module, then we name the
- * entry points script_engine_list, etc. But if we are compiling
- * it for inclusion directly in Pango, then we need them to
- * to have distinct names for this module, so we prepend
- * _pango_thai_xft_
- */
-#ifdef XFT_MODULE_PREFIX
-#define MODULE_ENTRY(func) _pango_thai_xft_##func
-#else
-#define MODULE_ENTRY(func) func
-#endif
-
-/* List the engines contained within this module
- */
-void
-MODULE_ENTRY(script_engine_list) (PangoEngineInfo **engines, gint *n_engines)
-{
- *engines = script_engines;
- *n_engines = G_N_ELEMENTS (script_engines);
-}
-
-/* Load a particular engine given the ID for the engine
- */
-PangoEngine *
-MODULE_ENTRY(script_engine_load) (const char *id)
-{
- if (!strcmp (id, SCRIPT_ENGINE_NAME))
- return thai_engine_xft_new ();
- else
- return NULL;
-}
-
-void
-MODULE_ENTRY(script_engine_unload) (PangoEngine *engine)
-{
-}
-