comparison src/xterm.c @ 21548:5d1f1ba38043

(x_find_ccl_program): New function.
author Kenichi Handa <handa@m17n.org>
date Wed, 15 Apr 1998 07:12:49 +0000
parents fa9ff387d260
children 9d02cc13f771
comparison
equal deleted inserted replaced
21547:b2295127eff0 21548:5d1f1ba38043
6778 for (i = 0; i < dpyinfo->n_fonts; i++) 6778 for (i = 0; i < dpyinfo->n_fonts; i++)
6779 if (!strcmp (dpyinfo->font_table[i].name, fontname) 6779 if (!strcmp (dpyinfo->font_table[i].name, fontname)
6780 || !strcmp (dpyinfo->font_table[i].full_name, fontname)) 6780 || !strcmp (dpyinfo->font_table[i].full_name, fontname))
6781 return (dpyinfo->font_table + i); 6781 return (dpyinfo->font_table + i);
6782 return NULL; 6782 return NULL;
6783 }
6784
6785 /* Find a CCL program for a font specified by FONTP, and set the memer
6786 `encoder' of the structure. */
6787
6788 void
6789 x_find_ccl_program (fontp)
6790 struct font_info *fontp;
6791 {
6792 extern Lisp_Object Vfont_ccl_encoder_alist, Vccl_program_table;
6793 extern Lisp_Object Qccl_program_idx;
6794 extern Lisp_Object resolve_symbol_ccl_program ();
6795 Lisp_Object list, elt, ccl_prog, ccl_id;
6796
6797 for (list = Vfont_ccl_encoder_alist; CONSP (list); list = XCONS (list)->cdr)
6798 {
6799 elt = XCONS (list)->car;
6800 if (CONSP (elt)
6801 && STRINGP (XCONS (elt)->car)
6802 && (fast_c_string_match_ignore_case (XCONS (elt)->car, fontp->name)
6803 >= 0))
6804 {
6805 if (SYMBOLP (XCONS (elt)->cdr) &&
6806 (!NILP (ccl_id = Fget (XCONS (elt)->cdr, Qccl_program_idx))))
6807 {
6808 ccl_prog = XVECTOR (Vccl_program_table)->contents[XUINT (ccl_id)];
6809 if (!CONSP (ccl_prog)) continue;
6810 ccl_prog = XCONS (ccl_prog)->cdr;
6811 }
6812 else
6813 {
6814 ccl_prog = XCONS (elt)->cdr;
6815 if (!VECTORP (ccl_prog)) continue;
6816 }
6817
6818 fontp->font_encoder
6819 = (struct ccl_program *) xmalloc (sizeof (struct ccl_program));
6820 setup_ccl_program (fontp->font_encoder,
6821 resolve_symbol_ccl_program (ccl_prog));
6822 break;
6823 }
6824 }
6783 } 6825 }
6784 6826
6785 6827
6786 /* Initialization. */ 6828 /* Initialization. */
6787 6829