X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/ac3232837188f7e1c4ffe34b76edede0ccb54f5e..ef62b23df5a7007c3d8c74dbca87ba83e9da682e:/lisp/language/lao-util.el diff --git a/lisp/language/lao-util.el b/lisp/language/lao-util.el index 18fa4c5187..863e3ba89a 100644 --- a/lisp/language/lao-util.el +++ b/lisp/language/lao-util.el @@ -1,9 +1,8 @@ ;;; lao-util.el --- utilities for Lao -*- coding: iso-2022-7bit; -*- -;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 -;; Free Software Foundation, Inc. +;; Copyright (C) 2001-2012 Free Software Foundation, Inc. ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, -;; 2007, 2008 +;; 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) ;; Registration Number H14PRO021 ;; Copyright (C) 2003 @@ -372,8 +371,8 @@ consonant. It is a list vowel characters or 0. The element 0 indicate the place to embed a consonant. Optional WITH-MAA-SAKOD-RULE is a rule to re-order and modify VOWEL -follwoing a consonant and preceding a maa-sakod character. If it is -nil, NO-MAA-SAKOD-RULE is used. The maa-sakod character is alwasy +following a consonant and preceding a maa-sakod character. If it is +nil, NO-MAA-SAKOD-RULE is used. The maa-sakod character is always appended at the tail. For instance, rule `(\"(1`WM(B\" (?(1`(B t ?(1W(B ?(1M(B))' tells that this vowel @@ -387,7 +386,7 @@ character MAA-SAKOD-n.") "Transcribe a Romanized Lao syllable in the region FROM and TO to Lao string. Only the first syllable is transcribed. The value has the form: (START END LAO-STRING), where -START and END are the beggining and end positions of the Roman Lao syllable, +START and END are the beginning and end positions of the Roman Lao syllable, LAO-STRING is the Lao character transcription of it. Optional 3rd arg STR, if non-nil, is a string to search for Roman Lao @@ -491,19 +490,17 @@ syllable. In that case, FROM and TO are indexes to STR." lao-str))) ;;;###autoload -(defun lao-composition-function (from to font-object string) - (or (and font-object - (font-shape-text from to font-object string)) - (with-category-table lao-category-table - (if string - (if (eq (string-match lao-composition-pattern string from) to) - (prog1 (match-end 0) - (compose-string string from (match-end 0)))) - (save-excursion - (goto-char from) - (if (looking-at lao-composition-pattern) - (prog1 (match-end 0) - (compose-region from (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) @@ -518,5 +515,4 @@ syllable. In that case, FROM and TO are indexes to STR." ;; (provide 'lao-util) -;; arch-tag: 1f828781-3cb8-4695-88af-8f33222338ce ;;; lao-util.el ends here