;;; composite.el --- support character composition
;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-;; 2008
+;; 2008, 2009
;; National Institute of Advanced Industrial Science and Technology (AIST)
;; Registration Number H14PRO021
+;; Author: Kenichi HANDA <handa@etl.go.jp>
+;; (according to ack.texi)
;; Keywords: mule, multilingual, character composition
;; This file is part of GNU Emacs.
(defsubst lglyph-set-from-to (glyph from to)
(progn (aset glyph 0 from) (aset glyph 1 to)))
(defsubst lglyph-set-char (glyph char) (aset glyph 2 char))
+(defsubst lglyph-set-code (glyph code) (aset glyph 3 code))
(defsubst lglyph-set-width (glyph width) (aset glyph 4 width))
(defsubst lglyph-set-adjustment (glyph &optional xoff yoff wadjust)
(aset glyph 9 (vector (or xoff 0) (or yoff 0) (or wadjust 0))))
(de (lglyph-descent glyph))
(ce (/ (+ lb rb) 2))
xoff yoff)
- (if (and
- class (>= class 200) (<= class 240)
- (cond
- ((= class 200)
- (setq xoff (- lbearing ce)
- yoff (if (> as 0) 0 (+ descent as))))
- ((= class 202)
- (if (> as 0) (setq as 0))
- (setq xoff (- center ce)
- yoff (if (> as 0) 0 (+ descent as))))
- ((= class 204)
- (if (> as 0) (setq as 0))
- (setq xoff (- rbearing ce)
- yoff (if (> as 0) 0 (+ descent as))))
- ((= class 208)
- (setq xoff (- lbearing rb)))
- ((= class 210)
- (setq xoff (- rbearing lb)))
- ((= class 212)
- (setq xoff (- lbearing ce)
- yoff (if (>= de 0) 0 (- ascent (- de)))))
- ((= class 214)
- (setq xoff (- center ce)
- yoff (if (>= de 0) 0 (- ascent (- de)))))
- ((= class 216)
- (setq xoff (- rbearing ce)
- yoff (if (>= de 0) 0 (- ascent (- de)))))
- ((= class 218)
- (setq xoff (- lbearing ce)
- yoff (if (> as 0) 0 (+ descent as gap))))
- ((= class 220)
- (setq xoff (- center ce)
- yoff (if (> as 0) 0 (+ descent as gap))))
- ((= class 222)
- (setq xoff (- rbearing ce)
- yoff (if (> as 0) 0 (+ descent as gap))))
- ((= class 224)
- (setq xoff (- lbearing rb)))
- ((= class 226)
- (setq xoff (- rbearing lb)))
- ((= class 228)
- (setq xoff (- lbearing ce)
- yoff (if (>= de 0) 0 (- ascent (- de) gap))))
- ((= class 230)
- (setq xoff (- center ce)
- yoff (if (>= de 0) 0 (- ascent (- de) gap))))
- ((= class 232)
- (setq xoff (- rbearing ce)
- yoff (if (>= de 0) 0 (- ascent (- de) gap))))))
- (lglyph-set-adjustment glyph (- xoff width) yoff))))))
+ (when (and class (>= class 200) (<= class 240))
+ (setq xoff 0 yoff 0)
+ (cond
+ ((= class 200)
+ (setq xoff (- lbearing ce)
+ yoff (if (> as 0) 0 (+ descent as))))
+ ((= class 202)
+ (if (> as 0) (setq as 0))
+ (setq xoff (- center ce)
+ yoff (if (> as 0) 0 (+ descent as))))
+ ((= class 204)
+ (if (> as 0) (setq as 0))
+ (setq xoff (- rbearing ce)
+ yoff (if (> as 0) 0 (+ descent as))))
+ ((= class 208)
+ (setq xoff (- lbearing rb)))
+ ((= class 210)
+ (setq xoff (- rbearing lb)))
+ ((= class 212)
+ (setq xoff (- lbearing ce)
+ yoff (if (>= de 0) 0 (- (- ascent) de))))
+ ((= class 214)
+ (setq xoff (- center ce)
+ yoff (if (>= de 0) 0 (- (- ascent) de))))
+ ((= class 216)
+ (setq xoff (- rbearing ce)
+ yoff (if (>= de 0) 0 (- (- ascent) de))))
+ ((= class 218)
+ (setq xoff (- lbearing ce)
+ yoff (if (> as 0) 0 (+ descent as gap))))
+ ((= class 220)
+ (setq xoff (- center ce)
+ yoff (if (> as 0) 0 (+ descent as gap))))
+ ((= class 222)
+ (setq xoff (- rbearing ce)
+ yoff (if (> as 0) 0 (+ descent as gap))))
+ ((= class 224)
+ (setq xoff (- lbearing rb)))
+ ((= class 226)
+ (setq xoff (- rbearing lb)))
+ ((= class 228)
+ (setq xoff (- lbearing ce)
+ yoff (if (>= de 0) 0 (- (- ascent) de gap))))
+ ((= class 230)
+ (setq xoff (- center ce)
+ yoff (if (>= de 0) 0 (- (- ascent) de gap))))
+ ((= class 232)
+ (setq xoff (- rbearing ce)
+ yoff (if (>= de 0) 0 (- (+ ascent de) gap)))))
+ (lglyph-set-adjustment glyph (- xoff width) yoff)
+ (setq lb (+ lb xoff)
+ rb (+ lb xoff)
+ as (- as yoff)
+ de (+ de yoff)))
+ (if (< ascent as)
+ (setq ascent as))
+ (if (< descent de)
+ (setq descent de))))))
(let ((i 0))
(while (and (< i nglyphs) (setq glyph (lgstring-glyph gstring i)))
(lglyph-set-from-to glyph 0 (1- nchars))
(setq i (1+ i))))
gstring))))))
-(let ((elt '(["\\C^\\c^+" 1 compose-gstring-for-graphic]
+(let ((elt '(["[[:alpha:]]\\c^+" 1 compose-gstring-for-graphic]
[nil 0 compose-gstring-for-graphic])))
(map-char-table
#'(lambda (key val)