X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/77ab81d0545e980c57c0a35510ade29a9e43b4cd..fa7886a46ff8d611cd75eaf651944f0fbc260324:/lisp/language/hebrew.el diff --git a/lisp/language/hebrew.el b/lisp/language/hebrew.el index ad079c2d70..ae8cc95c96 100644 --- a/lisp/language/hebrew.el +++ b/lisp/language/hebrew.el @@ -1,7 +1,6 @@ ;;; 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) @@ -217,24 +216,26 @@ Bidirectional editing is supported."))) (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]") @@ -259,5 +260,4 @@ Bidirectional editing is supported."))) (provide 'hebrew) -;; arch-tag: 3ca04f32-3f1e-498e-af46-8267498ba5d9 ;;; hebrew.el ends here