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 minor
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: 2025-02-22 18:03 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshot (22.89 KB, image/png)
2025-02-22 18:03 UTC, Jim Avera
Details

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 Khaled Hosny 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 Khaled Hosny 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 Khaled Hosny 2022-08-18 09:05:56 UTC
Link to the Unicode Technical Standard: https://unicode.org/reports/tr51/#Presentation_Style
Comment 4 Khaled Hosny 2023-06-01 13:02:08 UTC
*** Bug 155475 has been marked as a duplicate of this bug. ***
Comment 5 Buovjaga 2024-11-25 17:50:15 UTC
Still repro

Arch Linux 64-bit
Version: 25.2.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: afa42fcd26d9d8677b246fcc4485a11c50d5d67d
CPU threads: 8; OS: Linux 6.11; UI render: default; VCL: kf6 (cairo+wayland)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: CL threaded
Built on 25 November 2024
Comment 6 Jim Avera 2025-02-22 17:57:26 UTC
Still a problem in master.   Is anyone currently looking into this?

Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 7a9e303d0ffad7b83beccfe1918f962d2de04a37
CPU threads: 12; OS: Linux 6.11; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 7 Jim Avera 2025-02-22 18:01:21 UTC
(In reply to ⁨خالد حسني⁩ from comment #2)
> 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.

Would someone plase post exactly what font can be used?
I.e. a font which is "not a color font" (among those shipped with LO or Ubuntu linux)?

(Also: Previous comment indicated that LO actually changes fonts to render emojis so I'm wondering if the user-specified font makes any difference at all?)
Comment 8 Jim Avera 2025-02-22 18:03:33 UTC
Created attachment 199391 [details]
screenshot