ethiopic.el 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. ;;; ethiopic.el --- support for Ethiopic -*- coding: utf-8-emacs; -*-
  2. ;; Copyright (C) 1997, 2001-2012 Free Software Foundation, Inc.
  3. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
  4. ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011
  5. ;; National Institute of Advanced Industrial Science and Technology (AIST)
  6. ;; Registration Number H14PRO021
  7. ;; Keywords: multilingual, Ethiopic
  8. ;; This file is part of GNU Emacs.
  9. ;; GNU Emacs is free software: you can redistribute it and/or modify
  10. ;; it under the terms of the GNU General Public License as published by
  11. ;; the Free Software Foundation, either version 3 of the License, or
  12. ;; (at your option) any later version.
  13. ;; GNU Emacs is distributed in the hope that it will be useful,
  14. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. ;; GNU General Public License for more details.
  17. ;; You should have received a copy of the GNU General Public License
  18. ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  19. ;; Author: TAKAHASHI Naoto <ntakahas@m17n.org>
  20. ;;; Commentary:
  21. ;;; Code:
  22. (define-ccl-program ccl-encode-ethio-font
  23. '(0
  24. ;; In: R0:ethiopic (not checked)
  25. ;; R1:position code 1
  26. ;; R2:position code 2
  27. ;; Out: R1:font code point 1
  28. ;; R2:font code point 2
  29. ((r1 -= 33)
  30. (r2 -= 33)
  31. (r1 *= 94)
  32. (r2 += r1)
  33. (if (r2 < 256)
  34. (r1 = #x12)
  35. (if (r2 < 448)
  36. ((r1 = #x13) (r2 -= 256))
  37. ((r1 = #xfd) (r2 -= 208))
  38. ))))
  39. "CCL program to encode an Ethiopic code to code point of Ethiopic font.")
  40. (setq font-ccl-encoder-alist
  41. (cons (cons (purecopy "ethiopic") ccl-encode-ethio-font) font-ccl-encoder-alist))
  42. (set-language-info-alist
  43. "Ethiopic" '((setup-function . setup-ethiopic-environment-internal)
  44. (exit-function . exit-ethiopic-environment)
  45. (charset ethiopic)
  46. (coding-system utf-8-emacs)
  47. (coding-priority utf-8-emacs)
  48. (input-method . "ethiopic")
  49. (features ethio-util)
  50. (sample-text . "ፊደል")
  51. (documentation .
  52. "This language environment provides these function key bindings:
  53. [f3] ethio-fidel-to-sera-buffer
  54. [S-f3] ethio-fidel-to-sera-region
  55. [C-f3] ethio-fidel-to-sera-marker
  56. [f4] ethio-sera-to-fidel-buffer
  57. [S-f4] ethio-sera-to-fidel-region
  58. [C-f4] ethio-sera-to-fidel-marker
  59. [S-f5] ethio-toggle-punctuation
  60. [S-f6] ethio-modify-vowel
  61. [S-f7] ethio-replace-space
  62. [S-f9] ethio-replace-space
  63. [C-f9] ethio-toggle-space"
  64. )))
  65. ;; For automatic composition
  66. (aset composition-function-table ? 'ethio-composition-function)
  67. (aset composition-function-table ?፟ 'ethio-composition-function)
  68. (provide 'ethiopic)
  69. ;;; ethiopic.el ends here