Bug 150398 - Selecting Emoji presentation is not supported
Summary: Selecting Emoji presentation is not supported
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.3.4.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 155475 (view as bug list)
Depends on:
Blocks: Fonts
  Show dependency treegraph
 
Reported: 2022-08-13 14:00 UTC by ajlittoz
Modified: 2023-06-03 18:56 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ajlittoz 2022-08-13 14:00:40 UTC
This is a follow up for https://ask.libreoffice.org/t/unicode-characters-showing-as-emojis/80537

Unicode provides a Geometric Shapes block U+25A0-U+25FF. Unfortunately, the standard (see https://en.wikipedia.org/wiki/Geometric_Shapes_(Unicode_block)) states that 8 glyphs within the block can be rendered either as a basic character or as an emoji.

Selection between text and emoji form is possible by suffixing the codepoint with a Variant Selector (U+FE00-U+FE0F) combining character. The variant selectors effective on the Geometric Shapes emoji/text glyphs are U+FE0E VS15 (text) and U+FE0F VS16 (emoji).

It looks like Writer (or perhaps HarfBuzz) merely ignore the combining character. It is likely that the same behaviour occurs also in other components but I haven't tested. It does also occur in Calc, making me suspect a common library.

Steps to reproduce:

- in a fresh document type U+25B6, then Alt+X
   Expected: BLACK RIGHT-POINTING TRIANGLE
   Real: coloured Play-like button (emoji)
- after the previous character, type U+FE0E, then Alt+X
   Expected: change to black glyph
   Real: no change

I tried to enter all characters in this block with the Alt+X method. As long as the dual text/emoji character is not the first in the paragraph, i.e. follows existing characters, it is displayed as text (maybe inheriting some property from the preceding character).

When the dual character is first in its paragraph (no possible inheritance from preceding glyph), it is displayed as an emoji. Then it is no longer possible to display any later dual as text; the emoji form is always chosen and can't be reverted.

No matter how I enter them, U+25FB-U+25FE are always displayed as emoji.

No attachment as the result is highly dependent on entry sequence. Most of the time (99.9%) you get the emoji form. Getting the text form is very tricky and constrained (0.1%) and doesn't work for all dual glyphs.
Comment 1 ⁨خالد حسني⁩ 2022-08-13 16:02:45 UTC
Regular Unicode Variation Selectors should be supported (if the font used supports them). Emoji presentation selector are special as they implemented by switching fonts (fonts themselves don’t provide any support for them).

To handle Emoji presentation LibreOffice needs to:
1) track which fonts support color and which don’t
2) query the default presentation for any given emoji
3) check presentation selectors to override it
4) chose color or monochrome font based on the resolved presentation.

This is basically how browsers and other apps handle this.
Comment 2 ⁨خالد حسني⁩ 2022-08-13 16:05:15 UTC
To fix your immediate issue, make sure to explicitly use a font that have the code point and that is not a color font, apparently the font fallback is choosing a color font for you.
Comment 3 ⁨خالد حسني⁩ 2022-08-18 09:05:56 UTC
Link to the Unicode Technical Standard: https://unicode.org/reports/tr51/#Presentation_Style
Comment 4 ⁨خالد حسني⁩ 2023-06-01 13:02:08 UTC
*** Bug 155475 has been marked as a duplicate of this bug. ***