view admin/charsets/eucjp-ms.awk @ 90503:8e3ffc0a529f

(QCscalable, Qc, Qm, Qp, Qd): New variables. (syms_of_font): Initialize them. (font_pixel_size): Allow float value in dpi. (font_prop_validate_type): Deleted. (font_prop_validate_symbol, font_prop_validate_style): Argument changed. Caller changed. (font_prop_validate_non_neg): Renamed from font_prop_validate_size. (font_prop_validate_extra): Deleted. (font_prop_validate_spacing): New function. (font_property_table): Add elements for all known properties. (get_font_prop_index): Renamed from check_font_prop_name. New argument FROM. Caller changed. (font_prop_validate): Validate all known properties. (font_put_extra): Argument force deleted. Caller changed. (font_expand_wildcards): Make it static. Fix the way of shrinking the possible range. (font_parse_xlfd): Arguemnt merge deleted. Fix handling of RESX, RESY, SPACING, and AVGWIDTH. Don't validate property values here. Caller changed. (font_unparse_xlfd): Handle dpi, spacing, and scalable properties. (font_parse_fcname): Arguemnt merge deleted. Fix parsing of point size. Don't validate properties values here. Caller changed. (font_unparse_fcname): Handle dpi, spacing, and scalable properties. (font_open_by_name): Delete unused variable. (Ffont_spec): Likewise. Validate property values. (Ffont_match_p): New function.
author Kenichi Handa <handa@m17n.org>
date Wed, 28 Jun 2006 05:57:27 +0000
parents e0e4e6a0599f
children c50a10842bd9
line wrap: on
line source

# eucjp-ms.awk -- Generate a translation table for eucJP-ms.
# Copyright (C) 2004
#   National Institute of Advanced Industrial Science and Technology (AIST)
#   Registration Number H13PRO009
#
# This file is part of GNU Emacs.
#
# GNU Emacs is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# GNU Emacs is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Emacs; see the file COPYING.  If not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.

# Comment:

# eucJP-ms is one of eucJP-open encoding defined at this page:
#  http://www.opengroup.or.jp/jvc/cde/appendix.html

BEGIN {
  print ";;; eucjp-ms.el -- translation table for eucJP-ms. -*- no-byte-compile: t -*-";
  print ";;; Automatically genrated from eucJP-13th.txt, eucJP-udc.txt, eucJP-ibmext.txt";
  print "(let ((map";
  printf "       '(;JISEXT<->UNICODE";

  tohex["A"] = 10;
  tohex["B"] = 11;
  tohex["C"] = 12;
  tohex["D"] = 13;
  tohex["E"] = 14;
  tohex["F"] = 15;
}

function decode_hex(str) {
  n = 0;
  len = length(str);
  for (i = 1; i <= len; i++)
    {
      c = substr(str, i, 1);
      if (c >= "0" && c <= "9")
	n = n * 16 + (c - "0");
      else
	n = n * 16 + tohex[c];
    }
  return n;
}

/0x8F/ {
  code = decode_hex(substr($1, 5, 4));
  code -= 32896;		# code -= 0x8080
  printf "\n	 (#x%04x #x%s)", code, substr($2, 3, 4);
  next;
}

/0x[A-F]/ {
  code = decode_hex(substr($1, 3, 4));
  code -= 32896;		# code -= 0x8080
  printf "\n	 (#x%04x . #x%s)", code, substr($2, 3, 4);
}

END {
  print ")))";
  print "  (mapc #'(lambda (x)";
  print "	    (if (integerp (cdr x))";
  print "		(setcar x (decode-char 'japanese-jisx0208 (car x)))";
  print "	      (setcar x (decode-char 'japanese-jisx0212 (car x)))";
  print "	      (setcdr x (cadr x))))";
  print "	map)";
  print "  (define-translation-table 'eucjp-ms-decode map)";
  print "  (mapc #'(lambda (x)";
  print "	    (let ((tmp (car x)))";
  print "	      (setcar x (cdr x)) (setcdr x tmp)))";
  print "	map)";
  print "  (define-translation-table 'eucjp-ms-encode map))";
}

# arch-tag: d9cc7af7-2d6e-48cd-8eed-a6d25226de7c