[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: gEDA: Unicode support
- To: geda-dev <geda-dev@xxxxxxxx>
- Subject: Re: gEDA: Unicode support
- From: Carlos Nieves Ónega <cnieves@xxxxxxxxxx>
- Date: Mon, 07 Feb 2005 21:43:13 +0100
- Delivered-to: archiver@seul.org
- Delivered-to: geda-dev-outgoing@seul.org
- Delivered-to: geda-dev@seul.org
- Delivery-date: Mon, 07 Feb 2005 15:51:35 -0500
- If-filter0: N
- In-reply-to: <20050124042118.F0CF033C81@moria.seul.org>
- References: <20050124042118.F0CF033C81@moria.seul.org>
- Reply-to: geda-dev@xxxxxxxx
- Sender: owner-geda-dev@xxxxxxxx
El dom, 23-01-2005 a las 23:21 -0500, Ales Hvezda escribió:
[snip]
> I think your suggestions to use a hash table sounds good.
> The key into the table is the unicode character (gunichar). Then we
> would need to populate the hash table with the mapping between unicode
> characters and gschem font definition files (the ones in font/). This
> can be accomplished by a font map file which would be read in and
> parsed by libgeda. Comments?
Attached is a patch implementing:
- Unicode support.
- Hash table with the mapping between characters and font definition
files.
- Character to file mapping loaded at startup using system-gafrc.
Some tests made:
- Load gschem/tests/ext_chars.sch with gschem compiled against GTK1.2
(OK), and GTK2 (OK).
- Convert the above schematic to UTF-8 using iconv (I called it
ext_chars_utf8.sch), and open it using gschem compiled against GTK2
(OK).
- Open ext_chars_utf8.sch using gschem compiled against GTK1.2 (all
characters are displayed as '?' because they are Unicode characters, and
GTK1.2 doesn't support Unicode). Now save the schematic as
"ext_chars_utf8_from_gtk12.sch".
- Open "ext_chars_utf8_from_gtk12.sch" using gschem compiled against
GTK2 . All characters are displayed correctly.
Feel free to try and test it. Comments are welcome!
Regards,
Carlos
P.S.: If someone is testing the attached patch with GTK1.2, beware of
this:
When I was testing this patch with GTK1.2, gschem couldn't compile just
out of the box. The reason is that the function
gtk_radio_menu_item_get_group is used and it doesn't exist in GTK1.2. I
submitted a bug report with a possible patch using the web (commenting
out the "else" contents if using GTK1.2).
Index: gschem/ChangeLog
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/gschem/ChangeLog,v
retrieving revision 1.334
diff -a -u -r1.334 ChangeLog
--- gschem/ChangeLog 24 Jan 2005 04:34:51 -0000 1.334
+++ gschem/ChangeLog 7 Feb 2005 19:56:22 -0000
@@ -1,3 +1,7 @@
+2005-02-07 Carlos Nieves Onega <cnieves@xxxxxxxxxx>
+ * noweb/gschem.nw:
+ Removing call to o_text_init, since it's now called in libgeda_init.
+
2005-01-23 Ales Hvezda <ahvezda@xxxxxxxxxxxxx>
* tests/missing.sch, Makefile.am: Added test schematic to test
Index: gschem/noweb/gschem.nw
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/gschem/noweb/gschem.nw,v
retrieving revision 1.28
diff -a -u -r1.28 gschem.nw
--- gschem/noweb/gschem.nw 16 Jan 2005 17:13:38 -0000 1.28
+++ gschem/noweb/gschem.nw 7 Feb 2005 19:56:24 -0000
@@ -241,8 +241,7 @@
/* so we can call key funcs from guile */
set_window_current_key(w_current);
- /* o_text_init(); goes away */
- o_text_init();
+ /* o_text_init(); Moved inside libgeda_init() */
x_repaint_background(w_current);
Index: libgeda/ChangeLog
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/libgeda/ChangeLog,v
retrieving revision 1.227
diff -a -u -r1.227 ChangeLog
--- libgeda/ChangeLog 24 Jan 2005 04:34:51 -0000 1.227
+++ libgeda/ChangeLog 7 Feb 2005 19:57:00 -0000
@@ -1,3 +1,8 @@
+2005-02-07 Carlos Nieves Onega <cnieves@xxxxxxxxxx>
+ * noweb/g_rc.nw, noweb/g_register.nw, noweb/libgeda.nw,
+ noweb/o_text_basic.nw, include/prototype.h, include/defines.h:
+ Added Unicode support, character to font file mapping by hashtable,
+ and font mapping definition using system-gafrc.
+
2005-01-23 Ales Hvezda <ahvezda@xxxxxxxxxxxxx>
* noweb/o_complex_basic.nw: Fixed a bug where sometimes
Index: libgeda/include/defines.h
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/libgeda/include/defines.h,v
retrieving revision 1.41
diff -a -u -r1.41 defines.h
--- libgeda/include/defines.h 23 Jan 2005 04:12:42 -0000 1.41
+++ libgeda/include/defines.h 7 Feb 2005 19:57:02 -0000
@@ -367,4 +367,14 @@
#define OTHER_PATH_SEPARATER_STRING "\\"
#endif
+/* Since we use Unicode, which isn't supported in GTK 1.2, define
+ the equivalent of the used functions here.
+ GTK 1.2 always deal with chars, instead of multibyte characters
+ as Unicode. */
+#ifdef HAS_GTK12
+typedef unsigned char gunichar;
+#define g_utf8_get_char_validated(string, len) (*((char *)string))
+#define g_utf8_find_next_char(string, len) ((char*)string+1)
+#endif
+
#endif
Index: libgeda/include/prototype.h
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/libgeda/include/prototype.h,v
retrieving revision 1.82
diff -a -u -r1.82 prototype.h
--- libgeda/include/prototype.h 23 Jan 2005 01:43:32 -0000 1.82
+++ libgeda/include/prototype.h 7 Feb 2005 19:57:06 -0000
@@ -41,6 +41,7 @@
SCM g_rc_bitmap_directory(SCM path);
SCM g_rc_scheme_directory(SCM path);
SCM g_rc_bus_ripper_symname(SCM scmsymname);
+SCM g_rc_map_font_character_to_file(SCM character_param, SCM file_param);
/* g_register.c */
void g_register_libgeda_funcs(void);
@@ -357,9 +358,9 @@
void get_text_bounds(TOPLEVEL *w_current, OBJECT *o_current, int *left, int *top, int *right, int *bottom);
void world_get_text_bounds(TOPLEVEL *w_current, OBJECT *o_current, int *left, int *top, int *right, int *bottom);
OBJECT *o_text_add_head(void);
-void o_text_init(void);
+void o_text_init();
void o_text_print_set(void);
-OBJECT *o_text_load_font(TOPLEVEL *w_current, unsigned char needed_char);
+OBJECT *o_text_load_font(TOPLEVEL *w_current, gunichar needed_char);
int o_text_num_lines(char *string);
int o_text_height(char *string, int size);
int o_text_width(TOPLEVEL *w_current, char *string, int size);
Index: libgeda/noweb/g_rc.nw
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/libgeda/noweb/g_rc.nw,v
retrieving revision 1.2
diff -a -u -r1.2 g_rc.nw
--- libgeda/noweb/g_rc.nw 8 Jan 2005 02:15:57 -0000 1.2
+++ libgeda/noweb/g_rc.nw 7 Feb 2005 19:57:12 -0000
@@ -35,7 +35,7 @@
<<g_rc.c : g_rc_reset_component_library()>>
<<g_rc.c : g_rc_reset_source_library()>>
-
+<<g_rc.c : g_rc_map_font_character_to_file()>>
@
@@ -95,6 +95,8 @@
#include "../include/papersizes.h"
#include "../include/prototype.h"
+extern GHashTable *font_char_to_file;
+
@
@section Function @code{g_rc_parse_general()}
@@ -1133,6 +1135,39 @@
@ %def g_rc_reset_source_library
+@section Function @code{g_rc_map_font_character_to_file()}
+
+@defun g_rc_map_font_character_to_file
+@end defun
+
+<<g_rc.c : g_rc_map_font_character_to_file()>>=
+SCM
+g_rc_map_font_character_to_file(SCM character_param, SCM file_param)
+{
+ gchar *file = gh_scm2newstr(file_param, NULL);
+ gchar *character = gh_scm2newstr(character_param, NULL);
+
+ if ( (file == NULL) || (character == NULL) ) {
+ fprintf(stderr,
+ "%s requires two strings as parameters\n",
+ "map-font-character-to-file"
+ );
+ return SCM_BOOL_F;
+ }
+
+ /* take care of any shell variables */
+ file = expand_env_variables(file);
+
+ /* Insert the new entry */
+ g_hash_table_insert (font_char_to_file, g_strdup(character),
+ g_strdup(file));
+
+ return SCM_BOOL_T;
+}
+
+
+@ %def g_rc_map_font_character_to_file
+
Index: libgeda/noweb/g_register.nw
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/libgeda/noweb/g_register.nw,v
retrieving revision 1.1
diff -a -u -r1.1 g_register.nw
--- libgeda/noweb/g_register.nw 4 Jul 2004 03:29:45 -0000 1.1
+++ libgeda/noweb/g_register.nw 7 Feb 2005 19:57:12 -0000
@@ -94,7 +94,8 @@
gh_new_procedure1_0 ("bitmap-directory", g_rc_bitmap_directory);
gh_new_procedure1_0 ("font-directory", g_rc_font_directory);
gh_new_procedure1_0 ("bus-ripper-symname", g_rc_bus_ripper_symname);
-
+
+ gh_new_procedure2_0 ("map-font-character-to-file", g_rc_map_font_character_to_file);
return;
}
Index: libgeda/noweb/libgeda.nw
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/libgeda/noweb/libgeda.nw,v
retrieving revision 1.5
diff -a -u -r1.5 libgeda.nw
--- libgeda/noweb/libgeda.nw 4 Jul 2004 03:29:45 -0000 1.5
+++ libgeda/noweb/libgeda.nw 7 Feb 2005 19:57:13 -0000
@@ -91,6 +91,8 @@
s_attrib_init();
s_color_init();
+ o_text_init();
+
g_register_libgeda_funcs();
}
Index: libgeda/noweb/o_text_basic.nw
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/libgeda/noweb/o_text_basic.nw,v
retrieving revision 1.16
diff -a -u -r1.16 o_text_basic.nw
--- libgeda/noweb/o_text_basic.nw 12 Jan 2004 02:05:58 -0000 1.16
+++ libgeda/noweb/o_text_basic.nw 7 Feb 2005 19:57:23 -0000
@@ -25,6 +25,7 @@
<<o_text_basic.c : o_text_create_string()>>
<<o_text_basic.c : o_text_add()>>
<<o_text_basic.c : o_text_recalc()>>
+<<o_text_basic.c : o_text_convert_to_utf8()>>
<<o_text_basic.c : o_text_read()>>
<<o_text_basic.c : o_text_set_info_font()>>
<<o_text_basic.c : o_text_save()>>
@@ -105,7 +106,6 @@
#include "funcs.h"
#include "../include/prototype.h"
-
@
@@ -114,13 +114,18 @@
#define BACKING 2
/* font storage and friends are staying global so that all can access */
-#define NUM_CHARS 256
@ %def WINONLY BACKING NUM_CHARS
<<o_text_basic.c : global variable>>=
-OBJECT font_set[NUM_CHARS];
+/* Stores a list with font data */
+GSList *font_set = NULL;
+/* Hashtable storing font_character (string) as a key, and pointer to data */
+GHashTable *font_loaded = NULL;
+
+/* Hashtable storing mapping between character and font definition file */
+GHashTable *font_char_to_file = NULL;
/* Size of a tab in characters */
int tab_in_chars = 8;
@@ -194,14 +199,32 @@
<<o_text_basic.c : o_text_init()>>=
void
-o_text_init(void)
+o_text_init()
{
- int i;
-
- for (i = 0 ; i < NUM_CHARS; i++) {
- font_set[i].font_prim_objs = NULL;
- font_set[i].font_text_size = 100;
+ /* font_set = NULL; */
+ if (font_loaded == NULL) {
+#ifndef HAS_GTK12
+ font_loaded = g_hash_table_new_full (g_str_hash, g_str_equal, free, free);
+#else
+ font_loaded = g_hash_table_new (g_str_hash, g_str_equal);
+#endif
+ }
+ else {
+ fprintf (stderr, "o_text_init: Tried to initialize an already initialized font_loaded hash table!!\n");
+ }
+ if (font_char_to_file == NULL) {
+#ifndef HAS_GTK12
+ font_char_to_file = g_hash_table_new_full (g_str_hash, g_str_equal, free, free);
+#else
+ font_char_to_file = g_hash_table_new (g_str_hash, g_str_equal);
+#endif
+ }
+ else {
+ fprintf (stderr, "o_text_init: Tried to initialize an already initialized font_char_to_file hash table!!\n");
}
+
+ return;
+
}
@@ -217,15 +240,19 @@
void
o_text_print_set(void)
{
- OBJECT *o_current;
- int i;
+ OBJECT *o_current, *o_font_set;
+ char i;
+ gchar *aux_str;
for (i = 'A' ; i < 'Z'+1; i++) {
- if (font_set[i].font_prim_objs != NULL) {
+ aux_str = g_strdup_printf("%c", i);
+ o_font_set = g_hash_table_lookup (font_loaded, aux_str);
+ free(aux_str);
+ if (o_font_set != NULL) {
printf("%c: LOADED\n", i);
/* for (o_current=font_set[i].font_prim_objs; o_current;
o_current=o_current->next) */
- for (o_current=return_tail(font_set[i].font_prim_objs); o_current;
+ for (o_current=return_tail(o_font_set->font_prim_objs); o_current;
o_current=o_current->prev)
{
printf(" %s\n", o_current->name);
@@ -247,314 +274,16 @@
<<o_text_basic.c : o_text_load_font()>>=
OBJECT *
-o_text_load_font(TOPLEVEL *w_current, unsigned char needed_char)
+o_text_load_font(TOPLEVEL *w_current, gunichar needed_char)
{
- char *temp_string = NULL;
- OBJECT *temp_parent;
+ gchar *temp_string = NULL;
+ OBJECT *temp_parent, *o_font_set;
int not_found = FALSE;
+ gchar *aux_str;
+ gchar *aux_str2;
- switch(needed_char) {
-
- case(' '):
- temp_string = g_strdup_printf("%s%cspace.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('\n'):
- temp_string = g_strdup_printf("%s%cnewline.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
-
- case('!'):
- temp_string = g_strdup_printf("%s%cexcl.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case(','):
- temp_string = g_strdup_printf("%s%ccomma.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('('):
- temp_string = g_strdup_printf("%s%clparen.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case(')'):
- temp_string = g_strdup_printf("%s%crparen.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('-'):
- temp_string = g_strdup_printf("%s%cminus.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('+'):
- temp_string = g_strdup_printf("%s%cplus.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('#'):
- temp_string = g_strdup_printf("%s%cpound.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('?'):
- temp_string = g_strdup_printf("%s%cquest.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('"'):
- temp_string = g_strdup_printf("%s%cquote.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case(':'):
- temp_string = g_strdup_printf("%s%ccolon.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('@'):
- temp_string = g_strdup_printf("%s%cat.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('='):
- temp_string = g_strdup_printf("%s%cequal.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('>'):
- temp_string = g_strdup_printf("%s%cmore.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('<'):
- temp_string = g_strdup_printf("%s%cless.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('/'):
- temp_string = g_strdup_printf("%s%cslash.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('$'):
- temp_string = g_strdup_printf("%s%cdollar.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case(';'):
- temp_string = g_strdup_printf("%s%csemi.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('&'):
- temp_string = g_strdup_printf("%s%camper.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('\\'):
- temp_string = g_strdup_printf("%s%cbackslash.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('{'):
- temp_string = g_strdup_printf("%s%clbrace.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('}'):
- temp_string = g_strdup_printf("%s%crbrace.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('\''):
- temp_string = g_strdup_printf("%s%capost.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('`'):
- temp_string = g_strdup_printf("%s%cbacktick.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('^'):
- temp_string = g_strdup_printf("%s%ccaret.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('%'):
- temp_string = g_strdup_printf("%s%cpercent.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('['):
- temp_string = g_strdup_printf("%s%clbrack.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case(']'):
- temp_string = g_strdup_printf("%s%crbrack.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('*'):
- temp_string = g_strdup_printf("%s%castericks.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('.'):
- temp_string = g_strdup_printf("%s%cperiod.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('_'):
- temp_string = g_strdup_printf("%s%cunder.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('~'):
- temp_string = g_strdup_printf("%s%ctilde.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case('|'):
- temp_string = g_strdup_printf("%s%cvbar.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (196): /* A-umlaut finnish/swedish/german */
- temp_string = g_strdup_printf("%s%cA-diaeresis.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (197): /* A-ring finnish/swedish/danish/norwegian */
- temp_string = g_strdup_printf("%s%cA-ring.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (198): /* AE-diphtong danish/norwegian */
- temp_string = g_strdup_printf("%s%cAE-lig.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (214): /* O-umlaut finnish/swedish/german */
- temp_string = g_strdup_printf("%s%cO-diaeresis.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (216): /* O-slash danish/norwegian */
- temp_string = g_strdup_printf("%s%cO-slash.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (220): /* U-umlaut german */
- temp_string = g_strdup_printf("%s%cU-diaeresis.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (228): /* a-umlaut finnish/swedish/german */
- temp_string = g_strdup_printf("%s%ca_-diaeresis.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (229): /* a-ring finnish/swedish/danish/norwegian */
- temp_string = g_strdup_printf("%s%ca_-ring.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (230): /* ae-diphtong danish/norwegian */
- temp_string = g_strdup_printf("%s%cae_-lig.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (246): /* o-umlaut finnish/swedish/german */
- temp_string = g_strdup_printf("%s%co_-diaeresis.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (248): /* o-slash danish/norwegian */
- temp_string = g_strdup_printf("%s%co_-slash.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (252): /* u-umlaut german */
- temp_string = g_strdup_printf("%s%cu_-diaeresis.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (225): /* a-acute_accent spanish */
- temp_string = g_strdup_printf("%s%ca_-acute-accent.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (233): /* e-acute_accent spanish */
- temp_string = g_strdup_printf("%s%ce_-acute-accent.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (237): /* i-acute_accent spanish */
- temp_string = g_strdup_printf("%s%ci_-acute-accent.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (243): /* o-acute_accent spanish */
- temp_string = g_strdup_printf("%s%co_-acute-accent.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (250): /* u-acute_accent spanish */
- temp_string = g_strdup_printf("%s%cu_-acute-accent.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (193): /* A-acute_accent spanish */
- temp_string = g_strdup_printf("%s%cA-acute-accent.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (201): /* E-acute_accent spanish */
- temp_string = g_strdup_printf("%s%cE-acute-accent.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (205): /* I-acute_accent spanish */
- temp_string = g_strdup_printf("%s%cI-acute-accent.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (211): /* O-acute_accent spanish */
- temp_string = g_strdup_printf("%s%cO-acute-accent.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (218): /* U-acute_accent spanish */
- temp_string = g_strdup_printf("%s%cU-acute-accent.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (241): /* n-tilde spanish */
- temp_string = g_strdup_printf("%s%cn_-tilde.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (209): /* N-tilde spanish */
- temp_string = g_strdup_printf("%s%cN-tilde.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (161): /* open exclamation spanish */
- temp_string = g_strdup_printf("%s%cexcl-open.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- case (191): /* open question spanish */
- temp_string = g_strdup_printf("%s%cquest-open.sym",
- w_current->font_directory, PATH_SEPARATER_CHAR);
- break;
-
- default:
+ aux_str = g_strdup_printf("%c", needed_char);
+ if ((aux_str2 = g_hash_table_lookup(font_char_to_file, aux_str)) == NULL) {
/* this is needed since WinNT file systems are
* case insensitive, and cannot tell the difference
* between A.sym and a.sym. So we create a_.sym -
@@ -569,9 +298,12 @@
w_current->font_directory, PATH_SEPARATER_CHAR,
needed_char);
}
- break;
-
}
+ else {
+ temp_string = g_strdup_printf("%s", aux_str2);
+ }
+ aux_str2 = NULL;
+ free(aux_str);
if ( access(temp_string, R_OK) != 0 ) {
s_log_message("Could not find character %c definition\n",needed_char, temp_string);
@@ -584,31 +316,66 @@
not_found = TRUE;
}
- /* printf("loading: %s\n", temp_string);*/
+ /* Make new object for the font set list */
+ o_font_set = (OBJECT *) malloc(sizeof(OBJECT));
- font_set[(unsigned char) needed_char].font_prim_objs = o_text_add_head();
+ if (o_font_set == NULL) {
+ fprintf(stderr, "Could not perform malloc; something is broken or increase your process limits\n");
+ exit(-1);
+ }
+
+ o_font_set->font_prim_objs = NULL;
+ o_font_set->font_text_size = 100;
- temp_parent = w_current->page_current->object_parent;
- /* set the addition of attributes to the head node */
- w_current->page_current->object_parent = font_set[(unsigned char) needed_char].font_prim_objs;
+ /* Add it to the list and hash table. Some functions will need it */
+ aux_str = g_strdup_printf("%c", needed_char);
+ g_hash_table_insert(font_loaded, aux_str, o_font_set);
+ if (g_hash_table_lookup(font_loaded, aux_str) == NULL) {
+ fprintf(stderr, "Can't find the node that was just inserted!!!\n");
+ exit(-1);
+ }
+ /* aux_str will only be freed when removing the entry in the hash table */
- font_set[(unsigned char) needed_char].font_prim_objs =
- o_read(w_current, font_set[(unsigned char) needed_char].font_prim_objs,
- temp_string);
- w_current->page_current->object_parent = temp_parent;
+ font_set = g_slist_append (font_set, o_font_set);
- font_set[(unsigned char) needed_char].font_prim_objs =
- return_head(font_set[(unsigned char) needed_char].font_prim_objs);
+ o_font_set->name = NULL;
+ o_font_set->font_prim_objs = o_text_add_head();
+ /* Modify name of the text so we can free the hashtable entry later */
+ if (o_font_set->name != NULL) {
+ free(o_font_set->name);
+ }
+ o_font_set->name = aux_str;
+
if (not_found == TRUE) {
/* set the font text size (width) to the question mark's size */
/* yes, the question mark character was loaded instead of the real char */
/* 63 == question mark character */
- font_set[(unsigned char) needed_char].font_text_size =
- font_set[63].font_text_size;
+
+ OBJECT *aux_obj;
+
+ aux_str = g_strdup_printf("?");
+ aux_obj = g_hash_table_lookup (font_loaded, aux_str);
+ if (aux_obj == NULL) {
+ o_text_load_font(w_current, (gunichar) '?');
+ aux_obj = g_hash_table_lookup (font_loaded, aux_str);
+ }
+ free (aux_str);
+
+ o_font_set->font_text_size = aux_obj->font_text_size;
}
-
- return(font_set[(unsigned char) needed_char].font_prim_objs);
+
+ temp_parent = w_current->page_current->object_parent;
+ /* set the addition of attributes to the head node */
+ w_current->page_current->object_parent = o_font_set->font_prim_objs;
+
+ o_font_set->font_prim_objs = o_read(w_current, o_font_set->font_prim_objs,
+ temp_string);
+ w_current->page_current->object_parent = temp_parent;
+
+ o_font_set->font_prim_objs = return_head(o_font_set->font_prim_objs);
+
+ return(o_font_set->font_prim_objs);
}
@@ -624,7 +391,9 @@
int
o_text_num_lines(char *string)
{
- int i, line_count = 0;
+ int line_count = 0;
+ gchar *aux;
+ gunichar current_char;
if (string == NULL) {
return 0;
@@ -633,9 +402,12 @@
/* if it's not null, then we have at least one line */
line_count++;
/* Count how many \n are in the string */
- for (i = 0; i <= strlen(string); i++) {
- if (string[i] == '\n')
+ aux = string;
+ while (aux && ((gunichar) (*aux) != 0) ) {
+ current_char = g_utf8_get_char_validated(aux, -1);
+ if (current_char == '\n')
line_count++;
+ aux = g_utf8_find_next_char(aux, NULL);
}
return (line_count);
@@ -689,38 +461,58 @@
int len;
int width=0, max_width=0;
int size_of_tab_in_coord;
-
+ gchar *aux;
+ gunichar current_char;
+ OBJECT *o_font_set;
+ gchar *aux_str;
+
+ aux_str = g_strdup_printf("%c", TAB_CHAR_MODEL[0]);
+ o_font_set = g_hash_table_lookup (font_loaded, aux_str);
+
/* Make sure TAB_CHAR_MODEL is loaded before trying to use its text */
/* size */
- if (font_set[(unsigned char) TAB_CHAR_MODEL[0]].font_prim_objs == NULL) {
- o_text_load_font(w_current, (unsigned char) TAB_CHAR_MODEL[0]);
+ if (o_font_set == NULL) {
+ o_text_load_font(w_current, (gunichar) TAB_CHAR_MODEL[0]);
+ o_font_set = (OBJECT *) g_hash_table_lookup (font_loaded, aux_str);
}
+ free (aux_str);
+
/* Get the maximum tab width's in coordinates */
size_of_tab_in_coord = tab_in_chars * size *
- font_set[(unsigned char) TAB_CHAR_MODEL[0]].font_text_size ;
-
+ o_font_set->font_text_size ;
+
if (string == NULL) {
return 0;
}
- len = strlen(string);
- for (i = 0 ; i < len ; i++ ) {
- if (string[i] == '\n') {
+
+ aux = string;
+ while (aux && ((gunichar) (*aux) != 0) ) {
+ current_char = g_utf8_get_char_validated(aux, -1);
+ aux = g_utf8_find_next_char(aux, NULL);
+
+ if (current_char == '\n') {
width = 0;
continue;
}
- if (string[i] == '\t') {
+ if (current_char == '\t') {
width += (size_of_tab_in_coord - (width % size_of_tab_in_coord));
continue;
}
-
- if (font_set[(unsigned char) string[i]].font_prim_objs == NULL) {
- o_text_load_font(w_current, (unsigned char) string[i]);
- }
- width = width + size*font_set[(unsigned char) string[i]].font_text_size;
+ /* Find current_char */
+ aux_str = g_strdup_printf("%c", current_char);
+ o_font_set = g_hash_table_lookup (font_loaded, aux_str);
+ if (o_font_set == NULL) {
+ o_text_load_font(w_current, (gunichar) current_char);
+ o_font_set = g_hash_table_lookup (font_loaded, aux_str);
+ }
+ free (aux_str);
+
+ width = width + size*o_font_set->font_text_size;
if (width > max_width)
max_width = width;
+
}
/* the size is a fudge factor */
@@ -728,6 +520,7 @@
/* Yes, the -size*10 fudge factor should be removed. */
/* return(max_width - size*10); */
return(max_width);
+
}
@@ -748,8 +541,6 @@
OBJECT *temp_tail=NULL;
OBJECT *temp_list;
OBJECT *start_of_char;
- int i;
- int len;
int x_offset;
int y_offset;
int text_width;
@@ -757,6 +548,10 @@
int char_height;
int line_start_x, line_start_y;
int sign=1;
+ gchar *aux;
+ gunichar current_char;
+ gchar *aux_str;
+ OBJECT *o_font_set;
temp_list = object_list;
@@ -766,7 +561,6 @@
return(NULL);
}
- len = strlen(string);
/* now read in the chars */
temp_tail = w_current->page_current->object_tail;
@@ -928,37 +722,52 @@
line_start_x = x_offset;
line_start_y = y_offset;
- for (i = 0 ; i < len ; i++ ) {
-
- if (font_set[(unsigned char) string[i]].font_prim_objs == NULL) {
- o_text_load_font(w_current, (unsigned char) string[i]);
+ aux = string;
+ while (aux && ((gunichar) (*aux) != 0) ) {
+
+ current_char = g_utf8_get_char_validated(aux, -1);
+ aux = g_utf8_find_next_char(aux, NULL);
+
+ aux_str = g_strdup_printf("%c", current_char);
+ o_font_set = g_hash_table_lookup(font_loaded, aux_str);
+ if (o_font_set == NULL) {
+ o_text_load_font(w_current, (gunichar) current_char);
+ o_font_set = g_hash_table_lookup(font_loaded, aux_str);
}
+ free(aux_str);
start_of_char = temp_list;
- if (font_set[(unsigned char) string[i]].font_prim_objs->next) {
+ if (o_font_set->font_prim_objs->next != NULL) {
int rel_char_coord;
int size_of_tab_in_coord;
+ OBJECT *o_font_set_aux;
/* Make sure TAB_CHAR_MODEL is loaded before trying to use its text */
/* size */
- if (font_set[(unsigned char) TAB_CHAR_MODEL[0]].font_prim_objs == NULL) {
- o_text_load_font(w_current, (unsigned char) TAB_CHAR_MODEL[0]);
+ aux_str = g_strdup_printf("%c", TAB_CHAR_MODEL[0]);
+ o_font_set_aux = g_hash_table_lookup(font_loaded, aux_str);
+ if (o_font_set_aux == NULL) {
+ o_text_load_font(w_current, (gunichar) TAB_CHAR_MODEL[0]);
+ o_font_set_aux = g_hash_table_lookup(font_loaded, aux_str);
}
+ free (aux_str);
+
/* Get the maximum tab width's in coordinates */
size_of_tab_in_coord = tab_in_chars *
o_text_width(w_current, TAB_CHAR_MODEL, size/2);
- if (string[i] != '\n' && string[i] != '\t') {
+ if (current_char != '\n' && current_char != '\t') {
/* only add the character if it is not a newline or tab character */
temp_list = o_list_copy_all(w_current,
- font_set[(unsigned char) string[i]].font_prim_objs->next,
+ o_font_set->font_prim_objs->next,
temp_list, NORMAL_FLAG);
- start_of_char = start_of_char->next;
+ if (start_of_char != NULL)
+ start_of_char = start_of_char->next;
}
/* if the character is a newline or tab, this code will "continue" */
- switch (string[i]) {
+ switch (current_char) {
case '\n':
switch (angle) {
case 0:
@@ -1048,24 +857,25 @@
switch(angle) {
case(0):
x_offset = (x_offset) +
- size/2*font_set[(unsigned char) string[i]].font_text_size;
+ size/2*o_font_set->font_text_size;
break;
case(90):
y_offset = (y_offset) +
- size/2*font_set[(unsigned char) string[i]].font_text_size;
+ size/2*o_font_set->font_text_size;
break;
case(180):
x_offset = (x_offset) -
- size/2*font_set[(unsigned char) string[i]].font_text_size;
+ size/2*o_font_set->font_text_size;
break;
case(270):
y_offset = (y_offset) -
- size/2*font_set[(unsigned char) string[i]].font_text_size;
+ size/2*o_font_set->font_text_size;
break;
}
+
}
/* don't set the head */
@@ -1078,7 +888,6 @@
return(object_list);
}
-
@ %def o_text_create_string
@@ -1253,6 +1062,59 @@
@ %def o_text_recalc
+@section Function @code{o_text_convert_to_utf8()}
+
+@defun o_text_convert_to_utf8 string
+@end defun
+
+<<o_text_basic.c : o_text_convert_to_utf8()>>=
+gchar *
+o_text_convert_to_utf8 (gchar *string)
+{
+ GSList *codenames = NULL, *aux_ptr;
+ gchar *out_str = NULL;
+ gsize b_written;
+
+#ifdef HAS_GTK22
+ codenames = g_slist_append(codenames, g_strdup("UTF-8"));
+ codenames = g_slist_append(codenames, g_strdup("ISO_8859-15"));
+
+ aux_ptr = codenames;
+ while (aux_ptr != NULL) {
+ out_str = g_convert (string, strlen(string), "UTF-8", aux_ptr->data,
+ NULL, &b_written, NULL);
+
+ aux_ptr = aux_ptr->next;
+ if (out_str != NULL) {
+ break;
+ }
+
+ }
+
+ /* Free the list */
+ aux_ptr = codenames;
+ while (aux_ptr != NULL) {
+ free (aux_ptr->data);
+ aux_ptr = aux_ptr->next;
+ }
+ g_slist_free(codenames);
+#endif
+
+ if (out_str != NULL) {
+ return (out_str);
+ }
+ else {
+#ifdef HAS_GTK22
+ fprintf (stderr, "o_text_convert_to_utf8: Can't convert string to utf8: %s.\n", string);
+#endif
+ return(g_strdup(string));
+ }
+}
+
+
+@ %def o_text_convert_to_utf8
+
+
@section Function @code{o_text_read()}
@defun o_text_read w_current object_list buf string version
@@ -1359,15 +1221,19 @@
assert(num_lines && num_lines > 0);
for (i = 0; i < num_lines; i++)
{
+ gchar *utf_str;
+
fgets(buffer, 1024, fp);
+ utf_str = o_text_convert_to_utf8(buffer);
if (string == 0) {
- string = u_basic_strdup(buffer);
+ string = u_basic_strdup(utf_str);
} else {
- temp = u_basic_strdup_multiple(string, buffer, NULL);
+ temp = u_basic_strdup_multiple(string, utf_str, NULL);
free(string);
string = temp;
}
+ free (utf_str);
}
string = remove_last_nl(string);
@@ -1398,6 +1264,8 @@
unsigned int temp;
int special=0;
char *string;
+ gchar *aux_str;
+ OBJECT *o_font_set;
string = g_strdup(remove_nl(buf));
@@ -1416,10 +1284,22 @@
character = 10;
}
- temp = (unsigned char) character;
- if ( temp >= 0 && temp <= 255) {
- font_set[(unsigned char) character].font_text_size = width;
+ /* With Unicode support, there's no need that the character is 0-255. */
+ /* temp = (unsigned char) character; */
+ /* if ( temp >= 0 && temp <= 255) { */
+
+ aux_str = g_strdup_printf("%c", character);
+ o_font_set = g_hash_table_lookup (font_loaded, aux_str);
+ free (aux_str);
+
+ if (o_font_set != NULL) {
+ o_font_set->font_text_size = width;
+ }
+ else {
+ fprintf(stderr, "o_text_set_info_font: character %c not found!!!\n", character);
}
+
+ /* } */
free(string);
}
@@ -1652,17 +1532,53 @@
@end defun
<<o_text_basic.c : o_text_freeallfonts()>>=
+#ifdef HAS_GTK12
+/* Function called by g_hash_table_foreach_remove to free
+ each value/entry of the hash table */
+gboolean o_text_free_hashtable_entry (gpointer key, gpointer value, gpointer user_data) {
+ free (value);
+ free (key);
+ return (TRUE);
+}
+#endif
+
void
o_text_freeallfonts(TOPLEVEL *w_current)
{
int i;
+ OBJECT *aux;
+ gchar *entry;
- for (i = 0 ; i < NUM_CHARS; i++) {
- if (font_set[i].font_prim_objs != NULL) {
- s_delete_list_fromstart(w_current, font_set[i].font_prim_objs);
- font_set[i].font_prim_objs = NULL;
+ aux = (OBJECT *) font_set;
+ while ((aux = (OBJECT *) g_slist_nth_data(font_set,0)) != NULL) {
+ if (aux->font_prim_objs != NULL) {
+ s_delete_list_fromstart(w_current, aux->font_prim_objs);
+ aux->font_prim_objs = NULL;
+ }
+ /* Remove the entry from the hash table */
+ /* (OBJECT *)->name = key of font_loaded, so it will be freed later */
+#ifdef HAS_GTK12
+ /* GTK12 needs the data in the hash table to be freed */
+ if ((entry = g_hash_table_lookup (font_loaded, aux->name)) != NULL) {
+ free (entry);
}
+ free (aux->name);
+#endif
+ /* Remove from the list the node with data pointed by aux */
+ font_set = g_slist_remove(font_set, aux);
+
}
+ g_slist_free (font_set);
+
+ /* Destroy the font to file hashtable */
+ g_hash_table_destroy(font_loaded);
+
+ /* Destroy the font to file hashtable */
+#ifdef HAS_GTK12
+ /* GTK12 needs the data in the hash table to be freed */
+ g_hash_table_foreach_remove (font_char_to_file, o_text_free_hashtable_entry, NULL);
+#endif
+ g_hash_table_destroy(font_char_to_file);
}
@@ -2272,6 +2188,8 @@
}
o_current=o_current->next;
}
+ /* String?? Which string? */
+ /* free(string); */
}
Index: symbols/ChangeLog
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/symbols/ChangeLog,v
retrieving revision 1.180
diff -a -u -r1.180 ChangeLog
--- symbols/ChangeLog 23 Jan 2005 04:12:43 -0000 1.180
+++ symbols/ChangeLog 7 Feb 2005 19:57:34 -0000
@@ -1,3 +1,6 @@
+2005-02-07 Carlos Nieves Onega <cnieves@xxxxxxxxxx>
+ * system-gafrc.in: Include font character to file map.
+
2005-01-22 Ales Hvezda <ahvezda@xxxxxxxxxxxxx>
* Removed system-commonrc.in from CVS as system-gafrc.in has replaced
Index: symbols/system-gafrc.in
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/symbols/system-gafrc.in,v
retrieving revision 1.1
diff -a -u -r1.1 system-gafrc.in
--- symbols/system-gafrc.in 8 Jan 2005 02:09:07 -0000 1.1
+++ symbols/system-gafrc.in 7 Feb 2005 19:57:36 -0000
@@ -119,7 +119,8 @@
; the directory.
; All environment variables *MUST* be in the form ${variable_name}
;
-(font-directory "${GEDADATA}@PATHSEP@sym@PATHSEP@font")
+(define default-font-directory "${GEDADATA}@PATHSEP@sym@PATHSEP@font")
+(font-directory default-font-directory)
; scheme-directory string
@@ -143,3 +144,239 @@
; End of path related keywords
;
+;
+; Start of font related keywords
+;
+
+(map-font-character-to-file " " (string-append default-font-directory "@PATHSEP@"
+ "space.sym"))
+
+ ; The newline.sym symbol is not used!!. Use excl.sym or the newline
+ ; will not be handled correctly!!.
+(map-font-character-to-file "\n" (string-append default-font-directory "/"
+ "excl.sym"))
+
+(map-font-character-to-file "!" (string-append default-font-directory "@PATHSEP@"
+ "excl.sym"))
+(map-font-character-to-file "," (string-append default-font-directory "@PATHSEP@"
+ "comma.sym"))
+(map-font-character-to-file "(" (string-append default-font-directory "@PATHSEP@"
+ "lparen.sym"))
+(map-font-character-to-file ")" (string-append default-font-directory "@PATHSEP@"
+ "rparen.sym"))
+(map-font-character-to-file "-" (string-append default-font-directory "@PATHSEP@"
+ "minus.sym"))
+(map-font-character-to-file "+" (string-append default-font-directory "@PATHSEP@"
+ "plus.sym"))
+(map-font-character-to-file "#" (string-append default-font-directory "@PATHSEP@"
+ "pound.sym"))
+(map-font-character-to-file "?" (string-append default-font-directory "@PATHSEP@"
+ "quest.sym"))
+(map-font-character-to-file "\"" (string-append default-font-directory "@PATHSEP@"
+ "quote.sym"))
+(map-font-character-to-file ":" (string-append default-font-directory "@PATHSEP@"
+ "colon.sym"))
+(map-font-character-to-file "@" (string-append default-font-directory "@PATHSEP@"
+ "at.sym"))
+(map-font-character-to-file "=" (string-append default-font-directory "@PATHSEP@"
+ "equal.sym"))
+(map-font-character-to-file ">" (string-append default-font-directory "@PATHSEP@"
+ "more.sym"))
+(map-font-character-to-file "<" (string-append default-font-directory "@PATHSEP@"
+ "less.sym"))
+(map-font-character-to-file "/" (string-append default-font-directory "@PATHSEP@"
+ "slash.sym"))
+(map-font-character-to-file "$" (string-append default-font-directory "@PATHSEP@"
+ "dollar.sym"))
+(map-font-character-to-file ";" (string-append default-font-directory "@PATHSEP@"
+ "semi.sym"))
+(map-font-character-to-file "&" (string-append default-font-directory "@PATHSEP@"
+ "amper.sym"))
+(map-font-character-to-file "\\" (string-append default-font-directory "@PATHSEP@"
+ "backslash.sym"))
+(map-font-character-to-file "{" (string-append default-font-directory "@PATHSEP@"
+ "lbrace.sym"))
+(map-font-character-to-file "}" (string-append default-font-directory "@PATHSEP@"
+ "rbrace.sym"))
+(map-font-character-to-file "'" (string-append default-font-directory "@PATHSEP@"
+ "apost.sym"))
+(map-font-character-to-file "`" (string-append default-font-directory "@PATHSEP@"
+ "backtick.sym"))
+(map-font-character-to-file "^" (string-append default-font-directory "@PATHSEP@"
+ "caret.sym"))
+(map-font-character-to-file "%" (string-append default-font-directory "@PATHSEP@"
+ "percent.sym"))
+(map-font-character-to-file "[" (string-append default-font-directory "@PATHSEP@"
+ "lbrack.sym"))
+(map-font-character-to-file "]" (string-append default-font-directory "@PATHSEP@"
+ "rbrack.sym"))
+(map-font-character-to-file "*" (string-append default-font-directory "@PATHSEP@"
+ "astericks.sym"))
+(map-font-character-to-file "." (string-append default-font-directory "@PATHSEP@"
+ "period.sym"))
+(map-font-character-to-file "_" (string-append default-font-directory "@PATHSEP@"
+ "under.sym"))
+(map-font-character-to-file "~" (string-append default-font-directory "@PATHSEP@"
+ "tilde.sym"))
+(map-font-character-to-file "|" (string-append default-font-directory "@PATHSEP@"
+ "vbar.sym"))
+
+; A-umlaut finnish/swedish/german
+(map-font-character-to-file
+ (string (integer->char 196))
+ (string-append default-font-directory "@PATHSEP@"
+ "A-diaeresis.sym"))
+
+; A-ring finnish/swedish/danish/norwegian
+(map-font-character-to-file
+ (string (integer->char 197))
+ (string-append default-font-directory "@PATHSEP@"
+ "A-ring.sym"))
+
+; AE-diphtong danish/norwegian
+(map-font-character-to-file
+ (string (integer->char 198))
+ (string-append default-font-directory "@PATHSEP@"
+ "AE-lig.sym"))
+
+; O-umlaut finnish/swedish/german
+(map-font-character-to-file
+ (string (integer->char 214))
+ (string-append default-font-directory "@PATHSEP@"
+ "O-diaeresis.sym"))
+
+; O-slash danish/norwegian
+(map-font-character-to-file
+ (string (integer->char 216))
+ (string-append default-font-directory "@PATHSEP@"
+ "O-slash.sym"))
+
+; U-umlaut german
+(map-font-character-to-file
+ (string (integer->char 220))
+ (string-append default-font-directory "@PATHSEP@"
+ "U-diaeresis.sym"))
+
+; a-umlaut finnish/swedish/german
+(map-font-character-to-file
+ (string (integer->char 228))
+ (string-append default-font-directory "@PATHSEP@"
+ "a_-diaeresis.sym"))
+
+; a-ring finnish/swedish/danish/norwegian
+(map-font-character-to-file
+ (string (integer->char 229))
+ (string-append default-font-directory "@PATHSEP@"
+ "a_-ring.sym"))
+
+; ae-diphtong danish/norwegian
+(map-font-character-to-file
+ (string (integer->char 230))
+ (string-append default-font-directory "@PATHSEP@"
+ "ae_-lig.sym"))
+
+; o-umlaut finnish/swedish/german
+(map-font-character-to-file
+ (string (integer->char 246))
+ (string-append default-font-directory "@PATHSEP@"
+ "o_-diaeresis.sym"))
+
+; o-slash danish/norwegian
+(map-font-character-to-file
+ (string (integer->char 248))
+ (string-append default-font-directory "@PATHSEP@"
+ "o_-slash.sym"))
+
+; u-umlaut german
+(map-font-character-to-file
+ (string (integer->char 252))
+ (string-append default-font-directory "@PATHSEP@"
+ "u_-diaeresis.sym"))
+
+; a-acute_accent spanish
+(map-font-character-to-file
+ (string (integer->char 225))
+ (string-append default-font-directory "@PATHSEP@"
+ "a_-acute-accent.sym"))
+
+; e-acute_accent spanish
+(map-font-character-to-file
+ (string (integer->char 233))
+ (string-append default-font-directory "@PATHSEP@"
+ "e_-acute-accent.sym"))
+
+; i-acute_accent spanish
+(map-font-character-to-file
+ (string (integer->char 237))
+ (string-append default-font-directory "@PATHSEP@"
+ "i_-acute-accent.sym"))
+
+; o-acute_accent spanish
+(map-font-character-to-file
+ (string (integer->char 243))
+ (string-append default-font-directory "@PATHSEP@"
+ "o_-acute-accent.sym"))
+
+; u-acute_accent spanish
+(map-font-character-to-file
+ (string (integer->char 250))
+ (string-append default-font-directory "@PATHSEP@"
+ "u_-acute-accent.sym"))
+
+; A-acute_accent spanish
+(map-font-character-to-file
+ (string (integer->char 193))
+ (string-append default-font-directory "@PATHSEP@"
+ "A-acute-accent.sym"))
+
+; E-acute_accent spanish
+(map-font-character-to-file
+ (string (integer->char 201))
+ (string-append default-font-directory "@PATHSEP@"
+ "E-acute-accent.sym"))
+
+; I-acute_accent spanish
+(map-font-character-to-file
+ (string (integer->char 205))
+ (string-append default-font-directory "@PATHSEP@"
+ "I-acute-accent.sym"))
+
+; O-acute_accent spanish
+(map-font-character-to-file
+ (string (integer->char 211))
+ (string-append default-font-directory "@PATHSEP@"
+ "O-acute-accent.sym"))
+
+; U-acute_accent spanish
+(map-font-character-to-file
+ (string (integer->char 218))
+ (string-append default-font-directory "@PATHSEP@"
+ "U-acute-accent.sym"))
+
+; n-tilde spanish
+(map-font-character-to-file
+ (string (integer->char 241))
+ (string-append default-font-directory "@PATHSEP@"
+ "n_-tilde.sym"))
+
+; N-tilde spanish
+(map-font-character-to-file
+ (string (integer->char 209))
+ (string-append default-font-directory "@PATHSEP@"
+ "N-tilde.sym"))
+
+; open exclamation spanish
+(map-font-character-to-file
+ (string (integer->char 161))
+ (string-append default-font-directory "@PATHSEP@"
+ "excl-open.sym"))
+
+; open question spanish
+(map-font-character-to-file
+ (string (integer->char 191))
+ (string-append default-font-directory "@PATHSEP@"
+ "quest-open.sym"))
+
+;
+; End of font related keywords
+;