https://bugs.documentfoundation.org/show_bug.cgi?id=173967

            Bug ID: 173967
           Summary: Bug: Windows font registration enumeration order
                    appears to affect color emoji fallback in LibreOffice
           Product: LibreOffice
           Version: 26.8.1.1 release
          Hardware: x86-64 (AMD64)
                OS: Windows (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: LibreOffice
          Assignee: [email protected]
          Reporter: [email protected]

Description:
A comparison between two Windows 11 computers revealed that the relative
enumeration order of Segoe UI Symbol and Segoe UI Emoji differed both in the
Windows Fonts registry and in LibreOffice's UNO font descriptor enumeration.

After moving the Segoe UI Symbol registry entry later in the enumeration, the
corresponding LibreOffice enumeration order changed and automatic color emoji
rendering began working.

This suggests that the fallback selection may depend on font discovery or
registration ordering, rather than consistently preferring the emoji-specific
color font when both fonts support a character.

Steps to Reproduce:
1. Start LibreOffice Calc.
2. Ensure Tools → Options → LibreOffice → Fonts → Apply replacement table is
disabled.
3. Format cell A1 using Segoe UI.
4. Enter =UNICHAR(128512) into A1.
5. Observe the displayed grinning face.
6. Change the cell font to Segoe UI Emoji.

Actual Results:
In step 5, the character renders monochrome. In step 6, it renders in color.

Expected Results:
LibreOffice should choose an appropriate color emoji fallback automatically
when the text font does not provide the required emoji glyph. 

The problem also occurred in Writer, indicating that it was not Calc-specific.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
CONTROLLED COMPARISON BETWEEN MACHINES

Two computers were running the same Windows 11 build (26200.9711) and
LibreOffice version (26.8.1.1).  Also reproduced: LibreOffice 25.8.3.1

The relevant Segoe UI, Segoe UI Emoji, and Segoe UI Symbol font files were
confirmed to have identical SHA-256 hashes on both computers. The primary
LibreOffice executable and relevant rendering libraries were also identical.

Both computers had identical Windows font-substitution and font-linking
registry configurations.

Despite these similarities, LibreOffice displayed color emoji correctly on one
computer but monochrome emoji on the other.

BEFORE INTERVENTION

Affected computer (monochrome emoji):

Windows registry enumeration:
  - Segoe UI: position 102
  - Segoe UI Symbol: position 115
  - Segoe UI Emoji: position 247

LibreOffice UNO font descriptor enumeration:
  - Segoe UI: positions 192-195
  - Segoe UI Symbol: position 204
  - Segoe UI Emoji: position 277
  - Total font descriptors: 523

Working computer (color emoji):

Windows registry enumeration:
  - Segoe UI: position 102
  - Segoe UI Emoji: position 107
  - Segoe UI Symbol: position 116

LibreOffice UNO font descriptor enumeration:
  - Segoe UI: positions 205-208
  - Segoe UI Emoji: position 212
  - Segoe UI Symbol: position 221
  - Total font descriptors: 600

The affected computer enumerated Segoe UI Symbol before Segoe UI Emoji in both
Windows and LibreOffice.

The working computer enumerated Segoe UI Emoji before Segoe UI Symbol in both
Windows and LibreOffice.

LIBREOFFICE FONT DESCRIPTOR PROPERTIES

The UNO XDevice.getFontDescriptors() interface reported identical font
classification properties for Segoe UI Emoji and Segoe UI Symbol on both
computers:

  Style: Regular
  Family: 5
  Pitch: 2
  Weight: 100
  CharSet: -1

The notable difference was the position of each font within the enumeration.

CONTROLLED REGISTRY INTERVENTION

On the affected computer, a Windows System Restore point and registry backup
were created.

The following registry value was deleted and immediately recreated using its
original name, data, and type:

  Registry key:
  HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts

  Value name: Segoe UI Symbol (TrueType)
  Value type: REG_SZ
  Value data: seguisym.ttf

No font files were removed, replaced, or modified.

After restarting Windows, the relative enumeration order of Segoe UI Emoji and
Segoe UI Symbol had reversed.

RESULTS AFTER INTERVENTION

Windows registry enumeration:

  Before:
    - Segoe UI Emoji: position 247
    - Segoe UI Symbol: position 115

  After:
    - Segoe UI Emoji: position 246
    - Segoe UI Symbol: position 374

LibreOffice UNO font descriptor enumeration:

  Before:
    - Segoe UI Emoji: position 277
    - Segoe UI Symbol: position 204

  After:
    - Segoe UI Emoji: position 276
    - Segoe UI Symbol: position 470

The total number of LibreOffice font descriptors remained unchanged at 523.

MOST IMPORTANT RESULT

Before the intervention, the formula =UNICHAR(128512) displayed a monochrome
grinning-face emoji when its Calc cell was formatted as Segoe UI.

After the intervention and Windows restart, THE SAME FORMULA DISPLAYED THE
EMOJI IN COLOR, WITHOUT CHANGING THE CELL FONT OR ENABLING LIBREOFFICE FONT
REPLACEMENT.

This resolved the original issue.

The matching changes in Windows registry enumeration, LibreOffice font
enumeration, and rendering behavior strongly suggest that font discovery or
registration order influences LibreOffice's fallback font selection.

This is a controlled before-and-after observation. The exact internal algorithm
responsible has not been traced, so the results demonstrate a strong causal
relationship with the registry intervention rather than conclusively proving
that enumeration order alone determines fallback priority.

ADDITIONAL DIAGNOSTIC FINDINGS

1. DirectWrite fallback

A diagnostic using the Windows IDWriteFontFallback::MapCharacters interface
selected Segoe UI Emoji for U+1F600 on both computers, including the affected
computer before the registry intervention.

This suggests Windows' default DirectWrite fallback was functioning correctly,
whereas LibreOffice's effective font fallback selection differed.

2. LibreOffice font replacement workaround

Before the registry intervention, enabling LibreOffice's font replacement table
with the following rule restored color emoji rendering:

  Replace: Segoe UI Symbol
  With: Segoe UI Emoji
  Always: Enabled

This workaround also worked for emojis produced by Calc formulas.

Removing the replacement entry entirely restored the monochrome behavior before
the registry intervention.

3. Character-specific behavior

On the affected computer, some emoji characters were displayed in color
automatically, particularly characters unavailable in Segoe UI Symbol.

The problem was most apparent for emoji characters represented by both Segoe UI
Symbol and Segoe UI Emoji.

This suggests that LibreOffice was selecting the monochrome Symbol font when
multiple fallback fonts supported the same character.

4. Fresh Windows account and LibreOffice installation

The problem reproduced under a newly created Windows user account.

Reinstalling LibreOffice and resetting its configuration did not resolve the
problem.

LibreOffice 25.8.3.1 also exhibited the issue.

5. Font integrity

The relevant Windows font files had matching SHA-256 hashes on both computers.

Windows system file verification reported no integrity violations in the tested
font files.

6. Windows font cache

Rebuilding the Windows font cache did not resolve the problem.

The font enumeration and monochrome rendering behavior remained consistent
across Windows restarts before the registry intervention.

7. LibreOffice rendering backend

Changing Skia hardware/software rendering settings did not resolve the issue.

8. Windows registry configuration

Machine-wide font-substitution, font-linking, and related fallback registry
settings were exported and compared between both computers.

All 150 exported registry values matched exactly.

The principal difference identified was the enumeration order of font
registrations in the Windows Fonts registry key.

POSSIBLE UNDERLYING ISSUE

LibreOffice's Windows VCL font discovery or glyph fallback selection may be
sensitive to the order in which fonts are enumerated and inserted into its
internal font collection.

When both Segoe UI Symbol and Segoe UI Emoji support a character such as
U+1F600, LibreOffice may select whichever acceptable candidate is encountered
first, without sufficiently prioritizing the color emoji font.

The UNO font descriptor ordering might reflect an underlying font collection
order used during fallback selection. However, the investigation has not
established that the UNO descriptor array itself determines fallback priority.

SUGGESTED DEVELOPER INVESTIGATION

1. Examine how Windows font registrations are enumerated and added to
LibreOffice's VCL physical font collection.
2. Trace the fallback selection for U+1F600 when the requested font is Segoe
UI.
3. Determine whether the relative insertion or enumeration order of Segoe UI
Emoji and Segoe UI Symbol influences fallback selection.
4. Investigate whether LibreOffice should prioritize Segoe UI Emoji for Unicode
characters requesting emoji presentation, even when Segoe UI Symbol also
contains a glyph.
5. Consider a regression test using two otherwise identical font configurations
with reversed registration enumeration orders.
6. Investigate whether restoring or reinstalling system font registrations can
expose this behavior in other Windows installations.

POTENTIAL USER IMPACT

Users who temporarily replace, reinstall, or repair system fonts may encounter
persistent monochrome emoji rendering in LibreOffice, despite restoring the
correct font files.

The issue is difficult to diagnose because:

  - The Windows fonts themselves are intact.
  - Other applications display color emoji correctly.
  - Explicitly selecting Segoe UI Emoji works.
  - Windows DirectWrite fallback selects the expected font.
  - Resetting LibreOffice does not help.
  - The root cause appears associated with a machine-wide font-registration
state that is not obvious from ordinary font settings.

AVAILABLE SUPPORTING EVIDENCE

  - Before-and-after Windows Fonts registry enumeration output.
  - Before-and-after LibreOffice UNO font descriptor enumeration output.
  - Screenshots comparing emoji rendered using Segoe UI, Segoe UI Emoji, and
Segoe UI Symbol.
  - SHA-256 comparisons of the relevant Windows font files.
  - DirectWrite fallback diagnostic results.
  - Verification of the LibreOffice font replacement workaround.
  - Verification that changing font registration order restored automatic color
emoji rendering.

REQUESTED OUTCOME

Please investigate whether font registration enumeration order affects
LibreOffice's fallback font selection on Windows.

If confirmed, please consider making fallback selection deterministic so that
LibreOffice appropriately prioritizes Segoe UI Emoji over monochrome Segoe UI
Symbol for characters requiring emoji presentation, regardless of the fonts'
registration or discovery order.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to