summaryrefslogtreecommitdiff
path: root/lisp/composite.el
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2008-09-10 05:49:38 +0000
committerKenichi Handa <handa@m17n.org>2008-09-10 05:49:38 +0000
commitc0a839aeac3ea341d1c1fbae1a87cc6d9a193cd6 (patch)
tree03a59bd674f6bd6b755cfa3e5e512c20ed2ed628 /lisp/composite.el
parentfa2dda1469eb5d12fc991a636af097eb48bbe99e (diff)
downloademacs-c0a839aeac3ea341d1c1fbae1a87cc6d9a193cd6.tar.gz
(compose-gstring-for-graphic): Fix previous change.
Diffstat (limited to 'lisp/composite.el')
-rw-r--r--lisp/composite.el108
1 files changed, 58 insertions, 50 deletions
diff --git a/lisp/composite.el b/lisp/composite.el
index fdf8dcd223c..6d1a2f0bba5 100644
--- a/lisp/composite.el
+++ b/lisp/composite.el
@@ -579,56 +579,64 @@ All non-spacing characters has this function in
(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))