;;; lao-util.el --- utilities for Lao -*- coding: iso-2022-7bit; -*-
-;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
;; Free Software Foundation, Inc.
;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-;; 2007, 2008
+;; 2007, 2008, 2009
;; National Institute of Advanced Industrial Science and Technology (AIST)
;; Registration Number H14PRO021
;; Copyright (C) 2003
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)