1 2004-08-05 Kenichi Handa <handa@m17n.org>
3 * font-ft.c (mfont__ft_drive_otf): Fix sign of g->yoff. Support
6 2004-08-04 Kenichi Handa <handa@m17n.org>
8 * font-ft.c (mfont__ft_drive_otf): Call OTF_drive_gdef.
10 2004-08-02 Kenichi Handa <handa@m17n.org>
12 * font.c (mfont__score): If prop is MFONT_FOUNDRY or MFONT_FAMILY,
13 set val to 1 even if it is greater than 1.
15 * fontset.c (mfontset_modify_entry): Fix handling of the arg `how'.
17 2004-07-29 Kenichi Handa <handa@m17n.org>
19 * font-flt.c (run_rule, run_command, mfont__flt_run): Print more
20 debugging information.
22 * internal.h (MDEBUG_PRINT5): New macro.
24 * draw.c (layout_glyphs): Don't combine a zero width glyph with
25 the previous one if the zero width glyph has left or right
28 2004-07-26 Kenichi Handa <handa@m17n.org>
30 * m17n-X.c (xft_render): Pay attention to members left_padding and
31 right_padding of MGlyph.
33 * draw.c (visual_order): Allocate one more elements for arrays as
34 a workaround of fribidi bug.
35 (layout_glyphs): Fix previous change. Check MGlyph->combining_code
36 instead of MGlyph->bidi_sensitive.
37 (layout_glyph_string): Pay attentinon to
38 control->orientation_reversed when padding at the head or tail.
39 Fix adjustment of space glyph width.
40 (get_gstring): If cursor_width or cursor_bidi is changed, don't
43 * font-ft.c (mfont__ft_drive_otf): Set MGlyph->combining_code
44 instead of MGlyph->bidi_sensitive.
46 * internal-gui.h (MGlyph): Delete member bidi_sensitive.
48 2004-07-26 Kenichi Handa <handa@m17n.org>
50 * draw.c (visual_order): Don't treat combined glyphs specially.
51 (layout_glyphs): Don't get metrics glyphs that are already ready.
52 Pay attention to MGlyph->bidi_sensitive. Combine a glyph of zero
53 width with the previous one.
54 (draw_background): Fix bar cursor position on a r2l glyph.
56 * font-flt.c (FontLayoutCmdOTF): Move back from internal-gui.h.
57 (run_rule): Fix place of updating cluster_begin_pos and
59 (run_otf): Don't set left_padding.
61 * font-ft.c (adjust_anchor): Type of argument `code' changed.
63 (mfont__ft_drive_otf): Renamed back from mfont__ft_drive_gsub.
65 (mfont__ft_drive_gpos): Delete this function.
67 * font.h (mfont__ft_drive_otf): Renamed back from
69 (mfont__ft_drive_gpos): Delete extern.
71 * internal-gui.h (FontLayoutCmdOTF): Move back to font-flt.c.
72 (MGlyph): Delete member otf_cmd, add member bidi_sensitive.
74 2004-07-23 Kenichi Handa <handa@m17n.org>
76 * draw.c (layout_glyphs): Call mfont__ft_drive_gpos with glyphs of
79 * font-ft.c (mfont__ft_drive_gpos): Check bidi-level.
81 2004-07-22 Kenichi Handa <handa@m17n.org>
83 * font-flt.c (load_flt): Treat the symbol Mend as end-of-file.
85 2004-07-20 Kenichi Handa <handa@m17n.org>
87 * draw.c (render_glyphs): Fix checking of g->code validity.
89 * face.c (mface__realize): Set g.type.
91 2004-07-18 Kenichi Handa <handa@m17n.org>
93 * Makefile.am: Prepend ${top_srcdir} to all *.la in
96 * m17n-gui.c (mframe): Print error message give by dlopen to
99 2004-07-16 Kenichi Handa <handa@m17n.org>
101 * draw.c (compose_glyph_string): Improve the way of deciding a
102 script. For a character that doesn't have script property, use
103 the last non-latin script.
105 * font-ft.c (fc_list): Cancel previous change.
106 (mfont__ft_init): Add more entries in ft_to_prop_name.
108 2004-07-15 Kenichi Handa <handa@m17n.org>
110 * draw.c (mdraw_glyph_list): Add the width of padding glyphs to
111 previous or next character glyphs.
113 2004-07-14 Kenichi Handa <handa@m17n.org>
115 * draw.c (compose_glyph_string): Be sure to set codes for glyphs
118 * fontset.c (mfont__lookup_fontset): If glyph type is
119 GLYPH_SPACE, get codes for SPACE.
121 * internal-gui.h (Mfont): Delete extern.
123 * m17n-gui.h (Mfont): Delete duplicated extern.
125 2004-07-13 Kenichi Handa <handa@m17n.org>
127 * font-ft.c (DEVICE_DELTA): New macro.
128 (adjust_anchor): New function.
129 (mfont__ft_drive_gsub): Renamed from mfont__ft_drive_otf. Drive
131 (mfont__ft_drive_gpos): New function.
133 * font-flt.c (FontLayoutCmdOTF): Moved to internal-gui.h.
134 (FontLayoutContext): Delete member `rfont'.
135 (run_otf): Set g->otf_cmd. Call
136 (mfont__flt_run): Don't set ctx.rfont. Call mfont__ft_decode_otf
137 only whne HAVE_OTF is defined.
139 * fontset.c: Include "config.h".
141 * internal-gui.h (FontLayoutCmdOTF): Moved from font-flt.c.
142 (MGlyph): New member otf_cmd.
144 * font.h (mfont__ft_drive_gsub): Changed from mfont__ft_drive_otf.
145 (mfont__ft_drive_gpos): Extern it.
147 * face.c: Include "config.h".
149 * draw.c (layout_glyphs): Call mfont__ft_drive_gpos.
151 * input-gui.c: Include "config.h".
153 * plist.c: Include "config.h".
155 2004-07-06 Kenichi Handa <handa@m17n.org>
157 * m17n-gui.c, m17n-gui.h, m17n-gd.c, m17n-X.h, m17n-X.c,
158 internal-gui.h: Cancel previous changes.
160 * m17n-gd.h: Delete it.
162 * Makefile.am (libm17n_core_la_LIBADD): New variable.
163 (libm17n_core_la_LDFLAGS): Add -export-dynamic, move
164 @XML2_LD_FLAGS@ to above.
165 (libm17n_la_LIBADD): Add -ldl.
166 (libm17n_la_LDFLAGS): Add -export-dynamic.
167 (X_LD_FLAGS): Fix the order of linking.
168 (libm17n_gui_la_LIBADD): Add ${OPTIONAL_LD_FLAGS}.
169 (libm17n_gui_la_LDFLAGS): Add -export-dynamic, delete above.
170 (libm17n_X_la_LDFLAGS): Add -module.
171 (libm17n_gd_la_SOURCES): Delete m17n-gd.h.
172 (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
173 (libm17n_gd_la_LDFLAGS): Add -module.
174 (include_HEADERS): Delete m17n-gd.h.
176 2004-06-30 Kenichi Handa <handa@m17n.org>
178 * m17n-gui.c: Adjusted for the change of struct MDeviceDriver.
179 (MDeviceLibraryInterface): Delete it.
180 (register_device_library): Delete it.
181 (m17n__device_library_list): Renamed from device_library_list.
183 * m17n-gui.h (M17N_INIT_X, M17N_INIT_GD): New macros.
184 (m17n_init_win): Adjust prototype.
186 * m17n-gd.c: Adjusted for the change of struct MDeviceDriver.
187 (m17n_init_gd): New function.
189 * m17n-gd.h: New file.
191 * m17n-X.h: Include <m17n-gui.h>.
192 (m17n_init_X): Extern it.
193 (M17N_INIT): Redefine it.
195 * m17n-X.c: Adjusted for the change of struct MDeviceDriver.
196 (m17n_init_X): New function.
198 * internal-gui.h (m17n__device_library_list): Extern it.
199 (struct MDeviceDriver): New members initialized, init, and fini.
201 * Makefile.am (libm17n_X_la_LIBADD): Add ${X_LD_FLAGS} and
203 (libm17n_X_la_LIBADD): Delete aboves.
204 (libm17n_gd_la_SOURCES): Add m17n-gd.h.
205 (libm17n_gd_la_LIBADD): Add @GD_LD_FLAGS@.
206 (libm17n_gd_la_LDFLAGS): Delete it.
207 (include_HEADERS): Add m17n-gd.h.
209 2004-06-25 Kenichi Handa <handa@m17n.org>
211 * Makefile.am (libm17n_X_la_LDFLAGS): Cancel previous change.
212 (libm17n_gd_la_LDFLAGS): Cancel previous change.
214 * m17n-gd.c (gd_render): Don't call FT_Get_Char_Index.
216 * font-ft.c (fc_list): If FcFontList finds no font, try
219 * draw.c (compose_glyph_string): Terminate the last loop after
220 doing default combining if necessary.
222 2004-06-24 Kenichi Handa <handa@m17n.org>
224 * draw.c (mdraw_glyph_list): Unref gstring->top at the tail.
226 * character.c (mchar_define_property): Add const to an arg.
228 * charset.c (mchar_define_charset): Add const to an arg.
230 * coding.c (MCodingSystem): Add const to an arg or decoder.
231 (finish_decoding): Add const to an arg.
232 (decode_coding_charset, decode_coding_utf_8)
233 (decode_coding_utf_16, decode_coding_utf_32)
234 (decode_coding_iso_2022, decode_coding_sjis)
235 (mconv_define_coding): Likewise.
237 * m17n-X.c (xft_find_metric): Delete unused variable.
239 * m17n-core.h (mchar_define_property, mtext_from_data): Adjust
242 * m17n.h (mchar_define_charset, mconv_define_coding): Adjust
245 * mtext.c (count_utf_8_chars, count_utf_16_chars)
246 (mtext__from_data, mtext_from_data): Add `const' to an arg.
248 * mtext.h (mtext__from_data): Ajust prototype.
250 2004-06-23 Kenichi Handa <handa@m17n.org>
252 * draw.c (compose_glyph_string): Always get glyph codes by
254 (mdraw_glyph_info): Set info->glyph_code and info->logical_width.
255 (mdraw_glyph_list): New function.
257 * font-flt.c (mfont__flt_run): Be sure to call
258 rfont->driver->encode_char.
260 * font-ft.c (ft_find_metric): Don't call FT_Get_Char_Index.
261 (ft_encode_char): Delete arg C.
262 (ft_render): Don't call FT_Get_Char_Index.
264 * font.c (mfont__encodable_p): Delete it.
265 (mfont__encode_char): Be sure to call rfont->driver->encode_char.
267 * font.h (struct MFontDriver): Delete arg C of encode_char.
268 (mfont__encodable_p): Delete extern.
270 * m17n-X.c (xfont_encode_char): Delete arg C.
271 (xft_find_metric): Don't cal FT_Get_Char_Index.
272 (xft_render): Likewise.
274 * m17n-gui.h (MDrawGlyphInfo): New members glyph_code and
276 (mdraw_glyph_list): Extern it.
278 * Makefile.am (libm17n_X_la_LDFLAGS): Don't include ${X_LD_FLAGS}.
280 2004-06-22 Kenichi Handa <handa@m17n.org>
282 * m17n-gui.h (mfontset_lookup): Extern it.
284 * m17n-gui.c (m17n_init_win): Delete unnecessary printing.
286 * fontset.c (realize_fontset_elements)
287 (free_realized_fontset_elements, update_fontset_elements): New
289 (mfont__realize_fontset): Call realize_fontset_elements.
290 (mfont__free_realized_fontset): Call free_realized_fontset_elements.
291 (mfont__lookup_fontset): If a fontset was modified, update
292 the realized fontset.
293 (mfontset_modify_entry): Increment fontset->tick.
294 (mfontset_lookup): New function.
296 2004-06-21 Kenichi Handa <handa@m17n.org>
298 * font-ft.c (mfont__ft_parse_name): Cast the arg to FcNameParse.
300 * mtext.c (mtext_dup, mtext_cat, mtext_ncat, mtext_cpy)
301 (mtext_ncpy, mtext_duplicate): Pay attention to the case that the
302 length of source text 0.
304 2004-06-21 Kenichi Handa <handa@m17n.org>
306 * mtext.c (INC_POSITION): Use CHAR_UNITS_BY_HEAD_UTF16.
307 (compare): Pay attention to format other than utf-8.
308 (copy): Delete this function.
309 (count_by_utf_8, count_by_utf_16, insert): New functions.
310 (count_utf_16_chars): Fix handling of a surrogate pair.
311 (find_char_forward, find_char_backward): Likewise.
312 (mtext__from_data): Delete unnecessary check. Fix number of
314 (mtext_from_data): Don't count items.
315 (mtext_ref_char): Optimize the code.
316 (mtext_set_char): Pay attention to format other than utf-8.
317 (mtext_cat_char): Likewise.
318 (mtext_dup): Don't call copy, instead do allocation here.
319 (mtext_cat): Call insert instead of copy.
320 (mtext_ncat): Likewise.
321 (mtext_cpy): Delete character at first and call insert instead of
323 (mtext_ncpy): Likewise.
324 (mtext_copy): Likewise.
325 (mtext_duplicate): Call insert instead of copy.
326 (mtext_del): Pay attention to format other than utf-8.
327 (mtext_ins): Simply call insert.
328 (mtext_ins_char): Pay attention to format other than utf-8.
329 (mtext_tok): Call insert instead of copy.
330 (mtext_text): Call UNIT_BYTES.
332 * textprop.c (mtext__adjust_plist_for_change): New function.
334 * character.h (USHORT_SIZE, UINT_SIZE, UNIT_BYTES): New macros.
335 (CHAR_UNITS_UTF16, CHAR_UNITS): Simplified.
336 (CHAR_UNITS_AT): Fix typo.
337 (CHAR_UNITS_BY_HEAD): Fix typo.
338 (STRING_CHAR_AND_UNITS): Fix typo.
340 * internal.h (MTEXT_READ_ONLY_P): New macro.
342 * mtext.h (mtext__replace): Delete the extern.
343 (mtext__adjust_foramt): Adjust prototype.
345 * plist.c (mplist_deserialize): Adjust the format of MT to utf-8
346 if possible. Otherwise make a copy of mmt.
348 * coding.c (mconv_decode, mconv_gets): Adjust the format of MT to
351 2004-06-18 Kenichi Handa <handa@m17n.org>
353 * character.h (CHAR_STRING_UTF16): Fix syntax.
355 2004-06-16 Kenichi Handa <handa@m17n.org>
357 * Makefile.am (libm17n_gd_la_LIBADD): Delete it.
358 (libm17n_X_la_LIBADD): Delete it.
359 (libm17n_gd_la_LDFLAGS): Don't include @GD_LD_FLAGS@.
361 * m17n-X.c (device_open): Add parens in `if' condition.
363 * mtext.c (INC_POSITION): Handle format other than utf8 and utf16.
364 (DEC_POSITION): Likewise.
365 (compare): Fix case that mt1->format is MTEXT_FORMAT_UTF_8.
367 2004-06-15 Kenichi Handa <handa@m17n.org>
369 * fontset.c (mfont__lookup_fontset): Fix selection of font groups
372 * draw.c (compose_glyph_string): If langauge is specified, call
373 mface__for_chars even if a text is all latin. Fix condition for
374 setting non_ascii_found.
376 * m17n-X.c (xft_find_metric): Fix setting of g->lbrearing.
378 * m17n.h (minput_char_to_key): Delete extern.
380 * m17n-gui.h (minput_event_to_key): Cancel previous change.
382 * m17n-gui.c (null_device_open): Set several members of frame.
384 2004-06-14 Kenichi Handa <handa@m17n.org>
386 * m17n-gui.h (minput_event_to_key): Delete extern.
388 * symbol.h (struct MSymbolStruct): Renamed from MSymbol.
390 * m17n-core.h (MSymbol): Defined as "struct MSymbolStruct *".
392 * Makefile.am (AM_CPPFLAGS): Refer to @M17NDIR@.
394 2004-06-08 Kenichi Handa <handa@m17n.org>
396 * character.c (mchar_put_prop): Don't increment the ref-count of
399 2004-06-04 Kenichi Handa <handa@m17n.org>
401 * m17n-core.c (mdebug__register_object): New function.
402 (mdebug__unregister_object): Likewise.
404 * internal.h (mdebug__register_object, mdebug__unregister_object):
406 (M17N_OBJECT_REGISTER, M17N_OBJECT_UNREGISTER): Call them
409 * charset.c (mcharset__load_from_database): Don't call
410 mconv__register_charset_coding here.
412 * coding.c (find_coding): Get a real name from an element of
413 coding_definition_list.
414 (mconv__register_charset_coding): Set the real name at the top of
416 (mcoding__load_from_database): Likewise.
417 (mconv_list_codings): Adjusted for the above change.
419 2004-06-03 Kenichi Handa <handa@m17n.org>
421 * coding.c (find_coding): Find by canonicalized name. Don't have
422 to modify the element of coding_definition_list by
424 (mconv__define_coding_from_charset): Delete it.
425 (mconv__register_charset_coding): Canonicalize sym.
426 (mcoding__load_from_database): Register plist modified by
429 * coding.h (mconv__define_coding_from_charset): Don't extern it.
431 * font-ft.c (ft_open): Fix setting of rfont->descent.
433 2004-06-02 Kenichi Handa <handa@m17n.org>
435 * font.c (enum xlfd_field_idx): Moved from m17n-X.c.
436 (xlfd_parse_name): Merge split_font_name and xfont_parse_name.
437 (xlfd_unparse_name): Renamed from xfont_build_name.
438 (mfont__init): Initialized Mfontconfig.
439 (mfont__free_realized): Unconditionally unref rfont->info.
440 (mfont__select): Free `this' if it's not best.
441 (mfont__open): Don't check frame->realized_font_list.
442 (mfont__parse_name_into_font): New function.
443 (Mfontconfig): New variable.
444 (mfont_from_name): Call mfont_parse_name.
445 (mfont_name): Call mfont_unparse_name.
446 (mdebug_dump_font): Likewise.
448 * font.h (struct MFontDriver): Delete members parse_name and
450 (mfont__ft_parse_name, mfont__ft_unparse_name): Extern them.
451 (mfont__parse_name_into_font): Extern it.
453 * font-ft.c: Include "symbol.h".
454 (close_ft): Unconditionally free filename and charmap_list of
456 (ft_open): Duplicate base->filename. Increment ref-count of
457 ft_info->charmap_list. Free ft_info->charmap_list and
458 ft_info->filename on error.
459 (mfont__ft_parse_name, mfont__ft_unparse_name): New functions.
461 * m17n-X.c (xfont_driver): Don't include xfont_parse_name and
463 (enum xlfd_field_idx): Moved to font.c.
464 (split_font_name, build_font_name): Likewise.
465 (build_font_list): Call mfont__parse_name_info_font.
466 (xfont_open): Call mfont__unparse_name. Free name.
467 (xfont_parse_name, xfont_build_name): Moved to font.c
468 (xft_select): Prototype deleted.
469 (device_open): Check HAVE_FREETYPE on using mfont__ft_driver.
470 Call mfont_pase_name.
472 * m17n-gui.c (free_frame): Unref frame->font_driver_list.
473 (m17n_fini_win): Add check HAVE_FREETYPE on using null_interface.
476 * m17n-gui.h (mfont_parse_name, mfont_unparse_name, Mfontconfig):
479 * Makefile.am (linkgui_LDADD): Add libm17n-X.la and libm17n-gd.la.
481 2004-06-01 Kenichi Handa <handa@m17n.org>
483 * fontset.c (mfontset_modify_entry): Pay attention to the case
484 that fontset->font_spec_list is NULL.
486 2004-05-31 Kenichi Handa <handa@m17n.org>
488 * m17n-gui.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
490 * input.c: Include <dlfcn.h> only when HAVE_DLFCN_H is defined.
492 * font.c (mfont__select): Print score the a font for debugging.
494 * Makefile.am (libm17n_la_LIBADD): Delete -ldl.
496 * coding.c (reset_coding_sjis): Check kanji and kana instead of
497 kanji_sym and kana_sym.
499 2004-05-28 Kenichi Handa <handa@m17n.org>
501 * Makefile.am (VINFO): New variable.
502 (libm17n_core_la_LDFLAGS, libm17n_la_LDFLAGS)
503 (libm17n_gd_la_LDFLAGS): Include ${VINFO}.
505 2004-05-27 Kenichi Handa <handa@m17n.org>
507 The following chanages are to make device dependent functions
508 accessible only from MDeviceDriver structure, and to add GD and
509 null device drivers. Font drivers get also device dependent.
511 * m17n.c (m17n_init): Increament shell_initialized.
512 (m17n_fini): Decremented shell_initialized.
514 * m17n-misc.h (enum MErrorCode): New element MERROR_GD.
516 * m17n-gui.h (Mdevice, Mdisplay, Mscreen, Mdrawable, Mdepth)
517 (Mwidget, Mcolormap, Mx): Extern them.
519 * m17n-gui.c: Include <dlfcn.h> and "config.h".
520 (free_frame): Call frame->driver->close instead of
522 (DLOPEN_SHLIB_EXT): New macro.
523 (MDeviceLibraryInterface): New type.
524 (device_library_list): New variable.
525 (register_device_library): New function.
526 (null_device): New variable.
527 (null_device_close, null_device_get_prop)
528 (null_device_realize_face, null_device_free_realized_face): New
530 (null_driver): New variable.
531 (null_device_init, null_device_fini, null_device_open): New
533 (null_interface): New variable.
534 (Mfreetype, Mdevice): Declare them.
535 (m17n_init_win): Increment win_initialized. Initialize Mx, Mgd,
536 Mfreetype, Mdevice, Mdisplay, Mscreen, Mdrawable, Mdevice, and
537 Mwin__Close_Device. Register drivers for Mx and Mgd.
538 (m17n_fini_win): Decremented win_initialized. Call "fini"
539 function of all opened devices. Don't call mwin__fini.
540 (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap):
542 (mframe): Handle Mdevice key of PLIST.
543 (mframe_get_prop): Call frame->device->get_prop instead of
544 mwin__device_get_prop.
546 * m17n-gd.c: New file.
548 * m17n-core.h (M17NLIB_MAJOR_VERSION, M17NLIB_MINOR_VERSION)
549 (M17NLIB_PATCH_LEVEL, M17NLIB_VERSION_NAME): Updated to 1.1.0.
551 * m17n-core.c (m17n_init_core): Increate core_initialized.
552 (m17n_fini_core): Decremented core_initialized.
554 * m17n-X.h (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget)
555 (Mcolormap): Don't extern them here.
557 * m17n-X.c (FRAME_DEVICE): New macro.
558 (FRAME_DISPLAY, FRAME_SCREEN, FRAME_CMAP): Use FRAME_DEVICE.
559 (free_display_info): Use MPLIST_DO.
560 (free_device): Free rface->info.
561 (xft_close): Delete it.
562 (device_init): Renamed from mwin__init.
563 (device_fini): Renamed from mwin__fini.
564 (device_open): Renamed from mwin__open_device.
565 (x_driver): New variable.
566 (MXFontInfo): Delete member frame, add member display.
567 (Mdisplay, Mscreen, Mdrawable, Mdepth, Mwidget, Mcolormap, Mxim):
568 Don't declare them here.
570 * internal-gui.h (MDeviceType): New enum.
571 (MWDefice): Delete it.
572 (struct MFrame): Change type of device to void *. New members
573 device_type, driver, font_driver_list.
574 (M_CHECK_WRITABLE, M_CHECK_READABLE): New macros.
575 (MDeviceDriver): New type.
576 (Mx, Mgd, Mfreetype): Extern them.
577 (mwin__XXX): Delete all of them.
579 * input-gui.c (win_create_ic): Call frame->driver->XXX instead of
581 (win_destroy_ic): Likewise.
582 (adjust_window_and_draw): Likewise.
583 (win_callback): Likewise.
584 (Mxim): Declare it here.
585 (minput_event_to_key): Call M_CHECK_READABLE.
587 * fontset.c (mfont__lookup_fontset): Delete local variable
590 * font.h (struct MFontDriver): Delete member close, add members
591 parse_name and build_name.
592 (mfont__driver_list): Delete extern.
593 (mfont__close): Delete extern.
595 * font.c (mfont__init): Don't set mfont__driver_list.
596 (mfont__fini): Don't unref mfont__driver_list.
597 (mfont__select): Try font drivers in frame->font_driver_list. Set
598 driver member of a realized font.
599 (mfont__close): Delete it.
600 (mfont_from_name, mfont_name, mdebug_dump_font): Call driver
601 functions of the default frame.
603 * font-ft.c (close_ft): Check ft_info->ft_face and work
605 (add_font_info): Allocate ft_info by M17N_OBJECT.
606 (ft_close): Delete it.
607 (mfont__ft_driver): Don't set ft_close.
608 (ft_select): Increment ref-count of best_font.
609 (ft_open): Decremented ref-count of base. On error, call
610 FT_Done_Face and free ft_info.
611 (ft_find_metric): Always use XXX_MONO in load_flags.
612 (ft_render): Fix setting of width. Call
613 frame->driver->draw_points instead of mwin__draw_points.
614 (ft_to_prop): Don't set mfont__driver_list.
615 (mfont__ft_fini): Just unref ft_info.
617 * face.c (mface__init): Exchange foreground and background of
618 mface__default. Call mface_put_prop to set hline of
620 (mface__realize): Call frame->driver->XXX instead of mwin__XXX.
621 (mface__free_realized): Don't call mwin__free_realized_face.
623 * draw.c (Mdepth): Don't declare it here.
624 (draw_background): Call frame->driver->XXX instead of mwin__XXX.
625 (render_glyphs, render_glyph_string): Likewise.
626 (mdraw__init): Don't set Mdepth.
627 (mdraw_text, mdraw_image_text, mdraw_text_with_control): Call
629 (mdraw_text_per_char_extents): Return 0 on success and -1 on
631 (mdraw_text_items): Check FRAME is writable.
632 (mdraw_per_char_extents): Implement body.
634 * Makefile.am (lib_LTLIBRARIES): Include libm17n-gui.la and
636 (OPTIONAL_LD_FLAGS): Include @FONTCONFIG_LD_FLAGS@.
637 (GUI_SOURCES): Delete it.
638 (libm17n_X_la_SOURCES): Don't include ${GUI_SOURCES}.
639 (libm17n_gui_la_SOURCES, libm17n_gui_la_LIBADD)
640 (libm17n_gui_la_LDFLAGS, libm17n_gd_la_SOURCES)
641 (libm17n_gd_la_LIBADD, libm17n_gd_la_LDFLAGS): New targets.
642 (linkgui_LDADD): Set to libm17n-gui.la
643 (linkgui_LDFLAGS): New target.
644 (SRC): Include ${libm17n_gui_la_SOURCES} and
645 ${libm17n_gd_la_SOURCES}.
647 2004-05-24 Kenichi Handa <handa@m17n.org>
649 * draw.c (draw_background): Don't draw background even if
650 rface->face.property[MFACE_BACKGROUND] is not Mnil.
652 2004-05-22 Kenichi Handa <handa@m17n.org>
654 * m17n-X.c (xft_open_font): Fix anti_alias setting.
656 2004-05-20 Kenichi Handa <handa@m17n.org>
658 * m17n-gui.h (MFaceHookFunc): Change this function type to void.
660 * m17n-gui.c: Include "plist.h".
661 (mframe): If PLIST is NULL, initialize it to emply plist.
663 * m17n-X.c (build_font_list): Don't set property[MFONT_TYPE].
664 (xft_driver): New variable.
665 (xft_select, close_xft, xft_open_font, xft_open, xft_close)
666 (xft_find_metric, xft_render): New function.
667 (mwin__init): Adjusted for the new mfont__driver_list.
668 (mwin__open_device): Assume arg PARAM is not NULL. Push a newly
669 generated face to PARAM.
670 (mwin__realize_face): Fix setting of box colors. Don't call hook
672 (mwin__draw_hline): New function.
673 (mwin__xft_close, mwin__xft_open, mwin__xft_get_metric)
674 (mwin__xft_render): Delete these function.
676 * internal-gui.h (struct MFrame): New member tick.
677 (struct MGlyphString): New member tick.
678 (mwin__draw_rect, mwin__draw_empty_boxes): Extern them.
679 (mwin__xft_open, mwin__xft_close, mwin__xft_get_metric)
680 (mwin__xft_render): Delete extern.
682 * fontset.c (mfont__lookup_fontset): Make the code simpler.
683 (mfontset): Always increment the reference count of returned
686 * font-ft.c (mfont__ft_fini): Don't include <otf.h> here.
687 (MFTInfo): Moved to font.h.
688 (ft_iso8859_1_font_list): Delete this variable.
689 (set_font_info): Don't set font->property[MFONT_TYPE].
690 (set_font_info): Don't udpate ft_iso8859_1_font_list.
691 (add_font_info): Change type to void.
692 (fc_list): Change anme from xft_list. Caller changed. Include
693 FC_FOUNDRY and FC_PIXEL_SIZE in FcObjectSet.
694 (mfont__ft_driver): Change name from ft_driver. Caller changed.
695 (ft_select): Check HAVE_FONTCONFIG instead of HAVE_XFT2.
696 (close_ft): Don't call mwin__xft_close. Unref
698 (ft_open): Don't setup ft_info->fontname. Don't call
700 (ft_find_metric): Don't call mwin__xft_get_metric.
701 (ft_encode_char): Call rfont->driver->open instead of ft_open.
702 (ft_render): Don't check HAVE_XFT2. Don't call mwin__xft_render.
703 (mfont__ft_init): Adjusted for new mfont__driver_list.
704 (mfont__ft_fini): Don't unref ft_iso8859_1_font_list.
706 * font.c (mfont__driver_list): Make it MPlist.
707 (mfont__init): Adjust initialization of mfont__driver_list.
708 (mfont__fini): Free mfont__driver_list.
709 (mfont__set_spec_from_face): Don't set spec->property[MFONT_TYPE].
710 (mfont__select): Adjusted for the new mfont__driver_list.
712 * font.h (enum MFontProperty): Delete MFONT_TYPE.
713 (mfont__drirver_list): Adjust prototype.
714 (MFTInfo): Move to here from fron.c. Deleve member fontname.
716 * face.h (struct MFace): Delete member realized_face_list, add
718 (struct MRealizedFace): Delete member need_update
719 andnofont_rface, add member non_ascii_list.
720 (mface__update_frame_face): Extern it.
722 * face.c (hline_prop_list, box_prop_list, noop_hook): New
724 (get_hline_create, get_box_create): New functions.
725 (find_realized_face): Cancel previous change. Arg RFONT deleted.
727 (free_face): Cancep previous change. Free face->frame_list.
728 (serialize_hline): Do nothing if hline->width is zero.
729 (serialize_box): Do nothing if box->width is zero.
730 (mface__init): Setup all properties of mface__default.
731 (mface__fini): Free hline_prop_list and box_prop_list.
732 (mface__realize): Cancel previous change. Update
733 face->frame_list. Setup rface->non_ascii_list.
734 (mface__for_chars): Update rface->non_ascii_list.
735 (mface__free_realized): Free rface->non_ascii_list.
736 (mface__update_frame_face): New function.
737 (mface): Initialize face->frame_list.
738 (mface_copy): Likewise. Just copy MFACE_HLINE and MFACE_BOX
740 (mface_merge): Likewise.
741 (mface_put_prop): If key is Mhline or Mbox, get value by
742 get_hline_create or get_box_create respectively.
743 (mface_put_prop): Update frame->tick and call
744 mface__update_frame_face if necessary.
745 (mface_update): Do nothing if func is noop_hook.
747 * draw.c (render_glyphs): If a font is not found, use
748 mwin__draw_empty_boxes.
749 (alloc_gstring): Initialize gstring->tick.
750 (get_gstring): Check gstring->tick.
752 2004-05-17 Kenichi Handa <handa@m17n.org>
754 * face.c (find_realized_face): Return value changed. If RFONT is
755 NULL, avoid unnecessary checking.
756 (free_face): Free face->realized_face_list.
757 (mface__realize): Adjusted for the change of find_realized_face.
758 If it returns a realized face that needs update, free it and
759 realize a new one. Push a new realized face to
760 frame->realized_face_list instead of appending.
761 (mface__for_chars): Adjusted for the change of find_realized_face.
762 Short cut if the required font is in rface->ascii_rface.
763 (mface_put_prop): Free old value if necessary. Set need_update
764 member of realized faces to 1.
766 * face.h (struct MFace): Delete member tick, add member
768 (struct MRealizedFace): Delete member tick, add member
771 2004-05-13 Kenichi Handa <handa@m17n.org>
773 * m17n-X.c (mwin__xft_open): Destroy unnecessary patterns.
775 2004-05-12 Kenichi Handa <handa@m17n.org>
777 * internal-gui.h (mwin__xft_open): Arguemnt name changed.
779 * m17n-X.c (mwin__xft_open): Argument changed to fontname and
780 parse it XftNameParse.
782 * font-ft.c (MFTInfo) [HAVE_XFT2]: New member fontname.
783 (all_fonts_scaned): New variable.
784 (set_font_info): FAMILY may be Mnil.
785 (add_font_info): Argument changed.
786 (xft_list): Call add_font_info in it.
788 (ft_select): Make it work in the case family is Mnil.
789 (ft_open) [HAVE_XFT2]: Setup ft_info->fontname.
790 (mfont__ft_fini): Set all_fonts_scaned to 0.
792 * fontset.c (mfont__lookup_fontset): Don't repeatedly try a font
793 that is failed to open.
795 2004-05-10 Kenichi Handa <handa@m17n.org>
797 * m17n-X.c (mwin__xft_render): Don't use anti-alias if the
798 device's depth is 1 (i.e. monochrome).
800 * Makefile.am (OPTIONAL_LD_FLAGS): Change the order of elements
801 to work around the problem of libtool.
803 * font-ft.c: Include <freetype/ftbdf.h>.
804 (Municode_bmp, Municode_full, Miso10646_1, Miso8859_1): New
806 (mfont__ft_init): Initialize them.
807 (ft_iso8859_1_font_list): New variable.
808 (set_font_info): Detect a font containing iso8859-1 glyphs and
809 register it in ft_iso8859_1_font_list. If the font is not
810 scalable, assume it as BDF or PCF font and setup SIZE and RESY
811 properties of the font from its properties.
812 (add_font_list): If the font is not scalable, check if it is BDF
813 or PCF font. If not, ignore it.
814 (ft_select): If FAMILY is Mnil, return NULL only if the requested
815 registry is not iso8859-1.
816 (ft_select) [not HAVE_XFT2]: If FAMILY is Mnil, select one from
817 ft_iso8859_1_font_list.
818 (ft_find_metric): If the font is not scalable, assume it as BDF
819 or PCF, and get a metric from its properties.
820 (mfont__ft_fini): Free ft_iso8859_1_font_list.
822 2004-05-07 Kenichi Handa <handa@redhat.m17n.org>
824 * Makefile.am (libm17n_la_LIBADD): Include -ldl.
825 (libm17n_la_LDFLAGS): Delete it.
826 (noinst_PROGRAMS): Renamed from bin_PROGRAMS.
827 (install-binPROGRAMS, uninstall-binPROGRAMS): Delete them.
829 2004-05-06 Kenichi Handa <handa@m17n.org>
831 * draw.c (compose_glyph_string): Fix previous change.
833 2004-04-30 Kenichi Handa <handa@m17n.org>
835 * font-ft.c (ft_list): Delete unused variable `result'.
836 (ft_render): Fix for the case that bitmap.pitch < bitmap.width.
838 2004-04-27 Kenichi Handa <handa@m17n.org>
840 * m17n-X.c: Include config.h
841 [HAVE_XFT2]: Include <X11/Xft/Xft.h>.
842 (GCInfo) [HAVE_XFT2]: New member xft_color_fore, xft_color_back.
843 (MWDevice) [HAVE_XFT2]: New member xft_draw.
844 (FRAME_CMAP, FRAME_VISUAL): New macros.
845 (free_device) [HAVE_XFT2]: Destroy device->xft_draw.
846 (xfont_driver): Make it static.
847 (mwin__open_device) [HAVE_XFT2]: Setup device->xft_draw.
848 (mwin__realize_face) [HAVE_XFT2]: Setup info->xft_color_fore and
849 info->xft_color_back.
850 (MXftFontInfo) [HAVE_XFT2]: New type.
851 (mwin__xft_close) [HAVE_XFT2]: New function.
852 (mwin__xft_open) [HAVE_XFT2]: New function.
853 (mwin__xft_get_metric) [HAVE_XFT2]: New function.
854 (mwin__xft_render) [HAVE_XFT2]: New function.
856 * internal-gui.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
857 (mwin__xft_open, mwin__xft_close) [HAVE_FREETYPE]: New externs.
858 (mwin__xft_get_metric, mwin__xft_render) [HAVE_FREETYPE]: New
861 * font.h [HAVE_FREETYPE]: Include FT_FREETYPE_H.
863 * font-ft.c: Don't include FT_FREETYPE_H here.
864 [HAVE_XFT2]: Include <fontconfig/fontconfig.h>.
865 (fontconfig_initialized, fc_config) [HAVE_XFT2]: New variables.
866 (MFTInfo): New member charmap_index.
867 (MFTInfo) [HAVE_XFT2]: New member xft_info.
868 (check_otf_filename): Renamed from check_filename. Return value
870 (ft_set_property): This function deleted.
871 (set_font_info): New function.
872 (add_font_list): Argument changed. Add multiple fonts.
873 (xft_list) [HAVE_XFT2]: New function.
874 (ft_list) [not HAVE_XFT2]: New function.
875 (ft_select): Add code for Xft.
876 (close_ft): Likewise.
878 (ft_find_metric): Likewise.
879 (ft_encode_char): Likewise.
880 (ft_render): Likewise.
882 * makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@.
884 2004-04-26 Kenichi Handa <handa@m17n.org>
886 * textprop.c (mtext_attach_property): Declare the return type as
889 2004-04-21 Kenichi Handa <handa@m17n.org>
891 * Makefile.am (OPTIONAL_LD_FLAGS): Include @XFT2_LD_FLAGS@
893 2004-04-09 Kenichi Handa <handa@m17n.org>
895 * font-flt.c (struct): New members seq_beg, seq_end, seq_from,
897 (load_command): Setup above members.
899 2004-04-05 Kenichi Handa <handa@m17n.org>
901 * m17n-X.c (xfont_encode_char): Fix checking of byte1 and byte2.
903 2004-03-30 Kenichi Handa <handa@m17n.org>
905 * m17n-X.c (xfont_encode_char): Return MCHAR_INVALID_CODE if code
908 * m17n-core.h (M17NLIB_PATCH_LEVEL): Changed to 2.
909 (M17NLIB_VERSION_NAME): Changed to 1.0.2.
911 2004-03-29 Kenichi Handa <handa@m17n.org>
913 * Version 1.0 Patch Level 2 released.
915 2004-03-29 Kenichi Handa <handa@m17n.org>
917 * charset.c (make_charset): Set charset->fully_loaded and
918 charset->simple correctly. Don't try to get charset->min_char and
919 charset->max_char for a charset of method subset and superset.
920 Don't load a mapping file here.
921 (mcharset__init): Set unified_max.
922 (mcharset__load_from_database): Free a working plist.
924 * coding.c (mcoding__fini): Free all malloced data.
926 * input-gui.c (win_create_ic): Set control.as_image for preediting
929 * internal.h (M17N_OBJECT_REGISTER): Check the member `used' (not
930 `count') to initialize the array.
932 * locale.c (mlocale_set): Fix the order of M17N_OBJECT_REF and
935 * m17n-X.c (xfont_render): If rface->rfont is null, draw a
937 (mwin__create_window): Fix bug of setting a background pixel of a
939 (mwin__adjust_window): Clear the window before drawing.
941 * m17n-core.c (mdebug__report_object): Free array->objectes if
943 (m17n_init_core): Don't set report_header_printed to 0 here.
944 Fix debugging information.
945 (m17n_fini_core): Set report_header_printed to 0 here.
947 * m17n-core.h (mplist_deserialize): Extern it.
949 * m17n-gui.c (m17n_fini_win): Fix debugging information.
951 * m17n.c (m17n_fini): Fix debugging information.
953 * mtext.c (mtext__adjust_foramt): New function.
955 * mtext.h (mtext__adjust_foramt): Extern it.
957 * plist.c (mplist_deserialize): Renamed from mplist__deserialize.
959 * plist.h (mplist__deserialize): Don't extern it.
961 * symbol.c (msymbol__fini): Set freed_symbols to 0. Set all
962 elements of symbol_table to NULL. Report about created and freed
963 symbols if MDEBUG_FINI is set.
965 2004-03-22 Kenichi Handa <handa@m17n.org>
967 * m17n-core.c (m17n_init_core): Set merror_code to MERROR_NONE.
969 * m17n.c (m17n_init): Fix the way of checking merror_code.
971 * m17n-gui.c (m17n_init_win): Fix the way of checking merror_code.
973 2004-03-22 Kenichi Handa <handa@m17n.org>
975 * fontset.c (realize_font_group): Adjust the font size by
976 mfont__resize before selecting a font.
978 * font-ft.c (mfont__ft_init): Add oblique and boldoblique.
980 2004-03-19 Kenichi Handa <handa@m17n.org>
982 * Version 1.0 Patch Level 1 released.
984 2004-03-19 Kenichi Handa <handa@m17n.org>
986 * m17n-core.h (M17NLIB_PATCH_LEVEL): New macro.
988 * m17n-core.c (M17NLIB_PATCH_LEVEL): Describe it.
990 2004-03-19 Kenichi Handa <handa@m17n.org>
992 Re-apply the changes forgotten in the released version.
994 * charset.c (mcharset__load_from_database): Call
995 mchar_define_charset.
997 * coding.c (encode_unsupporeted_char): Put Mcoding text property.
998 (mconv_encode_range): Put Mcoding text property.
1000 2004-03-18 Kenichi Handa <handa@m17n.org>
1002 * draw.c (Mdepth): New variable.
1003 (visual_order): Delete unused local var `pos'.
1004 (compose_glyph_string): Fix for the case that gstring->glyphs is
1005 realloced. Stop generating glyphs at TO. Fix handling of
1007 (layout_glyphs): Get metrics of all glyphs in advance. Set
1008 lbearing and rbearing of base of composition glyph correctly.
1009 Handle left-overhang glyphs correctly.
1010 (alloc_gstring): New arg frame. Set gstring->anti_alias. Caller
1012 (dump_combining_code): Change the defualt off_x character to ".".
1013 (mdraw__init): Initialize Mdepth.
1015 * face.c (work_gstring): New variable
1016 (mface__init): Initialize work_gstring.
1017 (mface__fini): Free work_gstring.glyphs.
1018 (mface__realize): Don't handle videomode property here. Adjusted
1019 for the change of mfont__get_metric.
1020 (mface__for_chars): Adjusted for the change of mfont__get_metric.
1022 * face.h (enum face_gc): Moved to m17n-X.c.
1024 * font.h (struct MFontDriver): Arguments of find_metric changed.
1025 (mfont__select): Prototype adjusted.
1026 (mfont__get_metric): Likewise.
1027 (mfont__ft_drive_otf): Likewise.
1028 (mfont__flt_run): Likewise.
1030 * font.c (mfont__select): New argument layouter. If layouter is
1031 different in the registered font, make a new copy of realized
1033 (mfont__get_metric): Argument changed. Get metrics of multiple
1035 (mfont_find): Call mfont__select with layouter as Mnil.
1037 * font-flt.c (FontLayoutContext): New member rfont.
1038 (run_otf): Adjusted for the change of mfont__ft_drive_otf.
1039 (mfont__flt_run): Argument changed. Initialize ctx.rfont.
1041 * font-ft.c (ft_find_metric): Arguments changed. Get metrics of
1043 (NUM_POINTS): New macro.
1044 (MPointTable): New type.
1045 (ft_render): Use mwin__draw_points instead of mwin__draw_bitmap.
1046 (mfont__ft_drive_otf): New argument rfont.
1048 * fontset.c (realize_font_group): Adjusted for the changed of
1050 (check_fontset_element): This function deleted.
1052 * input-gui.c (adjust_window_and_draw): Locate a preedit window
1053 off the parent window if the preedit text is zero length.
1055 * internal-gui.h (struct MFrame): New members foreground,
1056 background, videomode, font.
1057 (struct MGlyphString): New member anti_alias.
1058 (MDrawPoint): New type.
1059 (mwin__draw_bitmap): Prototype deleted.
1060 (mwin__draw_points): Prototype added.
1062 * m17n-gui.h (MDrawControl): New member anti_alias.
1064 * m17n-gui.c (free_frame): Free frame->font.
1065 (mframe): Set the fontset of frame->face to the default fontset.
1067 * m17n-X.c (RGB_GC): New type.
1068 (enum gc_index): Renamed from enum face_gc. Member names changed.
1070 (struct MWDevice): Members foreground and background deleted. New
1071 member scratch_gc, gc_list.
1072 (DEFAULT_FONT, FALLBACK_FONT): New macros.
1073 (free_device): Free GCs in device->gc_list.
1074 (get_rgb_gc): New function.
1075 (get_gc): Renamed and argument changed from get_color.
1076 (get_gc_for_anti_alias): New function.
1077 (xfont_find_metric): Arguments changed. Get metrics of multiple
1079 (set_region): Argument changed. Caller changed.
1080 (xfont_render): Allways set a font in gc.
1081 (x_error_handler, x_io_error_handler): Define only if
1082 X_SET_ERROR_HANDLER is defined.
1083 (mwin__open_device): Create device->scratch_gc. Set members
1084 foreground, background, and videomode of frame. Call
1085 XSetErrorHandler and XSetIOErrorHandler only if
1086 X_SET_ERROR_HANDLER is defined.
1087 (struct gc_list): Deleted.
1088 (REGISTER_GC, UNREGISTER_GC): These macros deleted.
1089 (mwin__realize_face): Adjusted for the change of the format of
1090 rface->info and the charge of set_region.
1091 (mwin__free_realized_face, mwin__fill_space, mwin__draw_hline)
1092 (mwin__draw_box): Likewise.
1093 (mwin__draw_bitmap): This function deleted.
1094 (mwin__draw_points): New function.
1095 (mwin__verify_region): Adjusted for the change of the format of
1096 rface->info and the charge of set_region.
1097 (mwin__create_window): Inherit backgound pixel from parent.
1098 (mwin__dump_gc): Adjusted for the change of the format of
1101 2004-03-16 Kenichi Handa <handa@m17n.org>
1103 * m17n-X.c (mwin__parse_event): Fix handling of modifier keys.
1105 * input.c (M_key_alias): New variable.
1106 (handle_key): Try M_key_alias property of a key too.
1107 (minput__init): Initialize M_key_alias. Give that property to
1108 symbols in one_char_symbol. Fix bug of initializing
1111 * draw.c (compose_glyph_string): Don't handle
1112 ignore_formatting_char here. Include formatting characters in the
1113 range processed by a FTL.
1114 (layout_glyph_string): Handle ignore_formatting_char here.
1116 2004-03-12 Kenichi Handa <handa@m17n.org>
1118 * input-gui.c (win_create_ic): Enable bidi in status control.
1120 * draw.c (visual_order): Avoid re-ordering of combining glyphs only.
1122 2004-03-09 Kenichi Handa <handa@m17n.org>
1124 * input.c (load_input_method): If title is not specified, use the
1125 input method name as title.
1127 * m17n-X.c (get_color): Make it static.
1128 (xim_create_ic, xim_destroy_ic, x_error_handler)
1129 (x_io_error_handler): Likewise.
1131 2004-03-01 Kenichi Handa <handa@m17n.org>
1133 * Version 1.0 released.
1136 Copyright (C) 2003, 2004
1137 National Institute of Advanced Industrial Science and Technology (AIST)
1138 Registration Number H15PRO112
1140 This file is part of the m17n library.
1142 The m17n library is free software; you can redistribute it and/or
1143 modify it under the terms of the GNU Lesser General Public License
1144 as published by the Free Software Foundation; either version 2.1 of
1145 the License, or (at your option) any later version.
1147 The m17n library is distributed in the hope that it will be useful,
1148 but WITHOUT ANY WARRANTY; without even the implied warranty of
1149 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1150 Lesser General Public License for more details.
1152 You should have received a copy of the GNU Lesser General Public
1153 License along with the m17n library; if not, write to the Free
1154 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA