X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/18cd1f1a08833b0baad21c1d7b13a6845d95cf57..5df4f04cd32af723742c81095b38ae83b3c2b462:/lisp/language/lao-util.el?ds=sidebyside diff --git a/lisp/language/lao-util.el b/lisp/language/lao-util.el index 6d3b985c0d..6c441a1f30 100644 --- a/lisp/language/lao-util.el +++ b/lisp/language/lao-util.el @@ -1,8 +1,9 @@ ;;; lao-util.el --- utilities for Lao -*- coding: iso-2022-7bit; -*- -;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 +;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; Free Software Foundation, Inc. -;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 +;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, +;; 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) ;; Registration Number H14PRO021 ;; Copyright (C) 2003 @@ -13,10 +14,10 @@ ;; This file is part of GNU Emacs. -;; GNU Emacs is free software; you can redistribute it and/or modify +;; 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 3, or (at your option) -;; any later version. +;; the Free Software Foundation, either version 3 of the License, 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 @@ -24,9 +25,7 @@ ;; 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., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GNU Emacs. If not, see . ;;; Commentary: @@ -492,20 +491,17 @@ syllable. In that case, FROM and TO are indexes to STR." lao-str))) ;;;###autoload -(defun lao-composition-function (pos &optional string) - (setq pos (1- pos)) - (with-category-table lao-category-table - (if string - (if (and (>= pos 0) - (eq (string-match lao-composition-pattern string pos) pos)) - (prog1 (match-end 0) - (compose-string string pos (match-end 0)))) - (if (>= pos (point-min)) - (save-excursion - (goto-char pos) - (if (looking-at lao-composition-pattern) - (prog1 (match-end 0) - (compose-region pos (match-end 0))))))))) +(defun lao-composition-function (gstring) + (if (= (lgstring-char-len gstring) 1) + (compose-gstring-for-graphic gstring) + (or (font-shape-gstring gstring) + (let ((glyph-len (lgstring-glyph-len gstring)) + (i 0) + glyph) + (while (and (< i glyph-len) + (setq glyph (lgstring-glyph gstring i))) + (setq i (1+ i))) + (compose-glyph-string-relative gstring 0 i 0.1))))) ;;;###autoload (defun lao-compose-region (from to) @@ -520,5 +516,5 @@ syllable. In that case, FROM and TO are indexes to STR." ;; (provide 'lao-util) -;;; arch-tag: 1f828781-3cb8-4695-88af-8f33222338ce +;; arch-tag: 1f828781-3cb8-4695-88af-8f33222338ce ;;; lao-util.el ends here