all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Anand Tamariya <atamariya@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Unicode combining characters
Date: Wed, 26 May 2021 15:21:05 +0530	[thread overview]
Message-ID: <CADm7Y4kgqO=2owO5XBpV9-iMavfRxRVySuATkCzcZ+_p84M+BQ@mail.gmail.com> (raw)
In-Reply-To: <83k0nmbubk.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1003 bytes --]

Thanks Eli - align-to 'space' display spec seems helpful.

Though it's a company specific issue related to unicode character
composition, here's some more details on the issue for record should
somebody else stumble upon the same.

Let's call the first character in the screenshot as shr (single glyph) and
the second one as sh-r (two glyphs).
(setq shr  (string 2358 2381 2352))
(setq sh-r (string 2358 2352))

(string-width shr)  ;; 2
(string-width sh-r) ;; 2

To create the rectangular region, we need to pad the strings with
appropriate number of spaces. align-to 'space' display spec seems helpful
in this case as shown below. You will notice that character "a" is aligned
in both cases. Now I need to figure out how to use the same within company.

(insert (concat shr
(let ((sp " "))
 (font-lock-append-text-property 0 1 'display `(space . (:align-to 10)) sp)
 sp)
"a"))

(insert (concat sh-r
(let ((sp " "))
 (font-lock-append-text-property 0 1 'display `(space . (:align-to 10)) sp)
 sp)
"a"))

[-- Attachment #2: Type: text/html, Size: 1391 bytes --]

  parent reply	other threads:[~2021-05-26  9:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25 15:56 Unicode combining characters Anand Tamariya
2021-05-25 17:22 ` Stefan Monnier
2021-05-25 17:24 ` Eli Zaretskii
2021-05-25 18:15   ` Clément Pit-Claudel
2021-05-25 18:39     ` Eli Zaretskii
2021-05-25 19:30       ` Clément Pit-Claudel
2021-05-25 19:44         ` Eli Zaretskii
2021-05-26  9:51   ` Anand Tamariya [this message]
2021-05-26 10:04     ` Joost Kremers
2021-05-26 12:54     ` Eli Zaretskii
2021-05-26 17:14       ` Eli Zaretskii
2021-05-27  7:00         ` Anand Tamariya
2021-05-27  9:40           ` Eli Zaretskii
2021-05-27 10:34             ` Basil L. Contovounesios
2021-05-27 12:30               ` Eli Zaretskii
2021-05-27 13:27             ` Anand Tamariya
2021-05-27 13:44               ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADm7Y4kgqO=2owO5XBpV9-iMavfRxRVySuATkCzcZ+_p84M+BQ@mail.gmail.com' \
    --to=atamariya@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.