summaryrefslogtreecommitdiff
path: root/modules/basic/basic-ft2.c
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2000-10-03 19:04:34 +0000
committerTor Lillqvist <tml@src.gnome.org>2000-10-03 19:04:34 +0000
commit9b359e9b7c20a134363f2383902519d73d130e68 (patch)
treebdf8e74a67b9d5783bf2b263662d518d557a7f21 /modules/basic/basic-ft2.c
parent6ed8c4f1d4f27507919db74990fa9bdd3681ad7e (diff)
downloadpango-9b359e9b7c20a134363f2383902519d73d130e68.tar.gz
pango/pango.def Add new entry points.
2000-10-03 Tor Lillqvist <tml@iki.fi> * pango/pango.def * pango/pangoft2.def: Add new entry points. * pango/pango-coverage.c (pango_coverage_set): Remove unnecessary loop calling memset() with same parameters 64 times ;-) * pango/makefile.mingw.in (PANGO_OBJS): Add pango-tabs.o. Some small changes that have been laying around on my disk. The Win32 and FT2 backends aren't "production quality" yet. For speedup, need to cache at least the coverage info. * pango/pangoft2.c (pango_ft2_get_coverage): New function. * modules/basic/basic-win32.c: Use "BasicScriptEngineLangWin32" to be unique. * modules/basic/basic-ft2.c: Add comments explaining what Unicode ranges the table entries covers. Use "BasicScriptEngineLangFT2" to be unique. (basic_engine_get_coverage): Test calling pango_ft2_get_coverage(). (basic_engine_ft2_new): Set corect engine type. Not that this apparently is used for anything, the X11 basic shaper module also sets its type as TYPE_LANG. * examples/viewer-ft2.c (split_paragraphs): Just end the string upon encountering an invalid character. Don't return.
Diffstat (limited to 'modules/basic/basic-ft2.c')
-rw-r--r--modules/basic/basic-ft2.c79
1 files changed, 68 insertions, 11 deletions
diff --git a/modules/basic/basic-ft2.c b/modules/basic/basic-ft2.c
index 086ba420..2faa9788 100644
--- a/modules/basic/basic-ft2.c
+++ b/modules/basic/basic-ft2.c
@@ -27,23 +27,79 @@
#include <fribidi/fribidi.h>
static PangoEngineRange basic_ranges[] = {
- /* Language characters */
- { 0x0000, 0x02af, "*" },
+ /* Basic Latin, Latin-1 Supplement, Latin Extended-A, Latin Extended-B,
+ * IPA Extensions
+ */
+ { 0x0000, 0x02af, "*" },
+
+ /* Spacing Modifier Letters */
{ 0x02b0, 0x02ff, "" },
+
+ /* Not covered: Combining Diacritical Marks */
+
+ /* Greek, Cyrillic, Armenian */
{ 0x0380, 0x058f, "*" },
- { 0x0591, 0x05f4, "*" }, /* Hebrew */
- { 0x060c, 0x06f9, "" }, /* Arabic */
- { 0x0e01, 0x0e5b, "" }, /* Thai */
+
+ /* Hebrew */
+ { 0x0591, 0x05f4, "*" },
+
+ /* Arabic */
+ { 0x060c, 0x06f9, "" },
+
+ /* Not covered: Syriac, Thaana, Devanagari, Bengali, Gurmukhi, Gujarati,
+ * Oriya, Tamil, Telugu, Kannada, Malayalam, Sinhala
+ */
+
+ /* Thai */
+ { 0x0e01, 0x0e5b, "" },
+
+ /* Not covered: Lao, Tibetan, Myanmar, Georgian, Hangul Jamo, Ethiopic,
+ * Cherokee, Unified Canadian Aboriginal Syllabics, Ogham, Runic,
+ * Khmer, Mongolian
+ */
+
+ /* Latin Extended Additional, Greek Extended */
{ 0x1e00, 0x1fff, "*" },
+
+ /* General Punctuation, Superscripts and Subscripts, Currency Symbols,
+ * Combining Marks for Symbols, Letterlike Symbols, Number Forms,
+ * Arrows, Mathematical Operators, Miscellaneous Technical,
+ * Control Pictures, Optical Character Recognition, Enclosed Alphanumerics,
+ * Box Drawing, Block Elements, Geometric Shapes, Miscellaneous Symbols,
+ * Dingbats, Braille Patterns, CJK Radicals Supplement, Kangxi Radicals,
+ * Ideographic Description Characters, CJK Symbols and Punctuation,
+ * Hiragana, Katakana, Bopomofo, Hangul Compatibility Jamo, Kanbun,
+ * Bopomofo Extended, Enclosed CJK Letters and Months, CJK Compatibility,
+ * CJK Unified Ideographs Extension A, CJK Unified Ideographs
+ */
{ 0x2000, 0x9fff, "*" },
+
+ /* Not covered: Yi Syllables, Yi Radicals */
+
+ /* Hangul Syllables */
{ 0xac00, 0xd7a3, "kr" },
+
+ /* Not covered: Private Use */
+
+ /* CJK Compatibility Ideographs (partly) */
{ 0xf900, 0xfa0b, "kr" },
+
+ /* Not covered: CJK Compatibility Ideographs (partly),
+ * Alphabetic Presentation Forms, Arabic Presentation Forms-A,
+ * Combining Half Marks, CJK Compatibility Forms,
+ * Small Form Variants, Arabic Presentation Forms-B,
+ * Specials
+ */
+
+ /* Halfwidth and Fullwidth Forms (partly) */
{ 0xff00, 0xffe3, "*" }
+
+ /* Not covered: Halfwidth and Fullwidth Forms, Specials */
};
static PangoEngineInfo script_engines[] = {
{
- "BasicScriptEngineLang",
+ "BasicScriptEngineLangFT2",
PANGO_ENGINE_TYPE_LANG,
PANGO_RENDER_TYPE_NONE,
basic_ranges, G_N_ELEMENTS(basic_ranges)
@@ -261,10 +317,13 @@ basic_engine_get_coverage (PangoFont *font,
PangoCoverage *result = pango_coverage_new ();
gunichar wc;
+#if 0
for (wc = 0; wc < 65536; wc++)
if (find_char (font, wc))
pango_coverage_set (result, wc, PANGO_COVERAGE_EXACT);
-
+#else
+ result = pango_ft2_get_coverage (font, lang);
+#endif
return result;
}
@@ -276,7 +335,7 @@ basic_engine_ft2_new (void)
result = g_new (PangoEngineShape, 1);
result->engine.id = "BasicScriptEngine";
- result->engine.type = PANGO_ENGINE_TYPE_LANG;
+ 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;
@@ -304,8 +363,7 @@ MODULE_ENTRY(script_engine_list) (PangoEngineInfo **engines,
PangoEngine *
MODULE_ENTRY(script_engine_load) (const char *id)
{
- g_print ("basic-ft2: LOAD\n");
- if (!strcmp (id, "BasicScriptEngineLang"))
+ if (!strcmp (id, "BasicScriptEngineLangFT2"))
return basic_engine_lang_new ();
else if (!strcmp (id, "BasicScriptEngineFT2"))
return basic_engine_ft2_new ();
@@ -316,5 +374,4 @@ MODULE_ENTRY(script_engine_load) (const char *id)
void
MODULE_ENTRY(script_engine_unload) (PangoEngine *engine)
{
- g_print ("basic-ft2: UNLOAD\n");
}