;;; hebrew.el --- support for Hebrew -*- coding: utf-8 -*-
-;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-;; Free Software Foundation, Inc.
+;; Copyright (C) 2001-2016 Free Software Foundation, Inc.
;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
;; 2005, 2006, 2007, 2008, 2009, 2010, 2011
;; National Institute of Advanced Industrial Science and Technology (AIST)
(setq idx 1 nglyphs nchars))
;; Now IDX is an index to the first non-precomposed glyph.
;; Adjust positions of the remaining glyphs artificially.
- (setq base-width (lglyph-width (lgstring-glyph gstring 0)))
- (while (< idx nglyphs)
- (setq glyph (lgstring-glyph gstring idx))
- (lglyph-set-from-to glyph 0 (1- nchars))
- (if (>= (lglyph-lbearing glyph) (lglyph-width glyph))
- ;; It seems that this glyph is designed to be rendered
- ;; before the base glyph.
- (lglyph-set-adjustment glyph (- base-width) 0 0)
- (if (>= (lglyph-lbearing glyph) 0)
- ;; Align the horizontal center of this glyph to the
- ;; horizontal center of the base glyph.
- (let ((width (- (lglyph-rbearing glyph)
- (lglyph-lbearing glyph))))
- (lglyph-set-adjustment glyph
- (- (/ (- base-width width) 2)
- (lglyph-lbearing glyph)
- base-width) 0 0))))
- (setq idx (1+ idx))))))
+ (if (font-get font :combining-capability)
+ (font-shape-gstring gstring)
+ (setq base-width (lglyph-width (lgstring-glyph gstring 0)))
+ (while (< idx nglyphs)
+ (setq glyph (lgstring-glyph gstring idx))
+ (lglyph-set-from-to glyph 0 (1- nchars))
+ (if (>= (lglyph-lbearing glyph) (lglyph-width glyph))
+ ;; It seems that this glyph is designed to be rendered
+ ;; before the base glyph.
+ (lglyph-set-adjustment glyph (- base-width) 0 0)
+ (if (>= (lglyph-lbearing glyph) 0)
+ ;; Align the horizontal center of this glyph to the
+ ;; horizontal center of the base glyph.
+ (let ((width (- (lglyph-rbearing glyph)
+ (lglyph-lbearing glyph))))
+ (lglyph-set-adjustment glyph
+ (- (/ (- base-width width) 2)
+ (lglyph-lbearing glyph)
+ base-width) 0 0))))
+ (setq idx (1+ idx)))))))
gstring))
(let* ((base "[\u05D0-\u05F2]")