summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2000-07-18 06:06:41 +0000
committerTor Lillqvist <tml@src.gnome.org>2000-07-18 06:06:41 +0000
commit5232745f652495ec1ab73fcb7368fe858cc0099c (patch)
tree0ef350a68f35220a40eb6dd61a8c1bd991df7ece /modules
parentca5b24d14066ce35f5b92d117beee0e3605b2f4b (diff)
downloadpango-5232745f652495ec1ab73fcb7368fe858cc0099c.tar.gz
Add the pangowin32 sources.
2000-07-18 Tor Lillqvist <tml@iki.fi> * pango/Makefile.am (EXTRA_DIST): Add the pangowin32 sources. * pango/pangox.c (lang_texts): Add some Latin-1 to the Finnish and Swedish strings. * modules/module.def: New file. * modules/Makefile.am (EXTRA_DIST): Add it. * modules/basic/Makefile.am (EXTRA_DIST): Add basic-win32.c. * */makefile.mingw: Small updates. * pango/pangowin32.c * pango/pangowin32-fontmap.c * modules/basic/basic-win32.c * examples/viewer-win32.c: Bug fixes. Remove dead code. Now the Win32 implementation seems to work, except for a few glitches.
Diffstat (limited to 'modules')
-rw-r--r--modules/Makefile.am3
-rw-r--r--modules/basic/Makefile.am3
-rw-r--r--modules/basic/basic-win32.c66
-rw-r--r--modules/basic/makefile.mingw2
-rw-r--r--modules/module.def4
5 files changed, 14 insertions, 64 deletions
diff --git a/modules/Makefile.am b/modules/Makefile.am
index 0e7737cc..80092322 100644
--- a/modules/Makefile.am
+++ b/modules/Makefile.am
@@ -14,3 +14,6 @@ install-data-local:
$(mkinstalldirs) $(DESTDIR)$(sysconfdir)/pango
$(top_builddir)/pango/pango-querymodules $(DESTDIR)$(libdir)/pango/modules/*.so \
> $(DESTDIR)$(sysconfdir)/pango/pango.modules
+
+EXTRA_DIST = \
+ module.def
diff --git a/modules/basic/Makefile.am b/modules/basic/Makefile.am
index b69b6671..db21f28c 100644
--- a/modules/basic/Makefile.am
+++ b/modules/basic/Makefile.am
@@ -20,4 +20,5 @@ libpango_basic_la_SOURCES = $(sources)
EXTRA_DIST = \
tables-big.i \
- tables-small.i \ No newline at end of file
+ tables-small.i \
+ basic-win32.c
diff --git a/modules/basic/basic-win32.c b/modules/basic/basic-win32.c
index bf669a24..410fa971 100644
--- a/modules/basic/basic-win32.c
+++ b/modules/basic/basic-win32.c
@@ -24,16 +24,6 @@
#include "pangowin32.h"
#include <fribidi/fribidi.h>
-typedef struct _CharCache CharCache;
-
-#define MAX_CHARSETS 32
-
-struct _CharCache
-{
- int n_subfonts;
- PangoWin32Subfont *subfonts;
-};
-
static PangoEngineRange basic_ranges[] = {
/* Language characters */
{ 0x0000, 0x02af, "*" },
@@ -97,27 +87,8 @@ basic_engine_lang_new ()
* Win32 system script engine portion
*/
-static CharCache *
-char_cache_new (void)
-{
- CharCache *result;
- int i;
-
- result = g_new (CharCache, 1);
- result->subfonts = NULL;
-
- return result;
-}
-
-static void
-char_cache_free (CharCache *cache)
-{
- g_free (cache->subfonts);
- g_free (cache);
-}
-
static PangoGlyph
-find_char (CharCache *cache, PangoFont *font, gunichar wc)
+find_char (PangoFont *font, gunichar wc)
{
PangoWin32UnicodeSubrange subrange;
PangoWin32Subfont *subfonts;
@@ -177,22 +148,6 @@ swap_range (PangoGlyphString *glyphs, int start, int end)
}
}
-static CharCache *
-get_char_cache (PangoFont *font)
-{
- GQuark cache_id = g_quark_from_string ("basic-char-cache");
-
- CharCache *cache = g_object_get_qdata (G_OBJECT (font), cache_id);
- if (!cache)
- {
- cache = char_cache_new ();
- g_object_set_qdata_full (G_OBJECT (font), cache_id,
- cache, (GDestroyNotify)char_cache_free);
- }
-
- return cache;
-}
-
static void
basic_engine_shape (PangoFont *font,
const char *text,
@@ -204,15 +159,11 @@ basic_engine_shape (PangoFont *font,
int i;
const char *p;
- CharCache *cache;
-
g_return_if_fail (font != NULL);
g_return_if_fail (text != NULL);
g_return_if_fail (length >= 0);
g_return_if_fail (analysis != NULL);
- cache = get_char_cache (font);
-
n_chars = g_utf8_strlen (text, length);
pango_glyph_string_set_size (glyphs, n_chars);
@@ -222,20 +173,12 @@ basic_engine_shape (PangoFont *font,
gunichar wc;
FriBidiChar mirrored_ch;
PangoGlyph index;
- char buf[6];
- const char *input;
wc = g_utf8_get_char (p);
- input = p;
if (analysis->level % 2)
if (fribidi_get_mirror_char (wc, &mirrored_ch))
- {
- wc = mirrored_ch;
-
- g_unichar_to_utf8 (wc, buf);
- input = buf;
- }
+ wc = mirrored_ch;
if (wc == 0x200B || wc == 0x200E || wc == 0x200F) /* Zero-width characters */
{
@@ -243,7 +186,7 @@ basic_engine_shape (PangoFont *font,
}
else
{
- index = find_char (cache, font, wc);
+ index = find_char (font, wc);
if (index)
{
set_glyph (font, glyphs, i, p - text, index);
@@ -302,12 +245,11 @@ static PangoCoverage *
basic_engine_get_coverage (PangoFont *font,
const char *lang)
{
- CharCache *cache = get_char_cache (font);
PangoCoverage *result = pango_coverage_new ();
gunichar wc;
for (wc = 0; wc < 65536; wc++)
- if (find_char (cache, font, wc))
+ if (find_char (font, wc))
pango_coverage_set (result, wc, PANGO_COVERAGE_EXACT);
return result;
diff --git a/modules/basic/makefile.mingw b/modules/basic/makefile.mingw
index 60377b99..43d48465 100644
--- a/modules/basic/makefile.mingw
+++ b/modules/basic/makefile.mingw
@@ -18,4 +18,4 @@ all : \
cp $< $@
pango-basic-win32.dll : basic-win32.o
- $(GLIB)/build-dll pango-basic-win32 - ../engine.def $< -L ../../pango -lpango-$(PANGO_VER) -lpangowin32-$(PANGO_VER) $(GLIB_LIBS) $(FRIBIDI_LIBS)
+ $(GLIB)/build-dll pango-basic-win32 - ../module.def $< -L ../../pango -lpango-$(PANGO_VER) -lpangowin32-$(PANGO_VER) $(GLIB_LIBS) $(FRIBIDI_LIBS)
diff --git a/modules/module.def b/modules/module.def
new file mode 100644
index 00000000..23572855
--- /dev/null
+++ b/modules/module.def
@@ -0,0 +1,4 @@
+EXPORTS
+ script_engine_list
+ script_engine_load
+ script_engine_unload