1 2005-08-24 Kenichi Handa <handa@m17n.org>
3 * m17n-gui.h (Mascent, Mdescent): Don't extern them.
5 * m17n-gui.c (null_device_open): Check Mresolution param and set
8 * m17n-gd.c (device_open): Check Mresolution param and set
11 * m17n-X.c (MWDevice): New member resy.
12 (xfont_open): Set ascent, descent, and max_advance members of
15 (device_open): Compare also screen_num to find a device. Set
16 device->resy and frame->dpi.
18 * internal-gui.h (MFrame): New member dpi.
20 * font.h (MRealizedFont): New member max_advance.
22 * font.c (xlfd_unparse_name): Handle the case of font->size < 0.
23 (mfont__init): Don't initialize Mascent, Mdescent.
24 (Mascent, Mdescent): Delete these variables.
25 (mfont_get_prop): Fix previous change. Check Mfont_ascent and
26 Mfont_descent instead of Mascent and Mdescent.
27 (mfont_put_prop): Allow negative size.
28 (mfont_find): Handle the case of spec->size < 0. Fix previous
30 (mfont_list): Handle the case of spec->size < 0.
31 (mfont_check): Likewise.
33 * font-ft.c (STRDUP_LOWER): Ignore the tailing spaces.
34 (fc_get_pattern): Handle the case of font->size < 0.
35 (ft_open): Set ascent, descent, and max_advance members of rfont.
36 (ft_find_metric): Improve rounding.
37 (mfont__ft_parse_name): If FC_PIXEL_SIZE is not available, set
40 * face.c (mface__realize): Handle the case of font->size < 0.
42 2005-08-22 Kenichi Handa <handa@m17n.org>
44 * coding.c (MConverterStatus): Change the member buf to union.
45 (mconv_buffer_converter): Add const to the arg buf.
46 (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
47 (mconv_decode): Adjusted for the change of MConverterStatus.
48 (mconv_encode_range): Likewise.
50 * m17n.h (mconv_buffer_converter): Prototype adjusted.
51 (mconv_decode_buffer, mconv_rebind_buffer): Likewise.
53 2005-08-20 Kenichi Handa <handa@m17n.org>
55 * m17n-gui.h (mfont_from_name): Prototype adjusted.
56 (Mspacing, Mascent, Mdescent, Mmax_advance): Extern them.
58 * m17n-X.c (xfont_open): Set members ascent, descent, and
62 * font-ft.c (ft_open): Set members ascent, descent, and max_advance
64 (mfont__ft_parse_name): Add const to the arg name.
66 * font.c (xlfd_parse_name): Add const to the arg name. Call
67 mfont__set_property instead of mfont_set_spec. Set font->spacing.
68 (xlfd_unparse_name): Handle spacing.
69 (mfont__init): Initialize new variables.
70 (mfont__id): Handle spacing.
71 (mfont__merge): Likewise.
72 (mfont__set_spec): This function deleted.
73 (mfont__parse_name_into_font): Add const to the arg name. Fix the
74 condition of calling mfont__ft_parse_name.
75 (Mspacing, Mascent, Mdescent, Mmax_advance): New variables.
76 (mfont_get_prop): Handle properties spacing, ascent, descent,
78 (mfont_find): Return a realized font.
79 (mfont_from_name): Add const to the arg name.
81 * font.h (enum MFontProperty): New member MFONT_SPACING.
82 (enum MFontSpacing): New enum.
83 (MFont): New members spacing and max_advance.
84 (mfont__ft_parse_name): Prototype adjusted.
85 (mfont__set_spec): Extern deleted.
86 (mfont__parse_name_into_font): Prototype adjusted.
88 2005-08-19 Kenichi Handa <handa@m17n.org>
90 * m17n-gui.h (mfont_parse_name): Prototype adjusted.
92 * font.c (mfont_list): If FONT is null, use a temporary font.
93 (mfont_parse_name): Add const to the arg name.
95 2005-08-18 Kenichi Handa <handa@m17n.org>
97 * word-thai.c: Surround code by #ifdef and #endif to escape from
100 * font-ft.c: Mostly re-written.
102 * font-flt.c (FontLayoutCmdOTF): This type deleted.
103 (FontLayoutCmd): Type of the member otf changed..
104 (load_otf_command): Adjusted for the format change of otf command.
105 (load_command): Likewise.
106 (free_flt_command): Unref cmd->body.otf.
107 (run_otf): Ajusted for the type change of otf_cmd.
108 (run_command): Ajusted for the type change of otf_cmd. On
109 debugging, print ctx->combining_code.
110 (mfont__flt_run): Initialize ctx's members code_offset,
111 combining_code, and left_padding to 0.
113 * face.h (struct MRealizedFace): New member font.
114 (mface__realize): Prototype adjusted.
116 * face.c (find_realized_face): New arg font.
117 (find_realized_face): Adjusted for the change of MFont.
118 (mface__init): Call M17N_OBJECT_ADD_ARRAY.
119 (mface__fini): Don't call mdebug__report_object.
120 (mface__realize): New arg font.
121 (mface__for_chars): Adjusted for the change of mfont__encode_char.
122 Optimize the latin case.
123 (mface__free_realized): Free rface->font.
124 (mface__update_frame_face): Adjusted for the change of mface__realize.
125 (mface_equal): New function.
127 * draw.c (Mcommon): New variable.
128 (visual_order): Args to mfont__encode_char changed.
129 (compose_glyph_string): Handle Mfont text property.
130 (layout_glyphs): Adjusted for the change of MFont.
131 (mdraw__init): Initialize Mcommon.
132 (mdraw_glyph_info): Adjusted for the change of MRealizedFont.
134 * font.h (enum MFontType): Members completely changed.
135 (enum MFontProperty): Move MFONT_SIZE to the tail.
136 (enum MFontSource): New enum.
137 (struct MFont): New members type, source, sizes, file, capability,
139 (struct MRealizedFont): Type of member font changed. Members
140 score, status, and encoding deleted.
141 (MFontScore): New type.
142 (MFontList): Member changed.
143 (struct MFontDriver): New member has_char. Types of members
145 (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
146 (Mapple_roman): Extern them.
147 (OTF_Tag): Typedefed if not HAVE_OTF.
148 (enum MFontOpenTypeTable): New enum.
149 (MFontCapability): New type.
150 (mfont__ft_drive_otf): Prototype adjusted.
151 (mfont__score): Extern deleted.
152 (mfont__merge): Extern it.
153 (mfont__has_char): Extern it.
154 (mfont__encode_char): Prototype adjusted.
155 (mfont__open): Extern it.
156 (mfont__set_spec): Prototype adjusted.
157 (mfont__get_capability): Extern it.
159 * font.c: Include "fontset.h".
160 (M_font_capability, M_font_list, M_font_list_len): New variables.
161 (font_score_priority): Change order of initial elements.
162 (font_score_shift_bits): Fix array size.
163 (common_weight): Add "thin", "semibold", and "heavy".
164 (common_stretch): Add "ultracondensed", "extracondensed",
165 "extraexpanded", and "utltraexpand".
166 (font_weight_regular, font_weight_normal, font_weight_medium): New
168 (gen_font_name): This function deleted.
169 (find_encoding): Set font->encoding.
170 (OTF_tag): New function.
171 (otf_script_list): New variable.
172 (load_otf_script_list): New function.
173 (find_script_from_otf_tag): New function.
174 (xlfd_parse_name): Set font->type and font->source.
175 (mfont__free_realized): Free chains rfonts.
176 (font_score): Renamed from mfont__score.
177 (Miso8859_1, Miso10646_1, Municode_bmp, Municode_full)
178 (Mapple_roman): New variables.
179 (mfont__init): Initilize new variables. Initalize
180 default_encoding.encoding_name and
181 default_encoding.encoding_charset to Municode_full and
182 mcharset__unicode. Use SAFE* macros for allocating filepath
184 (mfont__fini): Free otf_script_list.
185 (mfont__id): New function.
186 (mfont__match_p): Check also capability member of MFont.
187 (mfont__merge): New funciton.
188 (mfont__set_spec_from_face): Set type and source members.
189 (mfont__set_spec_from_plist): Set capability and type members.
190 (mfont__select): Argument changed.
191 (mfont__available): New function.
192 (compare_font_score): New function.
193 (mfont__list): New function.
194 (mfont__open): Return a realized font.
195 (mfont__resize): Adjusted for the change of MFont.
196 (mfont__has_char): New function.
197 (mfont__encode_char): Argument changed.
198 (mfont__set_spec): Argument changed.
199 (free_font_capability): New function.
200 (mfont__get_capability): New function.
201 (MFontfile): New variable.
202 (mfont_get_prop): Adjusted for the change of MFont.
203 (mfont_put_prop): Likewise.
204 (mfont_set_selection_priority): Fix the way of setting
205 font_score_priority[].
206 (mfont_find): Use mfont__list instead of mfont__select.
207 (mfont_resize_ratio): Adjusted for the change of MFont.
208 (mfont_list): Use mfont__list.
209 (mfont_check): New function.
210 (font_score): Make it static.
212 * fontset.h (mfont__realize_fontset): Prototype adjusted.
213 (mfont__lookup_fontset): Likewise.
215 * fontset.c (struct MFontset): Delete member font_spec_list.
216 (struct MRealizedFontset): Type of member spec changed. New
218 (load_font_group): Arg spec_list deleted.
219 (load_fontset_contents): Adjusted for the change of fontset_def.
220 (free_fontset): Fix the way of freeing fontset elements.
221 (realize_fontset_elements): Argument changed.
222 (get_per_script): New function.
223 (free_realized_fontset_elements): Fix the way of feeing rfontset
225 (update_fontset_elements): Fix args to realize_fontset_elements.
226 (mfont__realize_fontset): New arg spec.
227 (try_font_list): New function.
228 (try_font_group): New arg request. Use try_font_list.
229 (mfont__lookup_fontset): New arg ignore_fallback. Fix arg to
231 (mfontset): Adjusted for the change of MFontset.
232 (mfontset_copy): Likewise. Don't share plists.
233 (mfontset_modify_entry): Adjusted for the change of MFontset.
234 (mfontset_lookup): Call get_per_script.
235 (mdebug_dump_fontset): Print also the address of fonts.
237 * input.c (shift_state): Don't reset ic_info->vars.
238 (take_action_list): Call MDEBUG_PRINT fore calling
241 * internal-gui.h (MFontDriver): Don't typedef it here.
243 * m17n-X.c: Include <fontconfig/fcfreetype.h> if HAVE_XFT2.
244 (MXFont): This type deleted.
246 (struct _MFontX): New struct.
247 (SET_SIZE, HAVE_SIZE): Adjusted for the change of arg FONTX.
248 (MDisplayInfo): Member base_font_list deleted.
249 (DEFAULT_FONT): Definition changed.
250 (FALLBACK_FONT): This maclr deleted.
251 (free_display_info): Adjusted for the change of MDisplayInfo.
252 (free_device): Argument to mfont__free_realized changed.
253 (xfont_driver): Adjusted for the change of MFontDriver.
254 (xfont_registry_list): Use MFontX instead of MXFont.
255 (MRealizedFontX): Renamed from MXFontInfo.
256 (xfont_select): Return the font found first.
257 (close_xfont): Change MXFontInfo to MRealizedFontX.
258 (xfont_open): Return the realized font.
259 (xfont_find_metric): Get xfont from rfont->fontp.
260 (xfont_has_char): New function.
261 (xfont_encode_char): Adjusted for the argument change.
262 (xfont_render): Get xfont from rfont->fontp.
263 (xfont_list): Adjusted for the argument change.
264 (MRealizedFontXft): Renamed from MXftFontInfo.
265 (xft_driver): Ajusted for the change of MFontDriver.
266 (close_xft): Change MXtfFontInfo to MRealizedFontXft
267 (xft_open_font): Argument changed.
268 (xft_open): Argument changed. Return the realized font.
269 (xft_find_metric): Get xft_font from rfont->fontp.
270 (xft_has_char, xft_encode_char): New functions.
271 (xft_render): Change MXftFontInfo to MRealizedFontXft. Open a
272 font if not yet opened.
273 (device_open): Don't set frame->font.
275 * m17n-gd.c (gd_font_driver): Adjusted for the change of
277 (gd_font_open): New function.
278 (gd_render): Don't use the local variable ft_info.
279 (device_init): Adjusted for the change of gd_font_driver.
281 * textprop.c (mtext__prop_init): Initialize text_property_table.
282 Call M17N_OBJECT_ADD_ARRAY.
283 (mtext__prop_fini): Don't call mdebug__report_object.
285 * plist.c (mplist__init): Initialize plist_table.
286 (mplist__init): Call M17N_OBJECT_ADD_ARRAY.
287 (mplist__fini): Don't call mdebug__report_object.
289 * mtext.c (mtext__init): Call M17N_OBJECT_ADD_ARRAY.
290 (mtext__fini): Don't call mdebug__report_object.
291 (MTEXT_FORMAT_UTF_16): Correct type.
292 (mtext_data): New function.
293 (mtext_text): Fix calculation of limit and args to
296 * language.c: Include "plist.h".
297 (M_script_lang_list): New variable.
298 (mlang__init): Read languages and their information from m17n
300 (mlanguage__list): New function.
301 (Miso639_1, Miso639_2): New variables.
303 * language.h (mlanguage__list): Extern it.
305 * database.c (get_database_stream): Use SAFE_* macros for
306 allocating and freeing path.
307 (mdatabase__init): Likewise.
309 * symbol.c (msymbol__fini): Don't free symbols here.
310 (msymbol__free_table): New function.
311 (msymbol_is_managing_key): New function.
313 * symbol.h (msymbol__free_table): Extern it.
314 (msymbol__list): Extern it.
316 * internal.h (MFATAL, USE_SAFE_ALLOCA, SAFE_ALLOCA, SAFE_FREE):
318 (M17N_OBJECT_UNREF): Change "if ... else ..." structure.
319 (struct _M17NObjectArray): New member name and next.
320 (mdebug__add_object_array): Extern it.
321 (M17N_OBJECT_ADD_ARRAY): New macro.
322 (mdebug__report_object): Don't extern it.
324 * m17n-misc.h (enum MErrorCode): New element MERROR_FONT_X.
326 * m17n-gui.c (free_frame): Don't free frame->font.
327 (null_device_fini): Fix code for freeing
328 null_device.realized_font_list.
329 (m17n_fini_win): Free interface.
330 (mframe): Cast the return value of dlsym. Set frame->font here.
331 (mframe_get_prop): Check frame->rface->rfont before accessing the
334 * m17n-gui.h (Mfontfile): Extern it.
335 (mfont_check): Extern it.
336 (mface_equal): Extern it.
338 * m17n-core.c: Include "symbol.h".
339 (report_header_printed): This variable deleted.
340 (object_array_root): New variable.
341 (report_object_array): New function.
342 (mdebug__report_object): This function deleted.
343 (mdebug__add_object_array): New function.
344 (m17n_init_core): Call mchartable_init () before mtext_init ().
345 (m17n_fini_core): Call report_object_array (if necessary) and
346 msymbol__free_atable at the end.
348 * m17n-core.h (msymbol_is_managing_key): Extern it.
349 (mtext_data): Extern it.
350 (MTEXT_FORMAT_UTF_16): Correct type.
351 (M17NLIB_MINOR_VERSION): Changed to 3.
352 (M17NLIB_VERSION_NAME): Changed to "1.3.0".
354 * chartab.c (mchartable__init): Initalize chartable_table.count.
355 (mchartable__fini): Use N17N_OBJECT_ADD_ARRAY instead of
356 mdebug__report_object.
358 2005-05-26 Kenichi Handa <handa@m17n.org>
360 * m17n.h (Miso639_1, Miso639_2): Extern them.
362 * symbol.h (msymbol__list): Extern it.
364 * symbol.c (msymbol__list): New function.
366 2005-05-19 Kenichi Handa <handa@m17n.org>
368 * input-gui.c (minput__win_init): Don't change the value of
371 2005-05-16 Kenichi Handa <handa@m17n.org>
373 * m17n-core.c (m17n_object): Be sure to initialize all members.
375 * font-ft.c (fc_decode_prop): Fix args to msymbol.
377 2005-05-09 Kenichi Handa <handa@m17n.org>
379 * m17n-X.c (mwin__close_device): Fix arg to M17N_OBJECT_UNREF.
381 2005-04-27 Kenichi Handa <handa@m17n.org>
383 * language.c (mlang__init): Add "an" (Aragonese).
385 * word-thai.c: Add support for libthai.
386 (mtext__word_thai_init): Initialize wordseg library conditionaly.
387 (mtext__word_thai_fini): Finalize wordseg library conditionaly.
389 * mtext.c: Include "word-thai.h" conditionaly.
390 (mtext__init): Call mtext__word_thai_init conditionaly.
391 (mtext__fini): Call mtext__word_thai_fini conditionaly.
393 * Makefile.am (libm17n_core_la_LIBADD): Add THAI_WORDSEG_LD_FLAGS,
394 not WORDCUT_LD_FLAGS.
396 2005-04-19 Kenichi Handa <handa@m17n.org>
398 * word-thai.c (wordseg_propertize): Always unref the attached
400 (thai_wordseg): Don't unref the property.
402 2005-04-18 Kenichi Handa <handa@m17n.org>
404 * word-thai.c: Include stdlib.h.
405 (wordseg_propertize): Add dummy function for the case that wordcut
406 library doesn't exist.
407 (wordseg_propertize): Fix for old wordcut library.
409 2005-04-16 Kenichi Handa <handa@m17n.org>
411 * word-thai.c: Include <stdio.h>.
413 2005-04-15 Kenichi Handa <handa@m17n.org>
415 * draw.c: Include mtext.h.
416 (linebreak_table, M_break_at_space, M_break_at_word)
417 (M_break_at_any, M_kinsoku_bol, M_kinsoku_eol): New variables.
418 (compose_glyph_string): Check POS before getting Mface text
420 (truncate_gstring): Give correct TO arg to line_break function.
421 (GET_LB_TYPE): New macro.
422 (find_break_backward, find_break_forward): New functions.
423 (mdraw__init): Initialize the above new variables.
424 (mdraw__fini): Free linebreak_table.
425 (mdraw_default_line_break): Use find_break_backward and
428 * word-thai.c: New file.
430 * word-thai.h: New file.
432 * mtext.c: Include word-thai.h.
433 (wordseg_func_table): New variable.
434 (mtext__init): Initialize wordseg_func_table and call
435 mtext__word_thai_init.
436 (mtext__fini): Call mtext__word_thai_fini, free
438 (MTextWordsegFunc): New type.
439 (mtext__word_segment): New function.
441 * mtext.h (wordseg_func_table): Extern it.
442 (mtext__word_segment): Extern it.
444 * m17n.c (m17n_init): Fix typo (== -> =).
446 * Makefile.am (libm17n_core_la_SOURCES): Include word-thai.[ch].
447 (libm17n_core_la_LIBADD): Add @WORDCUT_LD_FLAGS@.
449 * textprop.h (MTEXTPROP_START, MTEXTPROP_END, MTEXTPROP_KEY)
450 (MTEXTPROP_VAL): New macros.
452 * input.c (DLOPEN_SHLIB_EXT): Don't define it.
454 2005-04-07 Kenichi Handa <handa@m17n.org>
456 * database.c (load_chartable): Fix pursing of symbol name.
458 2005-03-24 Kenichi Handa <handa@m17n.org>
460 * m17n.c (m17n_init): Fix typo (== -> =).
462 2005-03-11 Kenichi Handa <handa@m17n.org>
464 * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE at first.
466 * m17n.c (m17n_init): Set merror_code to MERROR_NONE at first.
468 * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE at
471 2005-03-09 handa <handa@m17n.org>
473 * m17n-gui.c (m17n_init_win): Set merror_code to MERROR_NONE before
474 calling m17n_init ().
476 * m17n.c (m17n_init): Set merror_code to MERROR_NONE before
477 calling m17n_init_core ().
479 2005-02-28 Kenichi Handa <handa@m17n.org>
481 * font-flt.c (mfont__flt_run): Add resulting code sequence in
484 2005-02-17 Kenichi Handa <handa@m17n.org>
486 * input.c: Include <sys/types.h>, <dirent.h>, and "database.h".
487 (M_description, M_command, M_variable): New variables.
488 (load_im_info_keys): New variables.
489 (load_im_info, check_command_keyseq, get_description_advance)
490 (parse_command_list, get_command_list, parse_variable_list)
491 (get_variable_list, input_method_hook): New functions.
492 (command_list, variable_list): New variables.
493 (minput__init): Put input_method_hook to Minput_method.
494 Initialize M_description, M_command, M_variable, Mdetail_text,
495 load_im_info_keys, command_list, variable_list.
496 (minput__fini): Unref command_list, variable_list, load_im_info_keys.
497 (Mdetail_text): New variable.
498 (minput_get_description, minput_get_commands)
499 (minput_assign_command_keys, minput_get_variables)
500 (minput_set_variable): New functions.
502 * m17n.h (Mdetail_text, minput_get_description, minput_get_commands)
503 (minput_assign_command_keys, minput_get_variables)
504 (minput_set_variable): Extern them.
506 * plist.c (UNGETC): Just decrement st->p.
507 (read_mtext_element): New arg skip.
508 (read_integer_element): Likewise.
509 (read_symbol_element): Likewise.
510 (read_element): New arg KEYS.
511 (mplist__from_plist): Don't increment ref-count of NULL object.
512 (mplist__from_file): New arg KEYS.
513 (mplist_put): Don't increment ref-count of NULL object.
514 (mplist_add): Likewise.
515 (mplist_push): Likewise.
516 (mplist_set): Likewise. Call M17N_OBJECT_UNREF unconditionally.
518 * plist.h (mplist__from_file): Prototype adjusted.
520 * database.c (mdatabase__dir_list): Renamed from mdb_dir_list.
521 (get_database_stream): New function.
522 (load_database): Use get_database_stream.
523 (M_database_hook): New variable
524 (mdatabase__init): Initialize M_database_hook.
525 (mdatabase__load_for_keys): New function.
526 (mdatabase_find, mdatabase_list, mdatabase_define): Check hook
528 (mdatabase_define): Free mdb->extra_info if necessary.
530 * database.h (mdatabase__dir_list, M_database_hook)
531 (mdatabase__load_for_keys): Extern them.
532 (MDatabaseHookFunc): New type.
534 * internal.h (M17N_OBJECT_UNREF): When freed, set OBJECT to NULL.
536 2004-12-27 Kenichi Handa <handa@m17n.org>
538 * Version 1.2.0 released.
540 2004-12-27 Kenichi Handa <handa@m17n.org>
542 * input.c (minput_filter): Don't reset ic->xxx_changed.
544 * mtext.c (mtext_from_data): Fix documentation.
546 2004-12-25 Kenichi Handa <handa@m17n.org>
548 * m17n-core.h (M17NLIB_MINOR_VERSION): Update to 2.
549 (M17NLIB_VERSION_NAME): Update to "1.2.".
551 2004-12-24 Kenichi Handa <handa@m17n.org>
553 * input.c (reset_ic): Set key_unhandled to 0.
555 2004-12-21 Kenichi Handa <handa@m17n.org>
557 * m17n-gui.h (mfont_from_spec): Delete extern.
559 * input-gui.c (win_callback): Handle Minput_reset.
560 (minput__win_init): Register reset_ic as a callback for
563 * input.c (reset_ic): New arg IGNORE which is ignored. Caller
564 changed. At first, shift to the initial state.
565 (minput__init): Initialize Minput_reset. Register reset_ic as a
566 callback for Minput_reset.
567 (Minput_reset): New variable.
568 (minput_filter): Always set ic->xxx_changed to 0.
569 (minput_reset_ic): New function.
570 (integer_value): Fix typo ('>' -> '<') and calculation of length
573 * m17n-core.c (merror_code): Change type to `int'.
575 * m17n-misc.h (merror_code): Adjust type.
577 * m17n.h (Minput_reset, minput_reset_ic): Extern them.
579 * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Adjust types.
580 (mtext_change_prop): Delete extern.
582 * mtext.c (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Change types
583 to `int'. Move the documents to m17n-core.h.
585 2004-12-13 Kenichi Handa <handa@m17n.org>
587 * m17n-core.h (m17n_object): Rename extern from m17n_object_setup.
588 (MTextProperty): Document it.
590 2004-12-09 Kenichi Handa <handa@m17n.org>
592 * m17n-core.h: Fix typo (MTextStatus -> M17NStatus).
594 2004-12-03 Kenichi Handa <handa@m17n.org>
596 * internal.h (m17n__core_initialized, m17n__shell_initialized,
597 m17n__gui_initialized): New externs.
599 * m17n-core.h (enum M17NStatus): New enum.
600 (m17n_status): Extern it.
602 * m17n-core.c (core_initialized): Delete this variable.
603 (m17n__core_initialized, m17n__shell_initialized,
604 m17n__gui_initialized): New variables.
605 (m17n_init_core, m17n_fini_core): Check m17n__core_initialized
606 instead of core_initialized.
607 (m17n_status): New function.
609 * m17n.c (shell_initialized): Delete this variable.
610 (m17n_init, m17n_fini): Check m17n__shell_initialized instead of
613 * m17n-gui.h (m17n_init_win): Adjust the prototype.
615 * m17n-gui.c (win_initialized): Delete this variable.
616 (m17n_init_win, m17n_fini_win): Check m17n__gui_initialized
617 instead of gui_initialized.
619 2004-11-19 Kenichi Handa <handa@m17n.org>
621 * input.c (reset_ic): Check if ic_info->state is NULL.
622 (filter): If ic_info->state is NULL, return 0.
623 (load_input_method): Don't unref `maps' it it's not created.
625 2004-11-15 Kenichi Handa <handa@m17n.org>
627 * input.c (find_candidates_group): If INDEX is -1, find the last
629 (take_action_list): If the previous of the first candidate is
630 requested, select the last candidate.
632 2004-11-08 Kenichi Handa <handa@m17n.org>
634 * m17n-X.c (device_open): Try at most 32 fonts to find a
637 * font.c (xlfd_parse_name): Fix previous change.
639 2004-11-05 Kenichi Handa <handa@m17n.org>
641 * font.c: (commont_style): Include dummy elements "slanted" and
642 "rslanted" to prefer "o" to "r" if "i" is requested.
644 * font-ft.c (ft_to_prop): Fix "oblique" entry.
646 2004-10-29 Kenichi Handa <handa@m17n.org>
648 * font.c (xlfd_parse_name): If avgwidth is 0, set the size to 0.
650 * m17n-X.c (MXFont): Change type of the member `sizes' to int.
651 New members smallest and larger.
652 (SET_SIZE, HAVE_SIZE): Adjusted for the above change.
653 (xfont_registry_list): Likewise.
654 (xfont_select): Likewise.
657 2004-10-28 Kenichi Handa <handa@m17n.org>
659 * m17n-X.c (xfont_registry_list): Include '-' before PIXEL_SIZE in
660 font name comparison.
661 (xfont_select): Fix logic for selecting a larger size font.
663 2004-10-25 Kenichi Handa <handa@m17n.org>
665 * input.c (take_action_list): Initialize `ret' to 0 for "=", "<",
668 2004-10-22 Kenichi Handa <handa@m17n.org>
670 * input.c (update_candidate): Renamed from udpate_candidate.
671 (take_action_list): Show more debugging info on arithmetic commands.
673 * m17n-X.c (device_open): Fix previous change.
675 * draw.c (compose_glyph_string): Don't get face property at the
678 2004-10-21 Kenichi Handa <handa@m17n.org>
680 * draw.c (compose_glyph_string): Fix for the case of category
683 2004-10-19 Kenichi Handa <handa@m17n.org>
685 * input.c (mdebug_mask): New variable.
686 (shift_state): Print debug information.
687 (take_action_list): Likewise.
688 (handle_key): Likewise.
690 2004-10-14 Kenichi Handa <handa@m17n.org>
692 * m17n-X.c (device_open): Accept Mxft as the value of key Mfont.
694 2004-10-13 Kenichi Handa <handa@m17n.org>
696 * m17n-X.c (device_open): Be sure to register at least one font
699 * font-ft.c: Include <freetype/ftbdf.h> conditionally. Check
700 HAVE_FTBDF_H before calling FT_Get_BDF_Property.
702 2004-10-12 Kenichi Handa <handa@m17n.org>
704 * draw.c (alloc_gstring): Fix previous change.
706 * font-ft.c (ft_list_generic): Fix for the case of not
709 * m17n-X.c (mwin__parse_event): Fix for non-ASCII keys.
711 * font.c (mfont_list): If no font is found, return NULL.
712 (load_font_encoding_table): Put entries of nil registry first.
713 (find_encoding): Adjust for the above change.
715 2004-10-11 Kenichi Handa <handa@m17n.org>
717 * m17n-gui.h (mfont_list): Adjust prototype.
719 * m17n-X.c (xfont_list): New arg maxnum.
721 * font.h (struct MFontDriver): Change prototype of <list>.
723 * font-ft.c (fc_generic_family_list): Delete it.
724 (Mserif, Msans_serif, Mmonospace): Delete them.
725 (M_generic_family_info): New variable.
726 (enum GenericFamilyType): New enum.
727 (struct GenericFamilyInfo): New struct.
728 (generic_family_table): New variable.
729 (set_font_info): New arg style. Don't check 0xA0..0xBF to decide
731 (add_font_info): Get style here.
732 (ft_list_family): Don't initialize fc_config here. Don't list
734 (ft_list_generic): New function.
735 (ft_select): Pay attention to generic familes here.
736 (ft_open): Fix calculation of ascent and descent.
737 (ft_list): Pay attention to generic families.
738 (mfont__ft_init): Initialize M_generic_family_info,
739 generic_family_table, and fc_config..
740 (mfont__ft_fini): Finalize generic_family_table.
742 * draw.c (compose_glyph_string): Use more constant font for
743 glyphs. Adjust for the member change in MGlyph.
744 (layout_glyph_string): Adjust for the member change in MGlyph.
745 (alloc_gstring): Intilize scracth_glyph to avoid
746 compose_glyph_string on it.
747 (get_gstring): Don't call compose_glyph_string on scracth_glyph.
748 (mdraw_coordinates_position): Fix previous change.
750 * internal-gui.h (glyph_category): New enum.
751 (MGlyph): Change type of <category> to enum glyph_category.
753 * face.c (mface__realize): Delete args langauge and charset.
754 (mface__for_chars): Fix for the case that glyphs have different
756 (mface__update_frame_face): Adjust for mface__realize change.
758 * face.h (mface__realize): Adjust prototype.
760 2004-10-05 Kenichi Handa <handa@m17n.org>
762 * language.c (mlang__init): Add Akan.
764 2004-10-04 Kenichi Handa <handa@m17n.org>
766 * font-ft.c (add_font_info): Add instead of push the element.
767 (ft_list_family): For generic fonts, try all
768 substituted. families.
770 * font-flt.c (UPDATE_CLUSTER_RANGE): New macro.
771 (run_rule): Don't update cluster range here.
772 (run_command): Update cluster range on appending a glyph.
773 (run_otf): Update cluster range for glyphs generated by OTF.
775 2004-10-02 Kenichi Handa <handa@m17n.org>
777 * m17n-X.c (device_open): Handle Mfont key in PLIST.
779 2004-09-30 Kenichi Handa <handa@m17n.org>
781 * font-ft.c (ft_select): Ignore family on calling mfont__score.
783 2004-09-30 Kenichi Handa <handa@m17n.org>
785 * font.h: Include <fontconfig/fontconfig.h>.
786 (MFTInfo): New member langset.
787 (mfont__encoding_list): Extern it.
789 * font.c (mfont__encoding_list): New function.
790 (mdebug_dump_font_list): New function.
792 * font-ft.c: Don't include <fontconfig/fontconfig.h> here.
793 (Mserif, Msans_serif, Mmonospace, Mmedium, Mr, Mnull): New
795 (ft_family_list): New variable.
796 (set_font_info): New arg basep. Callers changed.
797 (fc_list): Check the return value of FcPatternGetString.
798 (add_font_info): New arg plist. Callers changed. Update
800 (ft_list_family): New function (merged fc_list and ft_list_all).
801 (ft_select): Use ft_list_family.
802 (ft_list): Likewise. If FONT is not NULL, check all fonts. Fix
804 (mfont__ft_init): Initialize above new variables.
805 (mfont__ft_fini): Free ft_family_list.
806 (STRDUP_LOWER): New macro.
807 (set_font_info): Use STRDUP_LOWER.
808 (ft_list_family): Avoid duplicate addition of font path. Use
810 (fc_decode_prop): Fix typo.
812 * m17n-X.c (MDisplayInfo): New member all_fonts_scaned.
813 (xfont_registry_list): Change argument disp_info to frame.
815 (xfont_list_all): New function.
816 (xfont_list): If FONT is not NULL, check all fonts.
818 2004-09-28 Kenichi Handa <handa@m17n.org>
820 * m17n-X.c (MXFont, MXFontList): New types.
821 (MDisplayInfo): Delete members font_registry_list,
822 iso8859_1_family_list, iso10646_1_family_list, new members
823 font_list, base_font_list.
824 (free_display_info): Adusted for the change of MDisplayInfo.
825 (xfont_driver): Initialize with xfont_list.
826 (font_compare): New function.
827 (build_font_list): Deleted.
828 (xfont_registry_list): New function.
829 (xfont_select): Use xfont_registry_list.
830 (xfont_list): New function.
831 (device_open): Adusted for the change of MDisplayInfo.
833 * font-ft.c (add_font_info): New arg languages. Callers changed.
834 (fc_list): Get languages from fonts..
835 (ft_list_all): Renamed from ft_list. Callers changed.
836 (ft_list): New function.
837 (mfont__ft_driver): Initalize with ft_list.
839 * font.c (mfont_list): New function.
841 * font.h (struct MFontDriver): New member `list'.
842 (MFTInfo): New member languages.
844 * m17n-gui.h (mfont_list): Extern it.
846 2004-09-27 Kenichi Handa <handa@m17n.org>
848 * internal-gui.h (struct MGlyphString): Delete members mt,
849 sub_width, sub_lbrearing, sub_rbearing, and region.
851 * draw.c (MSubTextExtents): New type.
852 (layout_glyphs): New arg extents. Set its members.
853 (layout_glyph_string): Adjusted for the above change.
854 (alloc_gstring): Don't set gstring->mt.
855 (truncate_gstring): Call line_break function with mt instead of
858 2004-09-22 Kenichi Handa <handa@m17n.org>
860 * mtext.c (count_utf_16_chars): Count each code of invalid
863 2004-09-19 Kenichi Handa <handa@m17n.org>
865 * mtext.c (default_utf_16, default_utf_32): Rename them to
866 MTEXT_FORMAT_UTF_16 and MTEXT_FORMAT_UTF_32 respectively. Caller
869 * m17n-core.h (MTEXT_FORMAT_UTF_16, MTEXT_FORMAT_UTF_32): Extern
872 2004-09-13 Kenichi Handa <handa@m17n.org>
874 * draw.c (Mlatin): Don't declare it here.
875 (visual_order): Fix reordering of combining characters.
876 (compose_glyph_string): Fix detection of script.
877 (layout_glyphs): Don't fix reordering of combining characters
879 (layout_glyph_string): Pay attention to
880 control->disable_overlapping_adjustment.
881 (truncate_gstring): Include at least on character in a line.
882 (get_gstring): Always scan one full line.
883 (mdraw__init): Don't initialize Mlatin here.
884 (mdraw_text_per_char_extents): Fix iteration. If a glyph doesn't
885 have a font, use ascent/descent of an ASCII font. Allow
886 ink_array_return and logical_array_return to be NULL.
887 (mdraw_coordinates_position): Fix iteration.
889 * font-ft.c (MFTtoProp): Member completely changed.
890 (ft_to_prop): Adjusted for the above change.
891 (ft_to_prop_size): Likewise.
892 (set_font_info): Adjusted for the change of MFTtoProp.
893 (fc_generic_family_list): New variable.
894 (fc_list): Add special handling of generic font names.
895 (mfont__ft_init): Adjusted for the change of MFTtoProp.
896 Initialize fc_generic_family_list.
897 (mfont__ft_fini): Don't free ft_to_prop. Free
898 fc_generic_family_list.
899 (FC_vs_M17N_font_prop): New type.
900 (fc_weight_table, fc_slant_table, fc_width_table): New variables.
901 (fc_decode_prop, fc_encode_prop): New functions.
902 (mfont__ft_parse_name): Use fc_decode_prop.
903 (mfont__ft_unparse_name): Use fc_encode_prop.
905 * m17n-X.c (MDisplayInfo): Delete member realized_font_list.
906 (MWDevice): Add member realized_font_list.
907 (free_display_info): Don't free disp_info->realized_font_list.
908 (free_device): Free device->realized_fontset_list.
909 (xft_find_metric): Use gstring->frame instead of rfont->frame.
910 (device_open): Don't initialize disp_info->realized_font_list.
911 (device_open): Initialize device->realized_font_list and set it to
912 frame->realized_font_list.
914 * fontset.c (try_font_group): New function.
915 (mfont__lookup_fontset): Use try_font_group.
917 * font.c (common_weight): Change the order of "regular".
919 * face.c (Mlatin): Don't make it static.
920 (mface__realize): Be sure to set work_gstring.frame.
921 (mface__for_chars): Likewise.
923 * mtext.c (mdebug_dump_mtext): Fix for the case of mt->format >
926 * internal-gui.h (Mlatin): Extern it.
928 * m17n-gui.h (MDrawControl): New member
929 disable_overlapping_adjustment.
931 2004-09-06 Kenichi Handa <handa@m17n.org>
933 * font-flt.c (run_otf): Fix typo ('}'->']').
935 * internal-gui.h (MAKE_PRECOMPUTED_COMBINDING_CODE)
936 (COMBINING_PRECOMPUTED_P): New macros.
938 * draw.c (layout_glyphs): Handle precomputed combining code.
940 * font-ft.c (mfont__ft_drive_otf): Set g->combining_code to a
941 precomupted combining code.
943 2004-09-03 Kenichi Handa <handa@m17n.org>
945 * font-ft.c (mfont__ft_drive_otf): Use malloc and free for
948 2004-08-27 Kenichi Handa <handa@m17n.org>
950 * face.c (mface_put_prop): If the new value is the same as the
951 current one, don't increment frame->tick.
953 2004-08-25 Kenichi Handa <handa@m17n.org>
955 * fontset.c (mfontset): Initialize font_spec_list member.
956 (mfontset_copy): Load fontset if necessary.
958 * m17n-gui.h (MDrawGlyphInfo): Change the member name 'this' to
959 'metrics' to for C++.
961 * draw.c (mdraw_glyph_info): Adjusted for the member name change
964 2004-08-16 Kenichi Handa <handa@m17n.org>
966 * Version 1.1.0 released.
968 2004-08-13 Kenichi Handa <handa@m17n.org>
970 * language.c (mlang__init): Add Dhivehi.
972 * m17n-gui.c (Mx, Mfreetype): Delete it.
973 (m17n_init_win): Don't initialize Mx and Mfreetype here.
975 * m17n-gui.h (Mfreetype, Mxft): Extern them.
976 (mfont_resize_ratio): Extern it.
977 (MDrawGlyphInfo): New member logical_width;
978 (MDrawGlyph): New type.
979 (mdraw_glyph_list): Prototype adjusted.
981 * m17n-X.c (xfont_open): Set type and fontp members.
982 (xft_open): Likewise.
984 * internal-gui.h (Mx, Mfreetype): Delete extern.
986 * font.h (struct MRealizedFont): New member type and fontp.
988 * font.c (mfont__init): Initialize Mx, Mfreetype, and Mxft.
989 (Mx, Mfreetype): Declare here.
990 (Mxft): New variable.
991 (mfont_resize_ratio): New function.
993 * font-ft.c (ft_open): Set type and fontp members.
995 * draw.c (mdraw_glyph_list): Argument type changed. Don't set
998 2004-08-11 Kenichi Handa <handa@m17n.org>
1000 * font-ft.c (ft_find_metric): Call FT_Load_Glyph with
1003 2004-08-06 Kenichi Handa <handa@m17n.org>
1005 * font-ft.c (mfont__ft_drive_otf): Fix for the case that no GSUB
1008 * font-flt.c (run_otf): Print debugging information if necessary.
1010 2004-08-05 Kenichi Handa <handa@m17n.org>
1012 * font-ft.c (mfont__ft_drive_otf): Fix sign of g->yoff. Support
1013 positioning_type 5 and 6. Switch simplified.
1015 2004-08-04 Kenichi Handa <handa@m17n.org>
1017 * font-ft.c (mfont__ft_drive_otf): Call OTF_drive_gdef.
1019 2004-08-02 Kenichi Handa <handa@m17n.org>
1021 * font.c (mfont__score): If prop is MFONT_FOUNDRY or MFONT_FAMILY,
1022 set val to 1 even if it is greater than 1.
1024 * fontset.c (mfontset_modify_entry): Fix handling of the arg `how'.
1026 2004-07-29 Kenichi Handa <handa@m17n.org>
1028 * font-flt.c (run_rule, run_command, mfont__flt_run): Print more
1029 debugging information.
1031 * internal.h (MDEBUG_PRINT5): New macro.
1033 * draw.c (layout_glyphs): Don't combine a zero width glyph with
1034 the previous one if the zero width glyph has left or right
1037 2004-07-26 Kenichi Handa <handa@m17n.org>
1039 * m17n-X.c (xft_render): Pay attention to members left_padding and
1040 right_padding of MGlyph.
1042 * draw.c (visual_order): Allocate one more elements for arrays as
1043 a workaround of fribidi bug.
1044 (layout_glyphs): Fix previous change. Check MGlyph->combining_code
1045 instead of MGlyph->bidi_sensitive.
1046 (layout_glyph_string): Pay attentinon to
1047 control->orientation_reversed when padding at the head or tail.
1048 Fix adjustment of space glyph width.
1049 (get_gstring): If cursor_width or cursor_bidi is changed, don't
1052 * font-ft.c (mfont__ft_drive_otf): Set MGlyph->combining_code
1053 instead of MGlyph->bidi_sensitive.
1055 * internal-gui.h (MGlyph): Delete member bidi_sensitive.
1057 2004-07-26 Kenichi Handa <handa@m17n.org>
1059 * draw.c (visual_order): Don't treat combined glyphs specially.
1060 (layout_glyphs): Don't get metrics glyphs that are already ready.
1061 Pay attention to MGlyph->bidi_sensitive. Combine a glyph of zero
1062 width with the previous one.
1063 (draw_background): Fix bar cursor position on a r2l glyph.
1065 * font-flt.c (FontLayoutCmdOTF): Move back from internal-gui.h.
1066 (run_rule): Fix place of updating cluster_begin_pos and
1067 cluster_end_pos here.
1068 (run_otf): Don't set left_padding.
1070 * font-ft.c (adjust_anchor): Type of argument `code' changed.
1072 (mfont__ft_drive_otf): Renamed back from mfont__ft_drive_gsub.
1073 Fix handling of GPOS.
1074 (mfont__ft_drive_gpos): Delete this function.
1076 * font.h (mfont__ft_drive_otf): Renamed back from
1077 mfont__ft_drive_gsub.
1078 (mfont__ft_drive_gpos): Delete extern.
1080 * internal-gui.h (FontLayoutCmdOTF): Move back to font-flt.c.
1081 (MGlyph): Delete member otf_cmd, add member bidi_sensitive.
1083 2004-07-23 Kenichi Handa <handa@m17n.org>
1085 * draw.c (layout_glyphs): Call mfont__ft_drive_gpos with glyphs of
1086 the same bidi level.
1088 * font-ft.c (mfont__ft_drive_gpos): Check bidi-level.
1090 2004-07-22 Kenichi Handa <handa@m17n.org>
1092 * font-flt.c (load_flt): Treat the symbol Mend as end-of-file.
1094 2004-07-20 Kenichi Handa <handa@m17n.org>
1096 * draw.c (render_glyphs): Fix checking of g->code validity.
1098 * face.c (mface__realize): Set g.type.
1100 2004-07-18 Kenichi Handa <handa@m17n.org>
1102 * Makefile.am: Prepend ${top_srcdir} to all *.la in
1105 * m17n-gui.c (mframe): Print error message give by dlopen to
1108 2004-07-16 Kenichi Handa <handa@m17n.org>
1110 * draw.c (compose_glyph_string): Improve the way of deciding a
1111 script. For a character that doesn't have script property, use
1112 the last non-latin script.
1114 * font-ft.c (fc_list): Cancel previous change.
1115 (mfont__ft_init): Add more entries in ft_to_prop_name.
1117 2004-07-15 Kenichi Handa <handa@m17n.org>
1119 * draw.c (mdraw_glyph_list): Add the width of padding glyphs to
1120 previous or next character glyphs.
1122 2004-07-14 Kenichi Handa <handa@m17n.org>
1124 * draw.c (compose_glyph_string): Be sure to set codes for glyphs
1125 of type GLYPH_SPACE.
1127 * fontset.c (mfont__lookup_fontset): If glyph type is
1128 GLYPH_SPACE, get codes for SPACE.
1130 * internal-gui.h (Mfont): Delete extern.
1132 * m17n-gui.h (Mfont): Delete duplicated extern.
1134 2004-07-13 Kenichi Handa <handa@m17n.org>
1136 * font-ft.c (DEVICE_DELTA): New macro.
1137 (adjust_anchor): New function.
1138 (mfont__ft_drive_gsub): Renamed from mfont__ft_drive_otf. Drive
1140 (mfont__ft_drive_gpos): New function.
1142 * font-flt.c (FontLayoutCmdOTF): Moved to internal-gui.h.
1143 (FontLayoutContext): Delete member `rfont'.
1144 (run_otf): Set g->otf_cmd. Call
1145 (mfont__flt_run): Don't set ctx.rfont. Call mfont__ft_decode_otf
1146 only whne HAVE_OTF is defined.
1148 * fontset.c: Include "config.h".
1150 * internal-gui.h (FontLayoutCmdOTF): Moved from font-flt.c.
1151 (MGlyph): New member otf_cmd.
1153 * font.h (mfont__ft_drive_gsub): Changed from mfont__ft_drive_otf.
1154 (mfont__ft_drive_gpos): Extern it.
1156 * face.c: Include "config.h".
1158 * draw.c (layout_glyphs): Call mfont__ft_drive_gpos.
1160 * input-gui.c: Include "config.h".
1162 * plist.c: Include "config.h".
1164 2004-07-06 Kenichi Handa <handa@m17n.org>
1166 * m17n-gui.c, m17n-gui.h, m17n-gd.c, m17n-X.h, m17n-X.c,
1167 internal-gui.h: Cancel previous changes.
1169 * m17n-gd.h: Delete it.
1171 * Makefile.am (libm17n_core_la_LIBADD): New variable.
1172 (libm17n_core_la_LDFLAGS): Add -export-dynamic, move
1173 @XML2_LD_FLAGS@ to above.
1174 (libm17n_la_LIBADD): Add -ldl.
1175 (libm17n_la_LDFLAGS): Add -export-dynamic.
1176 (X_LD_FLAGS): Fix the order of linking.
1177 (libm17n_gui_la_LIBADD): Add ${OPTIONAL_LD_FLAGS}.
1178 (libm17n_gui_la_LDFLAGS): Add -export-dynamic, delete above.
1179 (libm17n_X_la_LDFLAGS): Add -module.
1180 (libm17n_gd_la_SOURCES): Delete m17n-gd.h.
1181 (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
1182 (libm17n_gd_la_LDFLAGS): Add -module.
1183 (include_HEADERS): Delete m17n-gd.h.
1185 2004-06-30 Kenichi Handa <handa@m17n.org>
1187 * m17n-gui.c: Adjusted for the change of struct MDeviceDriver.
1188 (MDeviceLibraryInterface): Delete it.
1189 (register_device_library): Delete it.
1190 (m17n__device_library_list): Renamed from device_library_list.
1192 * m17n-gui.h (M17N_INIT_X, M17N_INIT_GD): New macros.
1193 (m17n_init_win): Adjust prototype.
1195 * m17n-gd.c: Adjusted for the change of struct MDeviceDriver.
1196 (m17n_init_gd): New function.
1198 * m17n-gd.h: New file.
1200 * m17n-X.h: Include <m17n-gui.h>.
1201 (m17n_init_X): Extern it.
1202 (M17N_INIT): Redefine it.
1204 * m17n-X.c: Adjusted for the change of struct MDeviceDriver.
1205 (m17n_init_X): New function.
1207 * internal-gui.h (m17n__device_library_list): Extern it.
1208 (struct MDeviceDriver): New members initialized, init, and fini.
1210 * Makefile.am (libm17n_X_la_LIBADD): Add ${X_LD_FLAGS} and
1212 (libm17n_X_la_LIBADD): Delete aboves.
1213 (libm17n_gd_la_SOURCES): Add m17n-gd.h.
1214 (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
1215 (libm17n_gd_la_LDFLAGS): Delete it.
1216 (include_HEADERS): Add m17n-gd.h.
1218 2004-06-25 Kenichi Handa <handa@m17n.org>
1220 * Makefile.am (libm17n_X_la_LDFLAGS): Cancel previous change.
1221 (libm17n_gd_la_LDFLAGS): Cancel previous change.
1223 * m17n-gd.c (gd_render): Don't call FT_Get_Char_Index.
1225 * font-ft.c (fc_list): If FcFontList finds no font, try
1228 * draw.c (compose_glyph_string): Terminate the last loop after
1229 doing default combining if necessary.
1231 2004-06-24 Kenichi Handa <handa@m17n.org>
1233 * draw.c (mdraw_glyph_list): Unref gstring->top at the tail.
1235 * character.c (mchar_define_property): Add const to an arg.
1237 * charset.c (mchar_define_charset): Add const to an arg.
1239 * coding.c (MCodingSystem): Add const to an arg or decoder.
1240 (finish_decoding): Add const to an arg.
1241 (decode_coding_charset, decode_coding_utf_8)
1242 (decode_coding_utf_16, decode_coding_utf_32)
1243 (decode_coding_iso_2022, decode_coding_sjis)
1244 (mconv_define_coding): Likewise.
1246 * m17n-X.c (xft_find_metric): Delete unused variable.
1248 * m17n-core.h (mchar_define_property, mtext_from_data): Adjust
1251 * m17n.h (mchar_define_charset, mconv_define_coding): Adjust
1254 * mtext.c (count_utf_8_chars, count_utf_16_chars)
1255 (mtext__from_data, mtext_from_data): Add `const' to an arg.
1257 * mtext.h (mtext__from_data): Ajust prototype.
1259 2004-06-23 Kenichi Handa <handa@m17n.org>
1261 * draw.c (compose_glyph_string): Always get glyph codes by
1263 (mdraw_glyph_info): Set info->glyph_code and info->logical_width.
1264 (mdraw_glyph_list): New function.
1266 * font-flt.c (mfont__flt_run): Be sure to call
1267 rfont->driver->encode_char.
1269 * font-ft.c (ft_find_metric): Don't call FT_Get_Char_Index.
1270 (ft_encode_char): Delete arg C.
1271 (ft_render): Don't call FT_Get_Char_Index.
1273 * font.c (mfont__encodable_p): Delete it.
1274 (mfont__encode_char): Be sure to call rfont->driver->encode_char.
1276 * font.h (struct MFontDriver): Delete arg C of encode_char.
1277 (mfont__encodable_p): Delete extern.
1279 * m17n-X.c (xfont_encode_char): Delete arg C.
1280 (xft_find_metric): Don't cal FT_Get_Char_Index.
1281 (xft_render): Likewise.
1283 * m17n-gui.h (MDrawGlyphInfo): New members glyph_code and
1285 (mdraw_glyph_list): Extern it.
1287 * Makefile.am (libm17n_X_la_LDFLAGS): Don't include ${X_LD_FLAGS}.
1289 2004-06-22 Kenichi Handa <handa@m17n.org>
1291 * m17n-gui.h (mfontset_lookup): Extern it.
1293 * m17n-gui.c (m17n_init_win): Delete unnecessary printing.
1295 * fontset.c (realize_fontset_elements)
1296 (free_realized_fontset_elements, update_fontset_elements): New
1298 (mfont__realize_fontset): Call realize_fontset_elements.
1299 (mfont__free_realized_fontset): Call free_realized_fontset_elements.
1300 (mfont__lookup_fontset): If a fontset was modified, update
1301 the realized fontset.
1302 (mfontset_modify_entry): Increment fontset->tick.
1303 (mfontset_lookup): New function.
1305 2004-06-21 Kenichi Handa <handa@m17n.org>
1307 * font-ft.c (mfont__ft_parse_name): Cast the arg to FcNameParse.
1309 * mtext.c (mtext_dup, mtext_cat, mtext_ncat, mtext_cpy)
1310 (mtext_ncpy, mtext_duplicate): Pay attention to the case that the
1311 length of source text 0.
1313 2004-06-21 Kenichi Handa <handa@m17n.org>
1315 * mtext.c (INC_POSITION): Use CHAR_UNITS_BY_HEAD_UTF16.
1316 (compare): Pay attention to format other than utf-8.
1317 (copy): Delete this function.
1318 (count_by_utf_8, count_by_utf_16, insert): New functions.
1319 (count_utf_16_chars): Fix handling of a surrogate pair.
1320 (find_char_forward, find_char_backward): Likewise.
1321 (mtext__from_data): Delete unnecessary check. Fix number of
1323 (mtext_from_data): Don't count items.
1324 (mtext_ref_char): Optimize the code.
1325 (mtext_set_char): Pay attention to format other than utf-8.
1326 (mtext_cat_char): Likewise.
1327 (mtext_dup): Don't call copy, instead do allocation here.
1328 (mtext_cat): Call insert instead of copy.
1329 (mtext_ncat): Likewise.
1330 (mtext_cpy): Delete character at first and call insert instead of
1332 (mtext_ncpy): Likewise.
1333 (mtext_copy): Likewise.
1334 (mtext_duplicate): Call insert instead of copy.
1335 (mtext_del): Pay attention to format other than utf-8.
1336 (mtext_ins): Simply call insert.
1337 (mtext_ins_char): Pay attention to format other than utf-8.
1338 (mtext_tok): Call insert instead of copy.
1339 (mtext_text): Call UNIT_BYTES.
1341 * textprop.c (mtext__adjust_plist_for_change): New function.
1343 * character.h (USHORT_SIZE, UINT_SIZE, UNIT_BYTES): New macros.
1344 (CHAR_UNITS_UTF16, CHAR_UNITS): Simplified.
1345 (CHAR_UNITS_AT): Fix typo.
1346 (CHAR_UNITS_BY_HEAD): Fix typo.
1347 (STRING_CHAR_AND_UNITS): Fix typo.
1349 * internal.h (MTEXT_READ_ONLY_P): New macro.
1351 * mtext.h (mtext__replace): Delete the extern.
1352 (mtext__adjust_foramt): Adjust prototype.
1354 * plist.c (mplist_deserialize): Adjust the format of MT to utf-8
1355 if possible. Otherwise make a copy of mmt.
1357 * coding.c (mconv_decode, mconv_gets): Adjust the format of MT to
1360 2004-06-18 Kenichi Handa <handa@m17n.org>
1362 * character.h (CHAR_STRING_UTF16): Fix syntax.
1364 2004-06-16 Kenichi Handa <handa@m17n.org>
1366 * Makefile.am (libm17n_gd_la_LIBADD): Delete it.
1367 (libm17n_X_la_LIBADD): Delete it.
1368 (libm17n_gd_la_LDFLAGS): Don't include @GD_LD_FLAGS@.
1370 * m17n-X.c (device_open): Add parens in `if' condition.
1372 * mtext.c (INC_POSITION): Handle format other than utf8 and utf16.
1373 (DEC_POSITION): Likewise.
1374 (compare): Fix case that mt1->format is MTEXT_FORMAT_UTF_8.
1376 2004-06-15 Kenichi Handa <handa@m17n.org>
1378 * fontset.c (mfont__lookup_fontset): Fix selection of font groups
1381 * draw.c (compose_glyph_string): If langauge is specified, call
1382 mface__for_chars even if a text is all latin. Fix condition for
1383 setting non_ascii_found.
1385 * m17n-X.c (xft_find_metric): Fix setting of g->lbrearing.
1387 * m17n.h (minput_char_to_key): Delete extern.
1389 * m17n-gui.h (minput_event_to_key): Cancel previous change.
1391 * m17n-gui.c (null_device_open): Set several members of frame.
1393 2004-06-14 Kenichi Handa <handa@m17n.org>
1395 * m17n-gui.h (minput_event_to_key): Delete extern.
1397 * symbol.h (struct MSymbolStruct): Renamed from MSymbol.
1399 * m17n-core.h (MSymbol): Defined as "struct MSymbolStruct *".
1401 * Makefile.am (AM_CPPFLAGS): Refer to @M17NDIR@.
1403 2004-06-08 Kenichi Handa <handa@m17n.org>
1405 * character.c (mchar_put_prop): Don't increment the ref-count of
1408 2004-06-04 Kenichi Handa <handa@m17n.org>
1410 * m17n-core.c (mdebug__register_object): New function.
1411 (mdebug__unregister_object): Likewise.
1413 * internal.h (mdebug__register_object, mdebug__unregister_object):
1415 (M17N_OBJECT_REGISTER, M17N_OBJECT_UNREGISTER): Call them
1418 * charset.c (mcharset__load_from_database): Don't call
1419 mconv__register_charset_coding here.
1421 * coding.c (find_coding): Get a real name from an element of
1422 coding_definition_list.
1423 (mconv__register_charset_coding): Set the real name at the top of
1425 (mcoding__load_from_database): Likewise.
1426 (mconv_list_codings): Adjusted for the above change.
1428 2004-06-03 Kenichi Handa <handa@m17n.org>
1430 * coding.c (find_coding): Find by canonicalized name. Don't have
1431 to modify the element of coding_definition_list by
1433 (mconv__define_coding_from_charset): Delete it.
1434 (mconv__register_charset_coding): Canonicalize sym.
1435 (mcoding__load_from_database): Register plist modified by
1438 * coding.h (mconv__define_coding_from_charset): Don't extern it.
1440 * font-ft.c (ft_open): Fix setting of rfont->descent.
1442 2004-06-02 Kenichi Handa <handa@m17n.org>
1444 * font.c (enum xlfd_field_idx): Moved from m17n-X.c.
1445 (xlfd_parse_name): Merge split_font_name and xfont_parse_name.
1446 (xlfd_unparse_name): Renamed from xfont_build_name.
1447 (mfont__init): Initialized Mfontconfig.
1448 (mfont__free_realized): Unconditionally unref rfont->info.
1449 (mfont__select): Free `this' if it's not best.
1450 (mfont__open): Don't check frame->realized_font_list.
1451 (mfont__parse_name_into_font): New function.
1452 (Mfontconfig): New variable.
1453 (mfont_from_name): Call mfont_parse_name.
1454 (mfont_name): Call mfont_unparse_name.
1455 (mdebug_dump_font): Likewise.
1457 * font.h (struct MFontDriver): Delete members parse_name and
1459 (mfont__ft_parse_name, mfont__ft_unparse_name): Extern them.
1460 (mfont__parse_name_into_font): Extern it.
1462 * font-ft.c: Include "symbol.h".
1463 (close_ft): Unconditionally free filename and charmap_list of
1465 (ft_open): Duplicate base->filename. Increment ref-count of
1466 ft_info->charmap_list. Free ft_info->charmap_list and
1467 ft_info->filename on error.
1468 (mfont__ft_parse_name, mfont__ft_unparse_name): New functions.
1470 * m17n-X.c (xfont_driver): Don't include xfont_parse_name and
1472 (enum xlfd_field_idx): Moved to font.c.
1473 (split_font_name, build_font_name): Likewise.
1474 (build_font_list): Call mfont__parse_name_info_font.
1475 (xfont_open): Call mfont__unparse_name. Free name.
1476 (xfont_parse_name, xfont_build_name): Moved to font.c
1477 (xft_select): Prototype deleted.
1478 (device_open): Check HAVE_FREETYPE on using mfont__ft_driver.
1479 Call mfont_pase_name.
1481 * m17n-gui.c (free_frame): Unref frame->font_driver_list.
1482 (m17n_fini_win): Add check HAVE_FREETYPE on using null_interface.
1485 * m17n-gui.h (mfont_parse_name, mfont_unparse_name, Mfontconfig):
1488 * Makefile.am (linkgui_LDADD): Add libm17n-X.la and libm17n-gd.la.
1490 2004-06-01 Kenichi Handa <handa@m17n.org>
1492 * fontset.c (mfontset_modify_entry): Pay attention to the case
1493 that fontset->font_spec_list is NULL.
1495 2004-05-31 Kenichi Handa <handa@m17n.org>
1497 * m17n-gui.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
1499 * input.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
1501 * font.c (mfont__select): Print score the a font for debugging.
1503 * Makefile.am (libm17n_la_LIBADD): Delete -ldl.
1505 * coding.c (reset_coding_sjis): Check kanji and kana instead of
1506 kanji_sym and kana_sym.
1508 2004-05-28 Kenichi Handa <handa@m17n.org>
1510 * Makefile.am (VINFO): New variable.
1511 (libm17n_core_la_LDFLAGS, libm17n_la_LDFLAGS)
1512 (libm17n_gd_la_LDFLAGS): Include ${VINFO}.
1514 2004-05-27 Kenichi Handa <handa@m17n.org>
1516 The following chanages are to make device dependent functions
1517 accessible only from MDeviceDriver structure, and to add GD and
1518 null device drivers. Font drivers get also device dependent.
1520 * m17n.c (m17n_init): Increament shell_initialized.
1521 (m17n_fini): Decremented shell_initialized.
1523 * m17n-misc.h (enum MErrorCode): New element MERROR_GD.
1525 * m17n-gui.h (Mdevice, Mdisplay, Mscreen, Mdrawable, Mdepth)
1526 (Mwidget, Mcolormap, Mx): Extern them.
1528 * m17n-gui.c: Include <dlfcn.h> and "config.h".
1529 (free_frame): Call frame->driver->close instead of
1531 (DLOPEN_SHLIB_EXT): New macro.
1532 (MDeviceLibraryInterface): New type.
1533 (device_library_list): New variable.
1534 (register_device_library): New function.
1535 (null_device): New variable.
1536 (null_device_close, null_device_get_prop)
1537 (null_device_realize_face, null_device_free_realized_face): New
1539 (null_driver): New variable.
1540 (null_device_init, null_device_fini, null_device_open): New
1542 (null_interface): New variable.
1543 (Mfreetype, Mdevice): Declare them.
1544 (m17n_init_win): Increment win_initialized. Initialize Mx, Mgd,
1545 Mfreetype, Mdevice, Mdisplay, Mscreen, Mdrawable, Mdevice, and
1546 Mwin__Close_Device. Register drivers for Mx and Mgd.
1547 (m17n_fini_win): Decremented win_initialized. Call "fini"
1548 function of all opened devices. Don't call mwin__fini.
1549 (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap):
1551 (mframe): Handle Mdevice key of PLIST.
1552 (mframe_get_prop): Call frame->device->get_prop instead of
1553 mwin__device_get_prop.
1555 * m17n-gd.c: New file.
1557 * m17n-core.h (M17NLIB_MAJOR_VERSION, M17NLIB_MINOR_VERSION)
1558 (M17NLIB_PATCH_LEVEL, M17NLIB_VERSION_NAME): Updated to 1.1.0.
1560 * m17n-core.c (m17n_init_core): Increate core_initialized.
1561 (m17n_fini_core): Decremented core_initialized.
1563 * m17n-X.h (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget)
1564 (Mcolormap): Don't extern them here.
1566 * m17n-X.c (FRAME_DEVICE): New macro.
1567 (FRAME_DISPLAY, FRAME_SCREEN, FRAME_CMAP): Use FRAME_DEVICE.
1568 (free_display_info): Use MPLIST_DO.
1569 (free_device): Free rface->info.
1570 (xft_close): Delete it.
1571 (device_init): Renamed from mwin__init.
1572 (device_fini): Renamed from mwin__fini.
1573 (device_open): Renamed from mwin__open_device.
1574 (x_driver): New variable.
1575 (MXFontInfo): Delete member frame, add member display.
1576 (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap, Mxim):
1577 Don't declare them here.
1579 * internal-gui.h (MDeviceType): New enum.
1580 (MWDefice): Delete it.
1581 (struct MFrame): Change type of device to void *. New members
1582 device_type, driver, font_driver_list.
1583 (M_CHECK_WRITABLE, M_CHECK_READABLE): New macros.
1584 (MDeviceDriver): New type.
1585 (Mx, Mgd, Mfreetype): Extern them.
1586 (mwin__XXX): Delete all of them.
1588 * input-gui.c (win_create_ic): Call frame->driver->XXX instead of
1590 (win_destroy_ic): Likewise.
1591 (adjust_window_and_draw): Likewise.
1592 (win_callback): Likewise.
1593 (Mxim): Declare it here.
1594 (minput_event_to_key): Call M_CHECK_READABLE.
1596 * fontset.c (mfont__lookup_fontset): Delete local variable
1599 * font.h (struct MFontDriver): Delete member close, add members
1600 parse_name and build_name.
1601 (mfont__driver_list): Delete extern.
1602 (mfont__close): Delete extern.
1604 * font.c (mfont__init): Don't set mfont__driver_list.
1605 (mfont__fini): Don't unref mfont__driver_list.
1606 (mfont__select): Try font drivers in frame->font_driver_list. Set
1607 driver member of a realized font.
1608 (mfont__close): Delete it.
1609 (mfont_from_name, mfont_name, mdebug_dump_font): Call driver
1610 functions of the default frame.
1612 * font-ft.c (close_ft): Check ft_info->ft_face and work
1614 (add_font_info): Allocate ft_info by M17N_OBJECT.
1615 (ft_close): Delete it.
1616 (mfont__ft_driver): Don't set ft_close.
1617 (ft_select): Increment ref-count of best_font.
1618 (ft_open): Decremented ref-count of base. On error, call
1619 FT_Done_Face and free ft_info.
1620 (ft_find_metric): Always use XXX_MONO in load_flags.
1621 (ft_render): Fix setting of width. Call
1622 frame->driver->draw_points instead of mwin__draw_points.
1623 (ft_to_prop): Don't set mfont__driver_list.
1624 (mfont__ft_fini): Just unref ft_info.
1626 * face.c (mface__init): Exchange foreground and background of
1627 mface__default. Call mface_put_prop to set hline of
1629 (mface__realize): Call frame->driver->XXX instead of mwin__XXX.
1630 (mface__free_realized): Don't call mwin__free_realized_face.
1632 * draw.c (Mdepth): Don't declare it here.
1633 (draw_background): Call frame->driver->XXX instead of mwin__XXX.
1634 (render_glyphs, render_glyph_string): Likewise.
1635 (mdraw__init): Don't set Mdepth.
1636 (mdraw_text, mdraw_image_text, mdraw_text_with_control): Call
1638 (mdraw_text_per_char_extents): Return 0 on success and -1 on
1640 (mdraw_text_items): Check FRAME is writable.
1641 (mdraw_per_char_extents): Implement body.
1643 * Makefile.am (lib_LTLIBRARIES): Include libm17n-gui.la and
1645 (OPTIONAL_LD_FLAGS): Include @FONTCONFIG_LD_FLAGS@.
1646 (GUI_SOURCES): Delete it.
1647 (libm17n_X_la_SOURCES): Don't include ${GUI_SOURCES}.
1648 (libm17n_gui_la_SOURCES, libm17n_gui_la_LIBADD)
1649 (libm17n_gui_la_LDFLAGS, libm17n_gd_la_SOURCES)
1650 (libm17n_gd_la_LIBADD, libm17n_gd_la_LDFLAGS): New targets.
1651 (linkgui_LDADD): Set to libm17n-gui.la
1652 (linkgui_LDFLAGS): New target.
1653 (SRC): Include ${libm17n_gui_la_SOURCES} and
1654 ${libm17n_gd_la_SOURCES}.
1656 2004-05-24 Kenichi Handa <handa@m17n.org>
1658 * draw.c (draw_background): Don't draw background even if
1659 rface->face.property[MFACE_BACKGROUND] is not Mnil.
1661 2004-05-22 Kenichi Handa <handa@m17n.org>
1663 * m17n-X.c (xft_open_font): Fix anti_alias setting.
1665 2004-05-20 Kenichi Handa <handa@m17n.org>
1667 * m17n-gui.h (MFaceHookFunc): Change this function type to void.
1669 * m17n-gui.c: Include "plist.h".
1670 (mframe): If PLIST is NULL, initialize it to emply plist.
1672 * m17n-X.c (build_font_list): Don't set property[MFONT_TYPE].
1673 (xft_driver): New variable.
1674 (xft_select, close_xft, xft_open_font, xft_open, xft_close)
1675 (xft_find_metric, xft_render): New function.
1676 (mwin__init): Adjusted for the new mfont__driver_list.
1677 (mwin__open_device): Assume arg PARAM is not NULL. Push a newly
1678 generated face to PARAM.
1679 (mwin__realize_face): Fix setting of box colors. Don't call hook
1681 (mwin__draw_hline): New function.
1682 (mwin__xft_close, mwin__xft_open, mwin__xft_get_metric)
1683 (mwin__xft_render): Delete these function.
1685 * internal-gui.h (struct MFrame): New member tick.
1686 (struct MGlyphString): New member tick.
1687 (mwin__draw_rect, mwin__draw_empty_boxes): Extern them.
1688 (mwin__xft_open, mwin__xft_close, mwin__xft_get_metric)
1689 (mwin__xft_render): Delete extern.
1691 * fontset.c (mfont__lookup_fontset): Make the code simpler.
1692 (mfontset): Always increment the reference count of returned
1695 * font-ft.c (mfont__ft_fini): Don't include <otf.h> here.
1696 (MFTInfo): Moved to font.h.
1697 (ft_iso8859_1_font_list): Delete this variable.
1698 (set_font_info): Don't set font->property[MFONT_TYPE].
1699 (set_font_info): Don't udpate ft_iso8859_1_font_list.
1700 (add_font_info): Change type to void.
1701 (fc_list): Change anme from xft_list. Caller changed. Include
1702 FC_FOUNDRY and FC_PIXEL_SIZE in FcObjectSet.
1703 (mfont__ft_driver): Change name from ft_driver. Caller changed.
1704 (ft_select): Check HAVE_FONTCONFIG instead of HAVE_XFT2.
1705 (close_ft): Don't call mwin__xft_close. Unref
1706 ft_info->extra_info.
1707 (ft_open): Don't setup ft_info->fontname. Don't call
1709 (ft_find_metric): Don't call mwin__xft_get_metric.
1710 (ft_encode_char): Call rfont->driver->open instead of ft_open.
1711 (ft_render): Don't check HAVE_XFT2. Don't call mwin__xft_render.
1712 (mfont__ft_init): Adjusted for new mfont__driver_list.
1713 (mfont__ft_fini): Don't unref ft_iso8859_1_font_list.
1715 * font.c (mfont__driver_list): Make it MPlist.
1716 (mfont__init): Adjust initialization of mfont__driver_list.
1717 (mfont__fini): Free mfont__driver_list.
1718 (mfont__set_spec_from_face): Don't set spec->property[MFONT_TYPE].
1719 (mfont__select): Adjusted for the new mfont__driver_list.
1721 * font.h (enum MFontProperty): Delete MFONT_TYPE.
1722 (mfont__drirver_list): Adjust prototype.
1723 (MFTInfo): Move to here from fron.c. Deleve member fontname.
1725 * face.h (struct MFace): Delete member realized_face_list, add
1727 (struct MRealizedFace): Delete member need_update
1728 andnofont_rface, add member non_ascii_list.
1729 (mface__update_frame_face): Extern it.
1731 * face.c (hline_prop_list, box_prop_list, noop_hook): New
1733 (get_hline_create, get_box_create): New functions.
1734 (find_realized_face): Cancel previous change. Arg RFONT deleted.
1736 (free_face): Cancep previous change. Free face->frame_list.
1737 (serialize_hline): Do nothing if hline->width is zero.
1738 (serialize_box): Do nothing if box->width is zero.
1739 (mface__init): Setup all properties of mface__default.
1740 (mface__fini): Free hline_prop_list and box_prop_list.
1741 (mface__realize): Cancel previous change. Update
1742 face->frame_list. Setup rface->non_ascii_list.
1743 (mface__for_chars): Update rface->non_ascii_list.
1744 (mface__free_realized): Free rface->non_ascii_list.
1745 (mface__update_frame_face): New function.
1746 (mface): Initialize face->frame_list.
1747 (mface_copy): Likewise. Just copy MFACE_HLINE and MFACE_BOX
1749 (mface_merge): Likewise.
1750 (mface_put_prop): If key is Mhline or Mbox, get value by
1751 get_hline_create or get_box_create respectively.
1752 (mface_put_prop): Update frame->tick and call
1753 mface__update_frame_face if necessary.
1754 (mface_update): Do nothing if func is noop_hook.
1756 * draw.c (render_glyphs): If a font is not found, use
1757 mwin__draw_empty_boxes.
1758 (alloc_gstring): Initialize gstring->tick.
1759 (get_gstring): Check gstring->tick.
1761 2004-05-17 Kenichi Handa <handa@m17n.org>
1763 * face.c (find_realized_face): Return value changed. If RFONT is
1764 NULL, avoid unnecessary checking.
1765 (free_face): Free face->realized_face_list.
1766 (mface__realize): Adjusted for the change of find_realized_face.
1767 If it returns a realized face that needs update, free it and
1768 realize a new one. Push a new realized face to
1769 frame->realized_face_list instead of appending.
1770 (mface__for_chars): Adjusted for the change of find_realized_face.
1771 Short cut if the required font is in rface->ascii_rface.
1772 (mface_put_prop): Free old value if necessary. Set need_update
1773 member of realized faces to 1.
1775 * face.h (struct MFace): Delete member tick, add member
1777 (struct MRealizedFace): Delete member tick, add member
1780 2004-05-13 Kenichi Handa <handa@m17n.org>
1782 * m17n-X.c (mwin__xft_open): Destroy unnecessary patterns.
1784 2004-05-12 Kenichi Handa <handa@m17n.org>
1786 * internal-gui.h (mwin__xft_open): Arguemnt name changed.
1788 * m17n-X.c (mwin__xft_open): Argument changed to fontname and
1789 parse it XftNameParse.
1791 * font-ft.c (MFTInfo) [HAVE_XFT2]: New member fontname.
1792 (all_fonts_scaned): New variable.
1793 (set_font_info): FAMILY may be Mnil.
1794 (add_font_info): Argument changed.
1795 (xft_list): Call add_font_info in it.
1796 (ft_list): Likewise.
1797 (ft_select): Make it work in the case family is Mnil.
1798 (ft_open) [HAVE_XFT2]: Setup ft_info->fontname.
1799 (mfont__ft_fini): Set all_fonts_scaned to 0.
1801 * fontset.c (mfont__lookup_fontset): Don't repeatedly try a font
1802 that is failed to open.
1804 2004-05-10 Kenichi Handa <handa@m17n.org>
1806 * m17n-X.c (mwin__xft_render): Don't use anti-alias if the
1807 device's depth is 1 (i.e. monochrome).
1809 * Makefile.am (OPTIONAL_LD_FLAGS): Change the order of elements
1810 to work around the problem of libtool.
1812 * font-ft.c: Include <freetype/ftbdf.h>.
1813 (Municode_bmp, Municode_full, Miso10646_1, Miso8859_1): New
1815 (mfont__ft_init): Initialize them.
1816 (ft_iso8859_1_font_list): New variable.
1817 (set_font_info): Detect a font containing iso8859-1 glyphs and
1818 register it in ft_iso8859_1_font_list. If the font is not
1819 scalable, assume it as BDF or PCF font and setup SIZE and RESY
1820 properties of the font from its properties.
1821 (add_font_list): If the font is not scalable, check if it is BDF
1822 or PCF font. If not, ignore it.
1823 (ft_select): If FAMILY is Mnil, return NULL only if the requested
1824 registry is not iso8859-1.
1825 (ft_select) [not HAVE_XFT2]: If FAMILY is Mnil, select one from
1826 ft_iso8859_1_font_list.
1827 (ft_find_metric): If the font is not scalable, assume it as BDF
1828 or PCF, and get a metric from its properties.
1829 (mfont__ft_fini): Free ft_iso8859_1_font_list.
1831 2004-05-07 Kenichi Handa <handa@redhat.m17n.org>
1833 * Makefile.am (libm17n_la_LIBADD): Include -ldl.
1834 (libm17n_la_LDFLAGS): Delete it.
1835 (noinst_PROGRAMS): Renamed from bin_PROGRAMS.
1836 (install-binPROGRAMS, uninstall-binPROGRAMS): Delete them.
1838 2004-05-06 Kenichi Handa <handa@m17n.org>
1840 * draw.c (compose_glyph_string): Fix previous change.
1842 2004-04-30 Kenichi Handa <handa@m17n.org>
1844 * font-ft.c (ft_list): Delete unused variable `result'.
1845 (ft_render): Fix for the case that bitmap.pitch < bitmap.width.
1847 2004-04-27 Kenichi Handa <handa@m17n.org>
1849 * m17n-X.c: Include config.h
1850 [HAVE_XFT2]: Include <X11/Xft/Xft.h>.
1851 (GCInfo) [HAVE_XFT2]: New member xft_color_fore, xft_color_back.
1852 (MWDevice) [HAVE_XFT2]: New member xft_draw.
1853 (FRAME_CMAP, FRAME_VISUAL): New macros.
1854 (free_device) [HAVE_XFT2]: Destroy device->xft_draw.
1855 (xfont_driver): Make it static.
1856 (mwin__open_device) [HAVE_XFT2]: Setup device->xft_draw.
1857 (mwin__realize_face) [HAVE_XFT2]: Setup info->xft_color_fore and
1858 info->xft_color_back.
1859 (MXftFontInfo) [HAVE_XFT2]: New type.
1860 (mwin__xft_close) [HAVE_XFT2]: New function.
1861 (mwin__xft_open) [HAVE_XFT2]: New function.
1862 (mwin__xft_get_metric) [HAVE_XFT2]: New function.
1863 (mwin__xft_render) [HAVE_XFT2]: New function.
1865 * internal-gui.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
1866 (mwin__xft_open, mwin__xft_close) [HAVE_FREETYPE]: New externs.
1867 (mwin__xft_get_metric, mwin__xft_render) [HAVE_FREETYPE]: New
1870 * font.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
1872 * font-ft.c: Don't include FT_FREETYPE_H here.
1873 [HAVE_XFT2]: Include <fontconfig/fontconfig.h>.
1874 (fontconfig_initialized, fc_config) [HAVE_XFT2]: New variables.
1875 (MFTInfo): New member charmap_index.
1876 (MFTInfo) [HAVE_XFT2]: New member xft_info.
1877 (check_otf_filename): Renamed from check_filename. Return value
1879 (ft_set_property): This function deleted.
1880 (set_font_info): New function.
1881 (add_font_list): Argument changed. Add multiple fonts.
1882 (xft_list) [HAVE_XFT2]: New function.
1883 (ft_list) [not HAVE_XFT2]: New function.
1884 (ft_select): Add code for Xft.
1885 (close_ft): Likewise.
1886 (ft_open): Likewise.
1887 (ft_find_metric): Likewise.
1888 (ft_encode_char): Likewise.
1889 (ft_render): Likewise.
1891 * makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@.
1893 2004-04-26 Kenichi Handa <handa@m17n.org>
1895 * textprop.c (mtext_attach_property): Declare the return type as
1898 2004-04-21 Kenichi Handa <handa@m17n.org>
1900 * Makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@
1902 2004-04-09 Kenichi Handa <handa@m17n.org>
1904 * font-flt.c (struct): New members seq_beg, seq_end, seq_from,
1906 (load_command): Setup above members.
1908 2004-04-05 Kenichi Handa <handa@m17n.org>
1910 * m17n-X.c (xfont_encode_char): Fix checking of byte1 and byte2.
1912 2004-03-30 Kenichi Handa <handa@m17n.org>
1914 * m17n-X.c (xfont_encode_char): Return MCHAR_INVALID_CODE if code
1917 * m17n-core.h (M17NLIB_PATCH_LEVEL): Changed to 2.
1918 (M17NLIB_VERSION_NAME): Changed to 1.0.2.
1920 2004-03-29 Kenichi Handa <handa@m17n.org>
1922 * Version 1.0 Patch Level 2 released.
1924 2004-03-29 Kenichi Handa <handa@m17n.org>
1926 * charset.c (make_charset): Set charset->fully_loaded and
1927 charset->simple correctly. Don't try to get charset->min_char and
1928 charset->max_char for a charset of method subset and superset.
1929 Don't load a mapping file here.
1930 (mcharset__init): Set unified_max.
1931 (mcharset__load_from_database): Free a working plist.
1933 * coding.c (mcoding__fini): Free all malloced data.
1935 * input-gui.c (win_create_ic): Set control.as_image for preediting
1938 * internal.h (M17N_OBJECT_REGISTER): Check the member `used' (not
1939 `count') to initialize the array.
1941 * locale.c (mlocale_set): Fix the order of M17N_OBJECT_REF and
1944 * m17n-X.c (xfont_render): If rface->rfont is null, draw a
1946 (mwin__create_window): Fix bug of setting a background pixel of a
1948 (mwin__adjust_window): Clear the window before drawing.
1950 * m17n-core.c (mdebug__report_object): Free array->objectes if
1952 (m17n_init_core): Don't set report_header_printed to 0 here.
1953 Fix debugging information.
1954 (m17n_fini_core): Set report_header_printed to 0 here.
1956 * m17n-core.h (mplist_deserialize): Extern it.
1958 * m17n-gui.c (m17n_fini_win): Fix debugging information.
1960 * m17n.c (m17n_fini): Fix debugging information.
1962 * mtext.c (mtext__adjust_foramt): New function.
1964 * mtext.h (mtext__adjust_foramt): Extern it.
1966 * plist.c (mplist_deserialize): Renamed from mplist__deserialize.
1968 * plist.h (mplist__deserialize): Don't extern it.
1970 * symbol.c (msymbol__fini): Set freed_symbols to 0. Set all
1971 elements of symbol_table to NULL. Report about created and freed
1972 symbols if MDEBUG_FINI is set.
1974 2004-03-22 Kenichi Handa <handa@m17n.org>
1976 * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE.
1978 * m17n.c (m17n_init): Fix the way of checking merror_code.
1980 * m17n-gui.c (m17n_init_win): Fix the way of checking merror_code.
1982 2004-03-22 Kenichi Handa <handa@m17n.org>
1984 * fontset.c (realize_font_group): Adjust the font size by
1985 mfont__resize before selecting a font.
1987 * font-ft.c (mfont__ft_init): Add oblique and boldoblique.
1989 2004-03-19 Kenichi Handa <handa@m17n.org>
1991 * Version 1.0 Patch Level 1 released.
1993 2004-03-19 Kenichi Handa <handa@m17n.org>
1995 * m17n-core.h (M17NLIB_PATCH_LEVEL): New macro.
1997 * m17n-core.c (M17NLIB_PATCH_LEVEL): Describe it.
1999 2004-03-19 Kenichi Handa <handa@m17n.org>
2001 Re-apply the changes forgotten in the released version.
2003 * charset.c (mcharset__load_from_database): Call
2004 mchar_define_charset.
2006 * coding.c (encode_unsupporeted_char): Put Mcoding text property.
2007 (mconv_encode_range): Put Mcoding text property.
2009 2004-03-18 Kenichi Handa <handa@m17n.org>
2011 * draw.c (Mdepth): New variable.
2012 (visual_order): Delete unused local var `pos'.
2013 (compose_glyph_string): Fix for the case that gstring->glyphs is
2014 realloced. Stop generating glyphs at TO. Fix handling of
2016 (layout_glyphs): Get metrics of all glyphs in advance. Set
2017 lbearing and rbearing of base of composition glyph correctly.
2018 Handle left-overhang glyphs correctly.
2019 (alloc_gstring): New arg frame. Set gstring->anti_alias. Caller
2021 (dump_combining_code): Change the defualt off_x character to ".".
2022 (mdraw__init): Initialize Mdepth.
2024 * face.c (work_gstring): New variable
2025 (mface__init): Initialize work_gstring.
2026 (mface__fini): Free work_gstring.glyphs.
2027 (mface__realize): Don't handle videomode property here. Adjusted
2028 for the change of mfont__get_metric.
2029 (mface__for_chars): Adjusted for the change of mfont__get_metric.
2031 * face.h (enum face_gc): Moved to m17n-X.c.
2033 * font.h (struct MFontDriver): Arguments of find_metric changed.
2034 (mfont__select): Prototype adjusted.
2035 (mfont__get_metric): Likewise.
2036 (mfont__ft_drive_otf): Likewise.
2037 (mfont__flt_run): Likewise.
2039 * font.c (mfont__select): New argument layouter. If layouter is
2040 different in the registered font, make a new copy of realized
2042 (mfont__get_metric): Argument changed. Get metrics of multiple
2044 (mfont_find): Call mfont__select with layouter as Mnil.
2046 * font-flt.c (FontLayoutContext): New member rfont.
2047 (run_otf): Adjusted for the change of mfont__ft_drive_otf.
2048 (mfont__flt_run): Argument changed. Initialize ctx.rfont.
2050 * font-ft.c (ft_find_metric): Arguments changed. Get metrics of
2052 (NUM_POINTS): New macro.
2053 (MPointTable): New type.
2054 (ft_render): Use mwin__draw_points instead of mwin__draw_bitmap.
2055 (mfont__ft_drive_otf): New argument rfont.
2057 * fontset.c (realize_font_group): Adjusted for the changed of
2059 (check_fontset_element): This function deleted.
2061 * input-gui.c (adjust_window_and_draw): Locate a preedit window
2062 off the parent window if the preedit text is zero length.
2064 * internal-gui.h (struct MFrame): New members foreground,
2065 background, videomode, font.
2066 (struct MGlyphString): New member anti_alias.
2067 (MDrawPoint): New type.
2068 (mwin__draw_bitmap): Prototype deleted.
2069 (mwin__draw_points): Prototype added.
2071 * m17n-gui.h (MDrawControl): New member anti_alias.
2073 * m17n-gui.c (free_frame): Free frame->font.
2074 (mframe): Set the fontset of frame->face to the default fontset.
2076 * m17n-X.c (RGB_GC): New type.
2077 (enum gc_index): Renamed from enum face_gc. Member names changed.
2079 (struct MWDevice): Members foreground and background deleted. New
2080 member scratch_gc, gc_list.
2081 (DEFAULT_FONT, FALLBACK_FONT): New macros.
2082 (free_device): Free GCs in device->gc_list.
2083 (get_rgb_gc): New function.
2084 (get_gc): Renamed and argument changed from get_color.
2085 (get_gc_for_anti_alias): New function.
2086 (xfont_find_metric): Arguments changed. Get metrics of multiple
2088 (set_region): Argument changed. Caller changed.
2089 (xfont_render): Allways set a font in gc.
2090 (x_error_handler, x_io_error_handler): Define only if
2091 X_SET_ERROR_HANDLER is defined.
2092 (mwin__open_device): Create device->scratch_gc. Set members
2093 foreground, background, and videomode of frame. Call
2094 XSetErrorHandler and XSetIOErrorHandler only if
2095 X_SET_ERROR_HANDLER is defined.
2096 (struct gc_list): Deleted.
2097 (REGISTER_GC, UNREGISTER_GC): These macros deleted.
2098 (mwin__realize_face): Adjusted for the change of the format of
2099 rface->info and the charge of set_region.
2100 (mwin__free_realized_face, mwin__fill_space, mwin__draw_hline)
2101 (mwin__draw_box): Likewise.
2102 (mwin__draw_bitmap): This function deleted.
2103 (mwin__draw_points): New function.
2104 (mwin__verify_region): Adjusted for the change of the format of
2105 rface->info and the charge of set_region.
2106 (mwin__create_window): Inherit backgound pixel from parent.
2107 (mwin__dump_gc): Adjusted for the change of the format of
2110 2004-03-16 Kenichi Handa <handa@m17n.org>
2112 * m17n-X.c (mwin__parse_event): Fix handling of modifier keys.
2114 * input.c (M_key_alias): New variable.
2115 (handle_key): Try M_key_alias property of a key too.
2116 (minput__init): Initialize M_key_alias. Give that property to
2117 symbols in one_char_symbol. Fix bug of initializing
2120 * draw.c (compose_glyph_string): Don't handle
2121 ignore_formatting_char here. Include formatting characters in the
2122 range processed by a FTL.
2123 (layout_glyph_string): Handle ignore_formatting_char here.
2125 2004-03-12 Kenichi Handa <handa@m17n.org>
2127 * input-gui.c (win_create_ic): Enable bidi in status control.
2129 * draw.c (visual_order): Avoid re-ordering of combining glyphs only.
2131 2004-03-09 Kenichi Handa <handa@m17n.org>
2133 * input.c (load_input_method): If title is not specified, use the
2134 input method name as title.
2136 * m17n-X.c (get_color): Make it static.
2137 (xim_create_ic, xim_destroy_ic, x_error_handler)
2138 (x_io_error_handler): Likewise.
2140 2004-03-01 Kenichi Handa <handa@m17n.org>
2142 * Version 1.0 released.
2145 Copyright (C) 2003, 2004
2146 National Institute of Advanced Industrial Science and Technology (AIST)
2147 Registration Number H15PRO112
2149 This file is part of the m17n library.
2151 The m17n library is free software; you can redistribute it and/or
2152 modify it under the terms of the GNU Lesser General Public License
2153 as published by the Free Software Foundation; either version 2.1 of
2154 the License, or (at your option) any later version.
2156 The m17n library is distributed in the hope that it will be useful,
2157 but WITHOUT ANY WARRANTY; without even the implied warranty of
2158 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2159 Lesser General Public License for more details.
2161 You should have received a copy of the GNU Lesser General Public
2162 License along with the m17n library; if not, write to the Free
2163 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA