comparison src/unicode.c @ 3659:98af8a976fc3

[xemacs-hg @ 2006-11-05 22:31:31 by aidan] Support specifying fonts for particular character sets in Mule; support translation to ISO 10646-1 for Mule character sets without an otherwise matching font; move to a vector of X11-charset-X11-registry instead of a regex for the charset-registry property.
author aidan
date Sun, 05 Nov 2006 22:31:46 +0000
parents 551c008d3777
children 6b2ef948e140
comparison
equal deleted inserted replaced
3658:0db1aaedbbef 3659:98af8a976fc3
1113 (-1 == (i = get_free_codepoint(Vcurrent_jit_charset)))) 1113 (-1 == (i = get_free_codepoint(Vcurrent_jit_charset))))
1114 { 1114 {
1115 Ibyte setname[32]; 1115 Ibyte setname[32];
1116 Lisp_Object charset_descr = build_string 1116 Lisp_Object charset_descr = build_string
1117 ("Mule charset for otherwise unknown Unicode code points."); 1117 ("Mule charset for otherwise unknown Unicode code points.");
1118 Lisp_Object charset_regr = build_string("iso10646-1"); 1118
1119 1119 struct gcpro gcpro1;
1120 struct gcpro gcpro1, gcpro2;
1121 1120
1122 if ('\0' == last_jit_charset_final) 1121 if ('\0' == last_jit_charset_final)
1123 { 1122 {
1124 /* This final byte shit is, umm, not that cool. */ 1123 /* This final byte shit is, umm, not that cool. */
1125 last_jit_charset_final = 0x30; 1124 last_jit_charset_final = 0x30;
1136 philosophy. make-charset cannot currently GC, but is intended 1135 philosophy. make-charset cannot currently GC, but is intended
1137 to be called from Lisp, with its arguments protected by the 1136 to be called from Lisp, with its arguments protected by the
1138 Lisp reader. We GCPRO in case it GCs in the future and no-one 1137 Lisp reader. We GCPRO in case it GCs in the future and no-one
1139 checks all the C callers. */ 1138 checks all the C callers. */
1140 1139
1141 GCPRO2 (charset_descr, charset_regr); 1140 GCPRO1 (charset_descr);
1142 Vcurrent_jit_charset = Fmake_charset 1141 Vcurrent_jit_charset = Fmake_charset
1143 (intern((const CIbyte *)setname), charset_descr, 1142 (intern((const CIbyte *)setname), charset_descr,
1144 /* Set encode-as-utf-8 to t, to have this character set written 1143 /* Set encode-as-utf-8 to t, to have this character set written
1145 using UTF-8 escapes in escape-quoted and ctext. This 1144 using UTF-8 escapes in escape-quoted and ctext. This
1146 sidesteps the fact that our internal character -> Unicode 1145 sidesteps the fact that our internal character -> Unicode
1147 mapping is not stable from one invocation to the next. */ 1146 mapping is not stable from one invocation to the next. */
1148 nconc2 (list2(Qencode_as_utf_8, Qt), 1147 nconc2 (list2(Qencode_as_utf_8, Qt),
1149 nconc2 (list6(Qcolumns, make_int(1), Qchars, make_int(96), 1148 nconc2 (list6(Qcolumns, make_int(1), Qchars, make_int(96),
1150 Qdimension, make_int(2)), 1149 Qdimension, make_int(2)),
1151 list6(Qregistry, charset_regr, 1150 list6(Qregistries, Qunicode_registries,
1152 Qfinal, make_char(last_jit_charset_final++), 1151 Qfinal, make_char(last_jit_charset_final++),
1153 /* This CCL program is initialised in 1152 /* This CCL program is initialised in
1154 unicode.el. */ 1153 unicode.el. */
1155 Qccl_program, Qccl_encode_to_ucs_2)))); 1154 Qccl_program, Qccl_encode_to_ucs_2))));
1156 UNGCPRO; 1155 UNGCPRO;
2537 DEFSUBR (Fload_unicode_mapping_table); 2536 DEFSUBR (Fload_unicode_mapping_table);
2538 2537
2539 DEFSYMBOL (Qccl_encode_to_ucs_2); 2538 DEFSYMBOL (Qccl_encode_to_ucs_2);
2540 DEFSYMBOL (Qlast_allocated_character); 2539 DEFSYMBOL (Qlast_allocated_character);
2541 DEFSYMBOL (Qignore_first_column); 2540 DEFSYMBOL (Qignore_first_column);
2541
2542 DEFSYMBOL (Qunicode_registries);
2542 #endif /* MULE */ 2543 #endif /* MULE */
2543 2544
2544 DEFSUBR (Fchar_to_unicode); 2545 DEFSUBR (Fchar_to_unicode);
2545 DEFSUBR (Funicode_to_char); 2546 DEFSUBR (Funicode_to_char);
2546 2547
2609 2610
2610 unicode_precedence_dynarr = Dynarr_new (Lisp_Object); 2611 unicode_precedence_dynarr = Dynarr_new (Lisp_Object);
2611 dump_add_root_block_ptr (&unicode_precedence_dynarr, 2612 dump_add_root_block_ptr (&unicode_precedence_dynarr,
2612 &lisp_object_dynarr_description); 2613 &lisp_object_dynarr_description);
2613 2614
2615
2616
2614 init_blank_unicode_tables (); 2617 init_blank_unicode_tables ();
2615 2618
2616 staticpro (&Vcurrent_jit_charset); 2619 staticpro (&Vcurrent_jit_charset);
2617 Vcurrent_jit_charset = Qnil; 2620 Vcurrent_jit_charset = Qnil;
2618 2621
2634 from_unicode_level_2_desc_1); 2637 from_unicode_level_2_desc_1);
2635 dump_add_root_block (&from_unicode_blank_3, sizeof (void *), 2638 dump_add_root_block (&from_unicode_blank_3, sizeof (void *),
2636 from_unicode_level_3_desc_1); 2639 from_unicode_level_3_desc_1);
2637 dump_add_root_block (&from_unicode_blank_4, sizeof (void *), 2640 dump_add_root_block (&from_unicode_blank_4, sizeof (void *),
2638 from_unicode_level_4_desc_1); 2641 from_unicode_level_4_desc_1);
2642
2643 DEFVAR_LISP ("unicode-registries", &Qunicode_registries /*
2644 Vector describing the X11 registries searched when using fallback fonts.
2645
2646 "Fallback fonts" here includes by default those fonts used by redisplay when
2647 displaying charsets for which the `encode-as-utf-8' property is true, and
2648 those used when no font matching the charset's registries property has been
2649 found (that is, they're probably Mule-specific charsets like Ethiopic or
2650 IPA.)
2651 */ );
2652 Qunicode_registries = vector1(build_string("iso10646-1"));
2639 #endif /* MULE */ 2653 #endif /* MULE */
2640 } 2654 }