Mercurial > hg > xemacs-beta
comparison src/faces.c @ 4187:26dccfc8fa60
[xemacs-hg @ 2007-09-26 13:27:59 by didierv]
More fixes about face indexes
author | didierv |
---|---|
date | Wed, 26 Sep 2007 13:28:01 +0000 |
parents | 049dc907c17a |
children | e820df1cb11a |
comparison
equal
deleted
inserted
replaced
4186:05dd0ed58262 | 4187:26dccfc8fa60 |
---|---|
74 | 74 |
75 #ifdef DEBUG_XEMACS | 75 #ifdef DEBUG_XEMACS |
76 Fixnum debug_x_faces; | 76 Fixnum debug_x_faces; |
77 #endif | 77 #endif |
78 | 78 |
79 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901) | 79 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901) |
80 | 80 |
81 #ifdef DEBUG_XEMACS | 81 #ifdef DEBUG_XEMACS |
82 # define DEBUG_FACES(FORMAT, ...) \ | 82 # define DEBUG_FACES(FORMAT, ...) \ |
83 do { if (debug_x_faces) stderr_out(FORMAT, __VA_ARGS__); } while (0) | 83 do { if (debug_x_faces) stderr_out(FORMAT, __VA_ARGS__); } while (0) |
84 #else /* DEBUG_XEMACS */ | 84 #else /* DEBUG_XEMACS */ |
585 Lisp_Object retval; | 585 Lisp_Object retval; |
586 Lisp_Object matchspec = Qunbound; | 586 Lisp_Object matchspec = Qunbound; |
587 struct gcpro gcpro1; | 587 struct gcpro gcpro1; |
588 | 588 |
589 if (!NILP (charset)) | 589 if (!NILP (charset)) |
590 matchspec = noseeum_cons (charset, | 590 matchspec = noseeum_cons (charset, |
591 stage == initial ? Qinitial : Qfinal); | 591 stage == initial ? Qinitial : Qfinal); |
592 | 592 |
593 GCPRO1 (matchspec); | 593 GCPRO1 (matchspec); |
594 retval = specifier_instance_no_quit (Fget (face, property, Qnil), matchspec, | 594 retval = specifier_instance_no_quit (Fget (face, property, Qnil), matchspec, |
595 domain, errb, no_fallback, depth); | 595 domain, errb, no_fallback, depth); |
723 struct window *w = NULL; | 723 struct window *w = NULL; |
724 | 724 |
725 if (noninteractive) | 725 if (noninteractive) |
726 { | 726 { |
727 if (ascent) | 727 if (ascent) |
728 *ascent = 1; | 728 *ascent = 1; |
729 if (descent) | 729 if (descent) |
730 *descent = 0; | 730 *descent = 0; |
731 if (height) | 731 if (height) |
732 *height = 1; | 732 *height = 1; |
733 if (width) | 733 if (width) |
734 *width = 1; | 734 *width = 1; |
735 if (proportional_p) | 735 if (proportional_p) |
736 *proportional_p = 0; | 736 *proportional_p = 0; |
737 return; | 737 return; |
738 } | 738 } |
739 | 739 |
740 /* We use ASCII here. This is reasonable because the people calling this | 740 /* We use ASCII here. This is reasonable because the people calling this |
741 function are using the resulting values to come up with overall sizes | 741 function are using the resulting values to come up with overall sizes |
742 for windows and frames. | 742 for windows and frames. |
743 | 743 |
744 It's possible for this function to get called when the face cachels | 744 It's possible for this function to get called when the face cachels |
745 have not been initialized--put a call to debug-print in | 745 have not been initialized--put a call to debug-print in |
746 init-locale-at-early-startup to see it happen. */ | 746 init-locale-at-early-startup to see it happen. */ |
747 | 747 |
748 if (WINDOWP (domain) && (w = XWINDOW (domain)) && w->face_cachels) | 748 if (WINDOWP (domain) && (w = XWINDOW (domain)) && w->face_cachels) |
749 { | 749 { |
750 if (!Dynarr_length (w->face_cachels)) | 750 if (!Dynarr_length (w->face_cachels)) |
751 reset_face_cachels (w); | 751 reset_face_cachels (w); |
752 cachel = WINDOW_FACE_CACHEL (w, DEFAULT_INDEX); | 752 cachel = WINDOW_FACE_CACHEL (w, DEFAULT_INDEX); |
753 font_instance = FACE_CACHEL_FONT (cachel, Vcharset_ascii); | 753 font_instance = FACE_CACHEL_FONT (cachel, Vcharset_ascii); |
754 } | 754 } |
755 else | 755 else |
756 { | 756 { |
954 { | 954 { |
955 Lisp_Object tframe = wrap_frame (frm); | 955 Lisp_Object tframe = wrap_frame (frm); |
956 | 956 |
957 | 957 |
958 /* DO NOT change the selected frame here. If the debugger goes off | 958 /* DO NOT change the selected frame here. If the debugger goes off |
959 it will try and display on the frame being created, but it is not | 959 it will try and display on the frame being created, but it is not |
960 ready for that yet and a horrible death will occur. Any random | 960 ready for that yet and a horrible death will occur. Any random |
961 code depending on the selected-frame as an implicit arg should be | 961 code depending on the selected-frame as an implicit arg should be |
962 tracked down and shot. For the benefit of the one known, | 962 tracked down and shot. For the benefit of the one known, |
963 xpm-color-symbols, make-frame sets the variable | 963 xpm-color-symbols, make-frame sets the variable |
964 Vframe_being_created to the frame it is making and sets it to nil | 964 Vframe_being_created to the frame it is making and sets it to nil |
965 when done. Internal functions that this could trigger which are | 965 when done. Internal functions that this could trigger which are |
966 currently depending on selected-frame should use this instead. It | 966 currently depending on selected-frame should use this instead. It |
967 is not currently visible at the lisp level. */ | 967 is not currently visible at the lisp level. */ |
968 call_critical_lisp_code (XDEVICE (FRAME_DEVICE (frm)), | 968 call_critical_lisp_code (XDEVICE (FRAME_DEVICE (frm)), |
969 Qinit_frame_faces, tframe); | 969 Qinit_frame_faces, tframe); |
970 } | 970 } |
971 } | 971 } |
972 | 972 |
1092 Lisp_Object new_val; | 1092 Lisp_Object new_val; |
1093 Lisp_Object face = cachel->face; | 1093 Lisp_Object face = cachel->face; |
1094 int bound = 1, final_stage = 0; | 1094 int bound = 1, final_stage = 0; |
1095 int offs = XCHARSET_LEADING_BYTE (charset) - MIN_LEADING_BYTE; | 1095 int offs = XCHARSET_LEADING_BYTE (charset) - MIN_LEADING_BYTE; |
1096 | 1096 |
1097 if (!UNBOUNDP (cachel->font[offs]) && | 1097 if (!UNBOUNDP (cachel->font[offs]) && |
1098 bit_vector_bit(FACE_CACHEL_FONT_UPDATED (cachel), offs)) | 1098 bit_vector_bit(FACE_CACHEL_FONT_UPDATED (cachel), offs)) |
1099 return cachel->font[offs]; | 1099 return cachel->font[offs]; |
1100 | 1100 |
1101 if (UNBOUNDP (face)) | 1101 if (UNBOUNDP (face)) |
1102 { | 1102 { |
1119 if (bit_vector_bit(FACE_CACHEL_FONT_SPECIFIED(oth), offs)) | 1119 if (bit_vector_bit(FACE_CACHEL_FONT_SPECIFIED(oth), offs)) |
1120 { | 1120 { |
1121 new_val = oth->font[offs]; | 1121 new_val = oth->font[offs]; |
1122 set_bit_vector_bit(FACE_CACHEL_FONT_SPECIFIED(cachel), offs, 1); | 1122 set_bit_vector_bit(FACE_CACHEL_FONT_SPECIFIED(cachel), offs, 1); |
1123 set_bit_vector_bit | 1123 set_bit_vector_bit |
1124 (FACE_CACHEL_FONT_FINAL_STAGE(cachel), offs, | 1124 (FACE_CACHEL_FONT_FINAL_STAGE(cachel), offs, |
1125 bit_vector_bit(FACE_CACHEL_FONT_FINAL_STAGE(oth), offs)); | 1125 bit_vector_bit(FACE_CACHEL_FONT_FINAL_STAGE(oth), offs)); |
1126 break; | 1126 break; |
1127 } | 1127 } |
1128 } | 1128 } |
1129 | 1129 |
1135 ensure_face_cachel_contains_charset (oth, domain, charset); | 1135 ensure_face_cachel_contains_charset (oth, domain, charset); |
1136 | 1136 |
1137 new_val = oth->font[offs]; | 1137 new_val = oth->font[offs]; |
1138 } | 1138 } |
1139 | 1139 |
1140 if (!UNBOUNDP (cachel->font[offs]) && | 1140 if (!UNBOUNDP (cachel->font[offs]) && |
1141 !EQ (cachel->font[offs], new_val)) | 1141 !EQ (cachel->font[offs], new_val)) |
1142 cachel->dirty = 1; | 1142 cachel->dirty = 1; |
1143 set_bit_vector_bit(FACE_CACHEL_FONT_UPDATED(cachel), offs, 1); | 1143 set_bit_vector_bit(FACE_CACHEL_FONT_UPDATED(cachel), offs, 1); |
1144 cachel->font[offs] = new_val; | 1144 cachel->font[offs] = new_val; |
1145 DEBUG_FACES("just recursed on the unbound face, returning " | 1145 DEBUG_FACES("just recursed on the unbound face, returning " |
1156 /* ERROR_ME_DEBUG_WARN is | 1156 /* ERROR_ME_DEBUG_WARN is |
1157 fine here. */ | 1157 fine here. */ |
1158 ERROR_ME_DEBUG_WARN, 1, Qzero, | 1158 ERROR_ME_DEBUG_WARN, 1, Qzero, |
1159 initial); | 1159 initial); |
1160 DEBUG_FACES("just called f_p_m_i on face %s, charset %s, initial, " | 1160 DEBUG_FACES("just called f_p_m_i on face %s, charset %s, initial, " |
1161 "result was something %s\n", | 1161 "result was something %s\n", |
1162 XSTRING_DATA(XSYMBOL_NAME(XFACE(cachel->face)->name)), | 1162 XSTRING_DATA(XSYMBOL_NAME(XFACE(cachel->face)->name)), |
1163 XSTRING_DATA(XSYMBOL_NAME(XCHARSET_NAME(charset))), | 1163 XSTRING_DATA(XSYMBOL_NAME(XCHARSET_NAME(charset))), |
1164 UNBOUNDP(new_val) ? "not bound" : "bound"); | 1164 UNBOUNDP(new_val) ? "not bound" : "bound"); |
1165 | 1165 |
1166 if (!UNBOUNDP (new_val)) break; | 1166 if (!UNBOUNDP (new_val)) break; |
1167 | 1167 |
1171 which is preferable to translating to ISO10646-1 and using the | 1171 which is preferable to translating to ISO10646-1 and using the |
1172 fixed-width fallback. */ | 1172 fixed-width fallback. */ |
1173 new_val = face_property_matching_instance (face, Qfont, | 1173 new_val = face_property_matching_instance (face, Qfont, |
1174 charset, domain, | 1174 charset, domain, |
1175 ERROR_ME_DEBUG_WARN, 0, | 1175 ERROR_ME_DEBUG_WARN, 0, |
1176 Qzero, | 1176 Qzero, |
1177 initial); | 1177 initial); |
1178 | 1178 |
1179 DEBUG_FACES("just called f_p_m_i on face %s, charset %s, initial, " | 1179 DEBUG_FACES("just called f_p_m_i on face %s, charset %s, initial, " |
1180 "allow fallback, result was something %s\n", | 1180 "allow fallback, result was something %s\n", |
1181 XSTRING_DATA(XSYMBOL_NAME(XFACE(cachel->face)->name)), | 1181 XSTRING_DATA(XSYMBOL_NAME(XFACE(cachel->face)->name)), |
1182 XSTRING_DATA(XSYMBOL_NAME(XCHARSET_NAME(charset))), | 1182 XSTRING_DATA(XSYMBOL_NAME(XCHARSET_NAME(charset))), |
1183 UNBOUNDP(new_val) ? "not bound" : "bound"); | 1183 UNBOUNDP(new_val) ? "not bound" : "bound"); |
1184 | 1184 |
1185 if (!UNBOUNDP(new_val)) | 1185 if (!UNBOUNDP(new_val)) |
1186 { | 1186 { |
1190 bound = 1; | 1190 bound = 1; |
1191 /* Try the face itself with the final-stage specifiers. */ | 1191 /* Try the face itself with the final-stage specifiers. */ |
1192 new_val = face_property_matching_instance (face, Qfont, | 1192 new_val = face_property_matching_instance (face, Qfont, |
1193 charset, domain, | 1193 charset, domain, |
1194 ERROR_ME_DEBUG_WARN, 1, | 1194 ERROR_ME_DEBUG_WARN, 1, |
1195 Qzero, | 1195 Qzero, |
1196 final); | 1196 final); |
1197 | 1197 |
1198 DEBUG_FACES("just called f_p_m_i on face %s, charset %s, final, " | 1198 DEBUG_FACES("just called f_p_m_i on face %s, charset %s, final, " |
1199 "result was something %s\n", | 1199 "result was something %s\n", |
1200 XSTRING_DATA(XSYMBOL_NAME(XFACE(cachel->face)->name)), | 1200 XSTRING_DATA(XSYMBOL_NAME(XFACE(cachel->face)->name)), |
1201 XSTRING_DATA(XSYMBOL_NAME(XCHARSET_NAME(charset))), | 1201 XSTRING_DATA(XSYMBOL_NAME(XCHARSET_NAME(charset))), |
1202 UNBOUNDP(new_val) ? "not bound" : "bound"); | 1202 UNBOUNDP(new_val) ? "not bound" : "bound"); |
1203 /* Tell X11 redisplay that it should translate to iso10646-1. */ | 1203 /* Tell X11 redisplay that it should translate to iso10646-1. */ |
1204 if (!UNBOUNDP(new_val)) | 1204 if (!UNBOUNDP(new_val)) |
1205 { | 1205 { |
1212 /* Lookup the face again, this time both allowing the fallback and | 1212 /* Lookup the face again, this time both allowing the fallback and |
1213 allowing its final stage to be used. */ | 1213 allowing its final stage to be used. */ |
1214 new_val = face_property_matching_instance (face, Qfont, | 1214 new_val = face_property_matching_instance (face, Qfont, |
1215 charset, domain, | 1215 charset, domain, |
1216 ERROR_ME_DEBUG_WARN, 0, | 1216 ERROR_ME_DEBUG_WARN, 0, |
1217 Qzero, | 1217 Qzero, |
1218 final); | 1218 final); |
1219 | 1219 |
1220 DEBUG_FACES("just called f_p_m_i on face %s, charset %s, initial, " | 1220 DEBUG_FACES("just called f_p_m_i on face %s, charset %s, initial, " |
1221 "allow fallback, result was something %s\n", | 1221 "allow fallback, result was something %s\n", |
1222 XSTRING_DATA(XSYMBOL_NAME(XFACE(cachel->face)->name)), | 1222 XSTRING_DATA(XSYMBOL_NAME(XFACE(cachel->face)->name)), |
1223 XSTRING_DATA(XSYMBOL_NAME(XCHARSET_NAME(charset))), | 1223 XSTRING_DATA(XSYMBOL_NAME(XCHARSET_NAME(charset))), |
1224 UNBOUNDP(new_val) ? "not bound" : "bound"); | 1224 UNBOUNDP(new_val) ? "not bound" : "bound"); |
1225 if (!UNBOUNDP(new_val)) | 1225 if (!UNBOUNDP(new_val)) |
1226 { | 1226 { |
1227 /* Tell X11 redisplay that it should translate to iso10646-1. */ | 1227 /* Tell X11 redisplay that it should translate to iso10646-1. */ |
1234 cachel->dirty = 1; | 1234 cachel->dirty = 1; |
1235 | 1235 |
1236 set_bit_vector_bit(FACE_CACHEL_FONT_UPDATED(cachel), offs, 1); | 1236 set_bit_vector_bit(FACE_CACHEL_FONT_UPDATED(cachel), offs, 1); |
1237 set_bit_vector_bit(FACE_CACHEL_FONT_FINAL_STAGE(cachel), offs, | 1237 set_bit_vector_bit(FACE_CACHEL_FONT_FINAL_STAGE(cachel), offs, |
1238 final_stage); | 1238 final_stage); |
1239 set_bit_vector_bit(FACE_CACHEL_FONT_SPECIFIED(cachel), offs, | 1239 set_bit_vector_bit(FACE_CACHEL_FONT_SPECIFIED(cachel), offs, |
1240 (bound || EQ (face, Vdefault_face))); | 1240 (bound || EQ (face, Vdefault_face))); |
1241 cachel->font[offs] = new_val; | 1241 cachel->font[offs] = new_val; |
1242 return new_val; | 1242 return new_val; |
1243 } | 1243 } |
1244 | 1244 |
1377 { | 1377 { |
1378 int default_face = EQ (face, Vdefault_face); | 1378 int default_face = EQ (face, Vdefault_face); |
1379 cachel->face = face; | 1379 cachel->face = face; |
1380 | 1380 |
1381 /* We normally only set the _specified flags if the value was | 1381 /* We normally only set the _specified flags if the value was |
1382 actually bound. The exception is for the default face where | 1382 actually bound. The exception is for the default face where |
1383 we always set it since it is the ultimate fallback. */ | 1383 we always set it since it is the ultimate fallback. */ |
1384 | 1384 |
1385 FROB (foreground); | 1385 FROB (foreground); |
1386 FROB (background); | 1386 FROB (background); |
1387 FROB (display_table); | 1387 FROB (display_table); |
1388 | 1388 |
1507 { | 1507 { |
1508 cachel->font[offs] = FINDEX_FIELD (font[offs]); | 1508 cachel->font[offs] = FINDEX_FIELD (font[offs]); |
1509 set_bit_vector_bit(FACE_CACHEL_FONT_SPECIFIED(cachel), offs, 1); | 1509 set_bit_vector_bit(FACE_CACHEL_FONT_SPECIFIED(cachel), offs, 1); |
1510 /* Also propagate whether we're translating to Unicode for the | 1510 /* Also propagate whether we're translating to Unicode for the |
1511 given face. */ | 1511 given face. */ |
1512 set_bit_vector_bit(FACE_CACHEL_FONT_FINAL_STAGE(cachel), offs, | 1512 set_bit_vector_bit(FACE_CACHEL_FONT_FINAL_STAGE(cachel), offs, |
1513 bit_vector_bit(FACE_CACHEL_FONT_FINAL_STAGE | 1513 bit_vector_bit(FACE_CACHEL_FONT_FINAL_STAGE |
1514 (Dynarr_atp(w->face_cachels, | 1514 (Dynarr_atp(w->face_cachels, |
1515 findex)), offs)); | 1515 findex)), offs)); |
1516 cachel->dirty = 1; | 1516 cachel->dirty = 1; |
1517 } | 1517 } |
1590 struct face_cachel *cachel = Dynarr_atp (w->face_cachels, i); | 1590 struct face_cachel *cachel = Dynarr_atp (w->face_cachels, i); |
1591 if (cachel->merged_faces) | 1591 if (cachel->merged_faces) |
1592 Dynarr_free (cachel->merged_faces); | 1592 Dynarr_free (cachel->merged_faces); |
1593 } | 1593 } |
1594 Dynarr_reset (w->face_cachels); | 1594 Dynarr_reset (w->face_cachels); |
1595 /* #### NOTE: be careful with the order ! | |
1596 The cpp macros DEFAULT_INDEX and MODELINE_INDEX defined in | |
1597 redisplay.h depend on the code below, which is really clumsy. | |
1598 -- dvl */ | |
1595 get_builtin_face_cache_index (w, Vdefault_face); | 1599 get_builtin_face_cache_index (w, Vdefault_face); |
1596 get_builtin_face_cache_index (w, Vmodeline_face); | 1600 get_builtin_face_cache_index (w, Vmodeline_face); |
1597 XFRAME (w->frame)->window_face_cache_reset = 1; | 1601 XFRAME (w->frame)->window_face_cache_reset = 1; |
1598 } | 1602 } |
1599 } | 1603 } |
1616 for (elt = 0; elt < Dynarr_length (w->face_cachels); elt++) | 1620 for (elt = 0; elt < Dynarr_length (w->face_cachels); elt++) |
1617 { | 1621 { |
1618 struct face_cachel *cachel = Dynarr_atp (w->face_cachels, elt); | 1622 struct face_cachel *cachel = Dynarr_atp (w->face_cachels, elt); |
1619 | 1623 |
1620 cachel->updated = 0; | 1624 cachel->updated = 0; |
1621 memset(FACE_CACHEL_FONT_UPDATED(cachel)->bits, 0, | 1625 memset(FACE_CACHEL_FONT_UPDATED(cachel)->bits, 0, |
1622 BIT_VECTOR_LONG_STORAGE (NUM_LEADING_BYTES)); | 1626 BIT_VECTOR_LONG_STORAGE (NUM_LEADING_BYTES)); |
1623 } | 1627 } |
1624 } | 1628 } |
1625 | 1629 |
1626 #ifdef MEMORY_USAGE_STATS | 1630 #ifdef MEMORY_USAGE_STATS |
1985 fold = XFACE (old_face); | 1989 fold = XFACE (old_face); |
1986 fnew = XFACE (new_face); | 1990 fnew = XFACE (new_face); |
1987 | 1991 |
1988 #define COPY_PROPERTY(property) \ | 1992 #define COPY_PROPERTY(property) \ |
1989 Fcopy_specifier (fold->property, fnew->property, \ | 1993 Fcopy_specifier (fold->property, fnew->property, \ |
1990 locale, tag_set, exact_p, how_to_add); | 1994 locale, tag_set, exact_p, how_to_add); |
1991 | 1995 |
1992 COPY_PROPERTY (foreground); | 1996 COPY_PROPERTY (foreground); |
1993 COPY_PROPERTY (background); | 1997 COPY_PROPERTY (background); |
1994 COPY_PROPERTY (font); | 1998 COPY_PROPERTY (font); |
1995 COPY_PROPERTY (display_table); | 1999 COPY_PROPERTY (display_table); |
2011 | 2015 |
2012 #ifdef MULE | 2016 #ifdef MULE |
2013 | 2017 |
2014 Lisp_Object Qone_dimensional, Qtwo_dimensional, Qx_coverage_instantiator; | 2018 Lisp_Object Qone_dimensional, Qtwo_dimensional, Qx_coverage_instantiator; |
2015 | 2019 |
2016 DEFUN ("specifier-tag-one-dimensional-p", | 2020 DEFUN ("specifier-tag-one-dimensional-p", |
2017 Fspecifier_tag_one_dimensional_p, | 2021 Fspecifier_tag_one_dimensional_p, |
2018 2, 2, 0, /* | 2022 2, 2, 0, /* |
2019 Return non-nil if (charset-dimension CHARSET) is 1. | 2023 Return non-nil if (charset-dimension CHARSET) is 1. |
2020 | 2024 |
2021 Used by the X11 platform font code; see `define-specifier-tag'. You | 2025 Used by the X11 platform font code; see `define-specifier-tag'. You |
2022 shouldn't ever need to call this yourself. | 2026 shouldn't ever need to call this yourself. |
2025 { | 2029 { |
2026 CHECK_CHARSET(charset); | 2030 CHECK_CHARSET(charset); |
2027 return (1 == XCHARSET_DIMENSION(charset)) ? Qt : Qnil; | 2031 return (1 == XCHARSET_DIMENSION(charset)) ? Qt : Qnil; |
2028 } | 2032 } |
2029 | 2033 |
2030 DEFUN ("specifier-tag-two-dimensional-p", | 2034 DEFUN ("specifier-tag-two-dimensional-p", |
2031 Fspecifier_tag_two_dimensional_p, | 2035 Fspecifier_tag_two_dimensional_p, |
2032 2, 2, 0, /* | 2036 2, 2, 0, /* |
2033 Return non-nil if (charset-dimension CHARSET) is 2. | 2037 Return non-nil if (charset-dimension CHARSET) is 2. |
2034 | 2038 |
2035 Used by the X11 platform font code; see `define-specifier-tag'. You | 2039 Used by the X11 platform font code; see `define-specifier-tag'. You |
2036 shouldn't ever need to call this yourself. | 2040 shouldn't ever need to call this yourself. |
2039 { | 2043 { |
2040 CHECK_CHARSET(charset); | 2044 CHECK_CHARSET(charset); |
2041 return (2 == XCHARSET_DIMENSION(charset)) ? Qt : Qnil; | 2045 return (2 == XCHARSET_DIMENSION(charset)) ? Qt : Qnil; |
2042 } | 2046 } |
2043 | 2047 |
2044 DEFUN ("specifier-tag-final-stage-p", | 2048 DEFUN ("specifier-tag-final-stage-p", |
2045 Fspecifier_tag_final_stage_p, | 2049 Fspecifier_tag_final_stage_p, |
2046 2, 2, 0, /* | 2050 2, 2, 0, /* |
2047 Return non-nil if STAGE is 'final. | 2051 Return non-nil if STAGE is 'final. |
2048 | 2052 |
2049 Used by the X11 platform font code for giving fallbacks; see | 2053 Used by the X11 platform font code for giving fallbacks; see |
2050 `define-specifier-tag'. You shouldn't ever need to call this. | 2054 `define-specifier-tag'. You shouldn't ever need to call this. |
2051 */ | 2055 */ |
2052 (UNUSED(charset), stage)) | 2056 (UNUSED(charset), stage)) |
2053 { | 2057 { |
2054 return EQ(stage, Qfinal) ? Qt : Qnil; | 2058 return EQ(stage, Qfinal) ? Qt : Qnil; |
2055 } | 2059 } |
2056 | 2060 |
2057 DEFUN ("specifier-tag-initial-stage-p", | 2061 DEFUN ("specifier-tag-initial-stage-p", |
2058 Fspecifier_tag_initial_stage_p, | 2062 Fspecifier_tag_initial_stage_p, |
2059 2, 2, 0, /* | 2063 2, 2, 0, /* |
2060 Return non-nil if STAGE is 'initial. | 2064 Return non-nil if STAGE is 'initial. |
2061 | 2065 |
2062 Used by the X11 platform font code for giving fallbacks; see | 2066 Used by the X11 platform font code for giving fallbacks; see |
2063 `define-specifier-tag'. You shouldn't ever need to call this. | 2067 `define-specifier-tag'. You shouldn't ever need to call this. |
2064 */ | 2068 */ |
2065 (UNUSED(charset), stage)) | 2069 (UNUSED(charset), stage)) |
2066 { | 2070 { |
2067 return EQ(stage, Qinitial) ? Qt : Qnil; | 2071 return EQ(stage, Qinitial) ? Qt : Qnil; |
2068 } | 2072 } |
2069 | 2073 |
2070 DEFUN ("specifier-tag-encode-as-utf-8-p", | 2074 DEFUN ("specifier-tag-encode-as-utf-8-p", |
2071 Fspecifier_tag_encode_as_utf_8_p, | 2075 Fspecifier_tag_encode_as_utf_8_p, |
2072 2, 2, 0, /* | 2076 2, 2, 0, /* |
2073 Return t if and only if (charset-property CHARSET 'encode-as-utf-8)). | 2077 Return t if and only if (charset-property CHARSET 'encode-as-utf-8)). |
2074 | 2078 |
2075 Used by the X11 platform font code; see `define-specifier-tag'. You | 2079 Used by the X11 platform font code; see `define-specifier-tag'. You |
2076 shouldn't ever need to call this. | 2080 shouldn't ever need to call this. |
2269 | 2273 |
2270 /* Note that fontconfig can search for several font families in one | 2274 /* Note that fontconfig can search for several font families in one |
2271 call. We should use this facility. */ | 2275 call. We should use this facility. */ |
2272 "Monospace-12", | 2276 "Monospace-12", |
2273 /* do we need to worry about non-Latin characters for monospace? | 2277 /* do we need to worry about non-Latin characters for monospace? |
2274 No, at least in Debian's implementation of Xft. | 2278 No, at least in Debian's implementation of Xft. |
2275 We should recommend that "gothic" and "mincho" aliases be created? */ | 2279 We should recommend that "gothic" and "mincho" aliases be created? */ |
2276 "Sazanami Mincho-12", | 2280 "Sazanami Mincho-12", |
2277 /* Japanese #### add encoding info? */ | 2281 /* Japanese #### add encoding info? */ |
2278 /* Arphic for Chinese? */ | 2282 /* Arphic for Chinese? */ |
2279 /* Korean */ | 2283 /* Korean */ |
2280 #else | 2284 #else |
2281 /* The default Japanese fonts installed with XFree86 4.0 use this | 2285 /* The default Japanese fonts installed with XFree86 4.0 use this |
2282 point size, and the -misc-fixed fonts (which look really bad with | 2286 point size, and the -misc-fixed fonts (which look really bad with |
2283 Han characters) don't. We need to prefer the former. */ | 2287 Han characters) don't. We need to prefer the former. */ |
2284 "-*-*-medium-r-*-*-*-150-*-*-c-*-*-*", | 2288 "-*-*-medium-r-*-*-*-150-*-*-c-*-*-*", |
2300 intern ("specifier-tag-two-dimensional-p")); | 2304 intern ("specifier-tag-two-dimensional-p")); |
2301 | 2305 |
2302 define_specifier_tag(Qone_dimensional, Qnil, | 2306 define_specifier_tag(Qone_dimensional, Qnil, |
2303 intern ("specifier-tag-one-dimensional-p")); | 2307 intern ("specifier-tag-one-dimensional-p")); |
2304 | 2308 |
2305 define_specifier_tag(Qinitial, Qnil, | 2309 define_specifier_tag(Qinitial, Qnil, |
2306 intern ("specifier-tag-initial-stage-p")); | 2310 intern ("specifier-tag-initial-stage-p")); |
2307 | 2311 |
2308 define_specifier_tag(Qfinal, Qnil, | 2312 define_specifier_tag(Qfinal, Qnil, |
2309 intern ("specifier-tag-final-stage-p")); | 2313 intern ("specifier-tag-final-stage-p")); |
2310 | 2314 |
2311 define_specifier_tag (Qencode_as_utf_8, Qnil, | 2315 define_specifier_tag (Qencode_as_utf_8, Qnil, |
2312 intern("specifier-tag-encode-as-utf-8-p")); | 2316 intern("specifier-tag-encode-as-utf-8-p")); |
2313 | 2317 |
2325 build_string (*fontptr)), | 2329 build_string (*fontptr)), |
2326 inst_list); | 2330 inst_list); |
2327 | 2331 |
2328 #else /* !USE_XFT */ | 2332 #else /* !USE_XFT */ |
2329 inst_list = | 2333 inst_list = |
2330 Fcons | 2334 Fcons |
2331 (Fcons | 2335 (Fcons |
2332 (list1 (device_symbol), | 2336 (list1 (device_symbol), |
2333 build_string ("*")), | 2337 build_string ("*")), |
2334 inst_list); | 2338 inst_list); |
2335 #ifdef MULE | 2339 #ifdef MULE |
2336 | 2340 |
2337 /* For Han characters and Ethiopic, we want the misc-fixed font used to | 2341 /* For Han characters and Ethiopic, we want the misc-fixed font used to |
2338 be distinct from that for alphabetic scripts, because the font | 2342 be distinct from that for alphabetic scripts, because the font |
2339 specified below is distractingly ugly when used for Han characters | 2343 specified below is distractingly ugly when used for Han characters |
2340 (this is slightly less so) and because its coverage isn't up to | 2344 (this is slightly less so) and because its coverage isn't up to |
2341 handling them (well, chiefly, it's not up to handling Ethiopic--we do | 2345 handling them (well, chiefly, it's not up to handling Ethiopic--we do |
2342 have charset-specific fallbacks for the East Asian charsets.) */ | 2346 have charset-specific fallbacks for the East Asian charsets.) */ |
2343 inst_list = | 2347 inst_list = |
2344 Fcons | 2348 Fcons |
2345 (Fcons | 2349 (Fcons |
2346 (list4(device_symbol, Qtwo_dimensional, Qfinal, Qx_coverage_instantiator), | 2350 (list4(device_symbol, Qtwo_dimensional, Qfinal, Qx_coverage_instantiator), |
2347 build_string | 2351 build_string |
2348 ("-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso10646-1")), | 2352 ("-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso10646-1")), |
2349 inst_list); | 2353 inst_list); |
2350 | 2354 |
2351 /* Use Markus Kuhn's version of misc-fixed as the font for the font for | 2355 /* Use Markus Kuhn's version of misc-fixed as the font for the font for |
2352 when a given charset's registries can't be found and redisplay for | 2356 when a given charset's registries can't be found and redisplay for |
2353 that charset falls back to iso10646-1. */ | 2357 that charset falls back to iso10646-1. */ |
2354 | 2358 |
2355 inst_list = | 2359 inst_list = |
2356 Fcons | 2360 Fcons |
2357 (Fcons | 2361 (Fcons |
2358 (list4(device_symbol, Qone_dimensional, Qfinal, Qx_coverage_instantiator), | 2362 (list4(device_symbol, Qone_dimensional, Qfinal, Qx_coverage_instantiator), |
2359 build_string | 2363 build_string |
2360 ("-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1")), | 2364 ("-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1")), |
2361 inst_list); | 2365 inst_list); |
2362 | 2366 |
2363 for (fontptr = fonts + countof(fonts) - 1; fontptr >= fonts; fontptr--) | 2367 for (fontptr = fonts + countof(fonts) - 1; fontptr >= fonts; fontptr--) |
2364 inst_list = Fcons (Fcons (list3 (device_symbol, | 2368 inst_list = Fcons (Fcons (list3 (device_symbol, |
2365 Qtwo_dimensional, Qinitial), | 2369 Qtwo_dimensional, Qinitial), |
2366 build_string (*fontptr)), | 2370 build_string (*fontptr)), |
2367 inst_list); | 2371 inst_list); |
2368 | 2372 |
2369 /* We need to set the font for the JIT-ucs-charsets separately from the | 2373 /* We need to set the font for the JIT-ucs-charsets separately from the |
2370 final stage, since otherwise it picks up the two-dimensional | 2374 final stage, since otherwise it picks up the two-dimensional |
2371 specification (see specifier-tag-two-dimensional-initial-stage-p | 2375 specification (see specifier-tag-two-dimensional-initial-stage-p |
2372 above). They also use Markus Kuhn's ISO 10646-1 fixed fonts for | 2376 above). They also use Markus Kuhn's ISO 10646-1 fixed fonts for |
2373 redisplay. */ | 2377 redisplay. */ |
2374 | 2378 |
2375 inst_list = | 2379 inst_list = |
2376 Fcons | 2380 Fcons |
2377 (Fcons | 2381 (Fcons |
2378 (list4(device_symbol, Qencode_as_utf_8, Qinitial, Qx_coverage_instantiator), | 2382 (list4(device_symbol, Qencode_as_utf_8, Qinitial, Qx_coverage_instantiator), |
2379 build_string | 2383 build_string |
2380 ("-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1")), | 2384 ("-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1")), |
2381 inst_list); | 2385 inst_list); |
2382 | 2386 |
2383 #endif /* MULE */ | 2387 #endif /* MULE */ |
2384 | 2388 |
2385 /* Needed to make sure that charsets with non-specified fonts don't | 2389 /* Needed to make sure that charsets with non-specified fonts don't |
2386 use bold and oblique first if medium and regular are available. */ | 2390 use bold and oblique first if medium and regular are available. */ |
2387 inst_list = | 2391 inst_list = |
2388 Fcons | 2392 Fcons |
2389 (Fcons | 2393 (Fcons |
2390 (list1 (device_symbol), | 2394 (list1 (device_symbol), |
2391 build_string ("-*-*-medium-r-*-*-*-120-*-*-c-*-*-*")), | 2395 build_string ("-*-*-medium-r-*-*-*-120-*-*-c-*-*-*")), |
2392 inst_list); | 2396 inst_list); |
2393 | 2397 |
2394 /* With a Cygwin XFree86 install, this returns the best (clearest, | 2398 /* With a Cygwin XFree86 install, this returns the best (clearest, |
2395 most readable) font I can find when scaling of bitmap fonts is | 2399 most readable) font I can find when scaling of bitmap fonts is |
2396 turned on, as it is by default. (WHO IN THE NAME OF CHRIST THOUGHT | 2400 turned on, as it is by default. (WHO IN THE NAME OF CHRIST THOUGHT |
2397 THAT WAS A GOOD IDEA?!?!) The other fonts that used to be specified | 2401 THAT WAS A GOOD IDEA?!?!) The other fonts that used to be specified |
2398 here gave horrendous results. */ | 2402 here gave horrendous results. */ |
2399 | 2403 |
2400 inst_list = | 2404 inst_list = |
2401 Fcons | 2405 Fcons |
2402 (Fcons | 2406 (Fcons |
2403 (list1 (device_symbol), | 2407 (list1 (device_symbol), |
2404 build_string ("-*-lucidatypewriter-medium-r-*-*-*-120-*-*-*-*-*-*")), | 2408 build_string ("-*-lucidatypewriter-medium-r-*-*-*-120-*-*-*-*-*-*")), |
2405 inst_list); | 2409 inst_list); |
2406 | 2410 |
2407 #endif /* !USE_XFT */ | 2411 #endif /* !USE_XFT */ |
2408 | 2412 |
2414 #endif /* HAVE_TTY */ | 2418 #endif /* HAVE_TTY */ |
2415 | 2419 |
2416 #ifdef HAVE_MS_WINDOWS | 2420 #ifdef HAVE_MS_WINDOWS |
2417 { | 2421 { |
2418 const Ascbyte *mswfonts[] = | 2422 const Ascbyte *mswfonts[] = |
2419 { | 2423 { |
2420 "Courier New:Regular:10::", | 2424 "Courier New:Regular:10::", |
2421 "Courier:Regular:10::", | 2425 "Courier:Regular:10::", |
2422 ":Regular:10::" | 2426 ":Regular:10::" |
2423 }; | 2427 }; |
2424 const Ascbyte **mswfontptr; | 2428 const Ascbyte **mswfontptr; |
2425 | 2429 |
2426 for (mswfontptr = mswfonts + countof (mswfonts) - 1; | 2430 for (mswfontptr = mswfonts + countof (mswfonts) - 1; |
2427 mswfontptr >= mswfonts; mswfontptr--) | 2431 mswfontptr >= mswfonts; mswfontptr--) |
2428 { | 2432 { |
2429 /* display device */ | 2433 /* display device */ |
2430 inst_list = Fcons (Fcons (list1 (Qmswindows), | 2434 inst_list = Fcons (Fcons (list1 (Qmswindows), |
2431 build_string (*mswfontptr)), | 2435 build_string (*mswfontptr)), |
2432 inst_list); | 2436 inst_list); |
2433 /* printer device */ | 2437 /* printer device */ |
2434 inst_list = Fcons (Fcons (list1 (Qmsprinter), | 2438 inst_list = Fcons (Fcons (list1 (Qmsprinter), |
2435 build_string (*mswfontptr)), | 2439 build_string (*mswfontptr)), |
2436 inst_list); | 2440 inst_list); |
2437 } | 2441 } |
2438 /* Use Lucida Console rather than Courier New if it exists -- the | 2442 /* Use Lucida Console rather than Courier New if it exists -- the |
2439 line spacing is much less, so many more lines fit with the same | 2443 line spacing is much less, so many more lines fit with the same |
2440 size font. (And it's specifically designed for screens.) */ | 2444 size font. (And it's specifically designed for screens.) */ |
2441 inst_list = Fcons (Fcons (list1 (Qmswindows), | 2445 inst_list = Fcons (Fcons (list1 (Qmswindows), |
2442 build_string ("Lucida Console:Regular:10::")), | 2446 build_string ("Lucida Console:Regular:10::")), |
2443 inst_list); | 2447 inst_list); |
2444 } | 2448 } |
2445 #endif /* HAVE_MS_WINDOWS */ | 2449 #endif /* HAVE_MS_WINDOWS */ |