Subject: bug#36020: problems displaying tibetan characters

From: "Basil L. Contovounesios" <[email-masked]>
Date: Sat, 01 Jun 2019 19:04:43 +0100

Mayer Goldberg <[email-masked]> writes:

> I think there is a problem in how Tibetan characters are displayed:
>
> The character sequence 
>
> \u0f68\u0f7c\u0f7e\u0fc6\u0020\u0020\u0020\u0020\u0f40\u0fc6\u0020\u0020\u0020\u0020\u0f42\u0fc6
>
> Should display as 
>
> image.png
>
> But instead displays as
>
> image.png
>
> The issue has to do with the character 
>
> \u0fc6 = "TIBETAN SYMBOL PADMA GDAN"
>
> which should appear under the previous character, and appears on the right.
>
> I'm using the same font in both the example that works (in Libre Office) and the one that doesn't (in emacs). 
>
> The font I'm using is Tibetan Machine Unicode, available freely at:
>
> http://www.pktc.org/pktc/SFTtypefacesfree.htm

FWIW, I can't seem to reproduce this on the Emacs master and emacs-26
branches (build info follows my signature).  Here's what I tried after
installing the fonts-tibetan-machine package on Debian:

0. emacs -Q
1. M-: (set-fontset-font nil 'tibetan "Tibetan Machine Uni") RET
2. M-: (insert "\u0f68\u0f7c\u0f7e\u0fc6\u0020\u0f40\u0fc6\u0020\u0f42\u0fc6") RET
3. C-x C-= = = = = = =   [Text scale +7]

4. C-a C-u C-x =

--8<---------------cut here---------------start------------->8---
             position: 146 of 155 (94%), column: 0
            character: ཨ (displayed as ཨ) (codepoint 3944, #o7550, #xf68)
              charset: unicode (Unicode (ISO10646))
code point in charset: 0x0F68
               script: tibetan
               syntax: w 	which means: word
             category: .:Base, 0:consonant, L:Left-to-right (strong), q:Tibetan
             to input: type "C-x 8 RET f68" or "C-x 8 RET TIBETAN LETTER A"
          buffer code: #xE0 #xBD #xA8
            file code: #xE0 #xBD #xA8 (encoded by coding system utf-8-unix)
              display: composed to form "ཨོཾ" (see below)

Composed with the following character(s) "ོཾ" using this font:
  xft:-thdl-Tibetan Machine Uni-normal-normal-normal-*-54-*-*-*-*-0-iso10646-1
by these glyphs:
  [0 2 3944 3869 35 1 34 40 -10 nil]
  [0 2 0 4137 0 -26 10 62 -41 nil]

Character code properties: customize what to show
  name: TIBETAN LETTER A
  general-category: Lo (Letter, Other)
  decomposition: (3944) ('ཨ')

There are text properties here:
  fontified            nil
--8<---------------cut here---------------end--------------->8---

> Configured features:
> XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS NOTIFY LIBSELINUX
> GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS
> GTK2 X11 THREADS LIBSYSTEMD LCMS2

This report initially looked to me like bug#35024[1], but I see that you
are now reporting from an Emacs built with libotf and m17n-flt, so I
don't know where the problem lies.  Perhaps someone more experienced in
this area will have some ideas.

[1]: https://debbugs.gnu.org/35024

Thanks,

-- 
Basil

In GNU Emacs 27.0.50 (build 6, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2019-06-01 built on thunk
Repository revision: f2a7acdde7207f92de53352f17dd7f506e15a851
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
System Description: Debian GNU/Linux 10 (buster)

Configured using:
 'configure 'CC=ccache gcc' 'CFLAGS=-O2 -march=native' --config-cache
 --prefix=/home/blc/.local --with-mailutils --with-x-toolkit=lucid
 --with-modules --with-file-notification=yes --with-x'

Configured features:
XAW3D XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON
PDUMPER LCMS2 GMP

Important settings:
  value of $LANG: en_IE.UTF-8
  locale-coding-system: utf-8-unix

In GNU Emacs 26.2.50 (build 8, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2019-05-27 built on thunk
Repository revision: c4d4dcf17e407a3c68e150f22b9756ef6c943070
Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
System Description:	Debian GNU/Linux 10 (buster)

Configured using:
 'configure 'CC=ccache gcc' 'CFLAGS=-O0 -g3 -ggdb -gdwarf-4'
 --config-cache --prefix=/home/blc/.local --program-suffix=26
 --enable-checking=yes,glyphs --enable-check-lisp-object-type
 --with-mailutils --with-x-toolkit=lucid --with-modules
 --with-file-notification=yes --with-x'

Configured features:
XAW3D XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS
GLIB NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT
ZLIB TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM MODULES THREADS LIBSYSTEMD
LCMS2