Variable: reference-point-alist

reference-point-alist is a variable defined in composite.el.gz.

Value

Large value
((tl . 0)
 (tc . 1)
 (tr . 2)
 (Bl . 3)
 (Bc . 4)
 (Br . 5)
 (bl . 6)
 (bc . 7)
 (br . 8)
 (cl . 9)
 (cc . 10)
 (cr . 11)
 (top-left . 0)
 (top-center . 1)
 (top-right . 2)
 (base-left . 3)
 (base-center . 4)
 (base-right . 5)
 (bottom-left . 6)
 (bottom-center . 7)
 (bottom-right . 8)
 (center-left . 9)
 (center-center . 10)
 (center-right . 11)
 (ml . 3)
 (mc . 10)
 (mr . 5)
 (mid-left . 3)
 (mid-center . 10)
 (mid-right . 5))

Documentation

Alist of symbols vs integer codes of glyph reference points.

A glyph reference point symbol is to be used to specify a composition rule in COMPONENTS argument to such functions as compose-region.

The meaning of glyph reference point codes is as follows:

    0----1----2 <---- ascent 0:tl or top-left
    | | 1:tc or top-center
    | | 2:tr or top-right
    | | 3:Bl or base-left 9:cl or center-left
    9 10 11 <---- center 4:Bc or base-center 10:cc or center-center
    | | 5:Br or base-right 11:cr or center-right
  --3----4----5-- <-- baseline 6:bl or bottom-left
    | | 7:bc or bottom-center
    6----7----8 <---- descent 8:br or bottom-right

Glyph reference point symbols are to be used to specify a composition rule of the form (GLOBAL-REF-POINT . NEW-REF-POINT), where GLOBAL-REF-POINT is a reference point in the overall glyphs already composed, and NEW-REF-POINT is a reference point in the new glyph to be added.

For instance, if GLOBAL-REF-POINT is br (bottom-right) and NEW-REF-POINT is tc (top-center), the overall glyph is updated as follows (the point * corresponds to both reference points):

    +-------+--+ <--- new ascent
    | | |
    | global| |
    | glyph | |
 -- | | |-- <--- baseline (doesn't change)
    +----+--*--+
    | | new |
    | |glyph|
    +----+-----+ <--- new descent

A composition rule may have the form (GLOBAL-REF-POINT NEW-REF-POINT XOFF YOFF), where XOFF and YOFF specify how much to shift NEW-REF-POINT from GLOBAL-REF-POINT. In this case, XOFF and YOFF are integers in the range -100..100 representing the shifting percentage against the font size.

Probably introduced at or before Emacs version 21.1.

Source Code

;; Defined in /usr/src/emacs/lisp/composite.el.gz
;;; composite.el --- support character composition  -*- lexical-binding: t; -*-

;; Copyright (C) 2001-2024 Free Software Foundation, Inc.

;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
;;   2008, 2009, 2010, 2011
;;   National Institute of Advanced Industrial Science and Technology (AIST)
;;   Registration Number H14PRO021

;; Author: Kenichi Handa <handa@gnu.org>
;; (according to ack.texi)
;; Keywords: mule, multilingual, character composition
;; Package: emacs

;; This file is part of GNU Emacs.

;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.

;;; Commentary:

;;; Code:

(defconst reference-point-alist
  '((tl . 0) (tc . 1) (tr . 2)
    (Bl . 3) (Bc . 4) (Br . 5)
    (bl . 6) (bc . 7) (br . 8)
    (cl . 9) (cc . 10) (cr . 11)
    (top-left . 0) (top-center . 1) (top-right . 2)
    (base-left . 3) (base-center . 4) (base-right . 5)
    (bottom-left . 6) (bottom-center . 7) (bottom-right . 8)
    (center-left . 9) (center-center . 10) (center-right . 11)
    ;; For backward compatibility...
    (ml . 3) (mc . 10) (mr . 5)
    (mid-left . 3) (mid-center . 10) (mid-right . 5))
  "Alist of symbols vs integer codes of glyph reference points.
A glyph reference point symbol is to be used to specify a composition
rule in COMPONENTS argument to such functions as `compose-region'.

The meaning of glyph reference point codes is as follows:

    0----1----2 <---- ascent	0:tl or top-left
    |         |			1:tc or top-center
    |         |			2:tr or top-right
    |         |			3:Bl or base-left     9:cl or center-left
    9   10   11 <---- center	4:Bc or base-center  10:cc or center-center
    |         |			5:Br or base-right   11:cr or center-right
  --3----4----5-- <-- baseline	6:bl or bottom-left
    |         |			7:bc or bottom-center
    6----7----8 <---- descent	8:br or bottom-right

Glyph reference point symbols are to be used to specify a composition
rule of the form (GLOBAL-REF-POINT . NEW-REF-POINT), where
GLOBAL-REF-POINT is a reference point in the overall glyphs already
composed, and NEW-REF-POINT is a reference point in the new glyph to
be added.

For instance, if GLOBAL-REF-POINT is `br' (bottom-right) and
NEW-REF-POINT is `tc' (top-center), the overall glyph is updated as
follows (the point `*' corresponds to both reference points):

    +-------+--+ <--- new ascent
    |       |  |
    | global|  |
    | glyph |  |
 -- |       |  |-- <--- baseline (doesn't change)
    +----+--*--+
    |    | new |
    |    |glyph|
    +----+-----+ <--- new descent

A composition rule may have the form (GLOBAL-REF-POINT
NEW-REF-POINT XOFF YOFF), where XOFF and YOFF specify how much
to shift NEW-REF-POINT from GLOBAL-REF-POINT.  In this case, XOFF
and YOFF are integers in the range -100..100 representing the
shifting percentage against the font size.")