unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#40502: 28.0.50; Hangul Jamo conjoining characters are not composed
@ 2020-04-08  9:28 Robert Pluim
  2020-04-08  9:55 ` Eli Zaretskii
  2020-04-08 10:00 ` Robert Pluim
  0 siblings, 2 replies; 7+ messages in thread
From: Robert Pluim @ 2020-04-08  9:28 UTC (permalink / raw)
  To: 40502


According to Unicode 13 Chapter 18.6, Hangul Jamo characters should be
composed into the corresponding pre-composed Hangul characters. Iʼm
not seeing this, e.g

하 (U+1112 U+1161) should be displayed as 하 (U+D558), but is shown as
two separate glyphs (all using Apple SD Gothic Neo)

(set-char-table-range composition-function-table
                      #x1112
                      (list (vector "..")
                            0
                            'compose-gstring-for-graphic))

does not help.

This is:

In GNU Emacs 28.0.50 (build 127, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G4032))
 of 2020-04-02 built on rpluim-mac

although I see the same in a Cairo+HarfBuzz build on GNU/Linux.






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#40502: 28.0.50; Hangul Jamo conjoining characters are not composed
  2020-04-08  9:28 bug#40502: 28.0.50; Hangul Jamo conjoining characters are not composed Robert Pluim
@ 2020-04-08  9:55 ` Eli Zaretskii
  2020-04-08 10:11   ` Robert Pluim
  2020-04-08 10:00 ` Robert Pluim
  1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2020-04-08  9:55 UTC (permalink / raw)
  To: Robert Pluim; +Cc: 40502

> From: Robert Pluim <rpluim@gmail.com>
> Date: Wed, 08 Apr 2020 11:28:25 +0200
> 
> According to Unicode 13 Chapter 18.6, Hangul Jamo characters should be
> composed into the corresponding pre-composed Hangul characters. Iʼm
> not seeing this, e.g
> 
> 하 (U+1112 U+1161) should be displayed as 하 (U+D558), but is shown as
> two separate glyphs (all using Apple SD Gothic Neo)

I hope I've just fixed that on the master branch, please take a look.

> (set-char-table-range composition-function-table
>                       #x1112
>                       (list (vector "..")
>                             0
>                             'compose-gstring-for-graphic))
> 
> does not help.

The call is incorrect: 'vector' should include both 0 and the function
symbol.

Thanks.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#40502: 28.0.50; Hangul Jamo conjoining characters are not composed
  2020-04-08  9:28 bug#40502: 28.0.50; Hangul Jamo conjoining characters are not composed Robert Pluim
  2020-04-08  9:55 ` Eli Zaretskii
@ 2020-04-08 10:00 ` Robert Pluim
  1 sibling, 0 replies; 7+ messages in thread
From: Robert Pluim @ 2020-04-08 10:00 UTC (permalink / raw)
  To: 40502

>>>>> On Wed, 08 Apr 2020 11:28:25 +0200, Robert Pluim <rpluim@gmail.com> said:

    Robert> According to Unicode 13 Chapter 18.6, Hangul Jamo characters should be
    Robert> composed into the corresponding pre-composed Hangul characters. Iʼm
    Robert> not seeing this, e.g

    Robert> 하 (U+1112 U+1161) should be displayed as 하 (U+D558), but is shown as
    Robert> two separate glyphs (all using Apple SD Gothic Neo)

    Robert> (set-char-table-range composition-function-table
    Robert>                       #x1112
    Robert>                       (list (vector "..")
    Robert>                             0
    Robert>                             'compose-gstring-for-graphic))

    Robert> does not help.

It doesnʼt help because I got the parameters to set-char-table-range
wrong. <sigh>

Robert





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#40502: 28.0.50; Hangul Jamo conjoining characters are not composed
  2020-04-08  9:55 ` Eli Zaretskii
@ 2020-04-08 10:11   ` Robert Pluim
  2020-04-08 11:18     ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Robert Pluim @ 2020-04-08 10:11 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 40502-done

>>>>> On Wed, 08 Apr 2020 12:55:19 +0300, Eli Zaretskii <eliz@gnu.org> said:

    >> From: Robert Pluim <rpluim@gmail.com>
    >> Date: Wed, 08 Apr 2020 11:28:25 +0200
    >> 
    >> According to Unicode 13 Chapter 18.6, Hangul Jamo characters should be
    >> composed into the corresponding pre-composed Hangul characters. Iʼm
    >> not seeing this, e.g
    >> 
    >> 하 (U+1112 U+1161) should be displayed as 하 (U+D558), but is shown as
    >> two separate glyphs (all using Apple SD Gothic Neo)

    Eli> I hope I've just fixed that on the master branch, please take a look.

Yes, on both macOS and GNU/Linux, including the three character
variant (I tested with U+1112 U+1161 U+11AB).

    >> (set-char-table-range composition-function-table
    >> #x1112
    >> (list (vector "..")
    >> 0
    >> 'compose-gstring-for-graphic))
    >> 
    >> does not help.

    Eli> The call is incorrect: 'vector' should include both 0 and the function
    Eli> symbol.

Yes. I misread the docstring of composition-function-table rather than
copying the correct call I had sitting in a buffer already.

Closing.

Robert





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#40502: 28.0.50; Hangul Jamo conjoining characters are not composed
  2020-04-08 10:11   ` Robert Pluim
@ 2020-04-08 11:18     ` Eli Zaretskii
  2020-04-08 12:11       ` Robert Pluim
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2020-04-08 11:18 UTC (permalink / raw)
  To: Robert Pluim; +Cc: 40502

> From: Robert Pluim <rpluim@gmail.com>
> Cc: 40502-done@debbugs.gnu.org
> Date: Wed, 08 Apr 2020 12:11:56 +0200
> 
>     Eli> The call is incorrect: 'vector' should include both 0 and the function
>     Eli> symbol.
> 
> Yes. I misread the docstring of composition-function-table rather than
> copying the correct call I had sitting in a buffer already.

Maybe we should improve the doc string?  Which part was confusing?





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#40502: 28.0.50; Hangul Jamo conjoining characters are not composed
  2020-04-08 11:18     ` Eli Zaretskii
@ 2020-04-08 12:11       ` Robert Pluim
  2020-04-08 13:51         ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Robert Pluim @ 2020-04-08 12:11 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 40502

>>>>> On Wed, 08 Apr 2020 14:18:22 +0300, Eli Zaretskii <eliz@gnu.org> said:

    >> From: Robert Pluim <rpluim@gmail.com>
    >> Cc: 40502-done@debbugs.gnu.org
    >> Date: Wed, 08 Apr 2020 12:11:56 +0200
    >> 
    Eli> The call is incorrect: 'vector' should include both 0 and the function
    Eli> symbol.
    >> 
    >> Yes. I misread the docstring of composition-function-table rather than
    >> copying the correct call I had sitting in a buffer already.

    Eli> Maybe we should improve the doc string?  Which part was confusing?

I donʼt know if itʼs confusing, just that it says:

    The element at index C in the table, if non-nil, is a list of
    composition rules of this form: ([PATTERN PREV-CHARS FUNC] ...)

So I did
   (list (vector [..]

then continued to read the docstring, and by the time I got back to
the code, my brain conflated the brackets from the regexp with the
ones from the vector, so I closed the list, and carried on. So
entirely down to my brain fart. Maybe saying

((vector PATTERN PREV-CHARS FUNC) ...)

would have helped, but itʼs too late to tell now.

Perhaps we should have a macro or defun 'composition-function-add-entry' or
somesuch to hide the details? And ensure that weʼre not overwriting
previous entries. How often do people write these things?

    (defsubst composition-function-add-entry (char-or-range pattern
    prev-chars func &optional replace)
    "Add composition-function-table entry for CHAR-OR-RANGE.

    CHAR-OR-RANGE is a single character or a cons of character codes.
    Adds [PATTERN PREV-CHARS FUNC] to any existing composition-function-table
    entry for CHAR-OR-RANGE.

    Optional arg REPLACE non-nil means replace the existing entry rather
    than adding to it.

    See `composition-function-table' and `auto-composition-mode' for
    more details.

(or does this end up growing 'add-to-front', 'supersede',
'sort-then-insert' etc options? :-) )

Robert





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#40502: 28.0.50; Hangul Jamo conjoining characters are not composed
  2020-04-08 12:11       ` Robert Pluim
@ 2020-04-08 13:51         ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2020-04-08 13:51 UTC (permalink / raw)
  To: Robert Pluim; +Cc: 40502

> From: Robert Pluim <rpluim@gmail.com>
> Cc: 40502@debbugs.gnu.org
> Date: Wed, 08 Apr 2020 14:11:19 +0200
> 
> Perhaps we should have a macro or defun 'composition-function-add-entry' or
> somesuch to hide the details?

We could if this is done frequently enough.

> How often do people write these things?

Probably not too often.  "git log --grep" shows only 55 changes since
1999, with only a dozen or so since 2008.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-04-08 13:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-08  9:28 bug#40502: 28.0.50; Hangul Jamo conjoining characters are not composed Robert Pluim
2020-04-08  9:55 ` Eli Zaretskii
2020-04-08 10:11   ` Robert Pluim
2020-04-08 11:18     ` Eli Zaretskii
2020-04-08 12:11       ` Robert Pluim
2020-04-08 13:51         ` Eli Zaretskii
2020-04-08 10:00 ` Robert Pluim

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).