Bug 168107 - EMF: Can't render Arabic text
Summary: EMF: Can't render Arabic text
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
25.8.0.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: EMF-WMF Arabic-and-Farsi
  Show dependency treegraph
 
Reported: 2025-08-26 03:33 UTC by Yousuf Philips (jay) (retired)
Modified: 2025-08-27 19:45 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
sample file (63.21 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-08-26 03:33 UTC, Yousuf Philips (jay) (retired)
Details
how it renders in ms word (375.94 KB, application/pdf)
2025-08-26 03:34 UTC, Yousuf Philips (jay) (retired)
Details
Extracted EMF image with Arabic text (37.16 KB, image/emf)
2025-08-26 20:54 UTC, Bartosz
Details
Minimal EMF image with only Arabic text (1.28 KB, image/emf)
2025-08-26 21:28 UTC, Bartosz
Details
screenshot from LO on linux (225.05 KB, image/png)
2025-08-27 04:37 UTC, Yousuf Philips (jay) (retired)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) (retired) 2025-08-26 03:33:36 UTC
Created attachment 202505 [details]
sample file

When an EMF is embedded in a DOCX and has arabic text in it, it will show up as weird characters.
Comment 1 Yousuf Philips (jay) (retired) 2025-08-26 03:34:14 UTC
Created attachment 202506 [details]
how it renders in ms word
Comment 2 m_a_riosv 2025-08-26 14:05:35 UTC
Reproducible
Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 7f4868348c14b305fcd75744e1e3544d0d3a5d61
CPU threads: 16; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: CL threaded
Comment 3 Bartosz 2025-08-26 20:52:31 UTC
Hi,
It seems that whole page is EMF file.
Could you please attach smaller image? 
The best would be with only Arabic letters.
Comment 4 Bartosz 2025-08-26 20:54:29 UTC
Created attachment 202530 [details]
Extracted EMF image with Arabic text
Comment 5 Bartosz 2025-08-26 21:28:26 UTC
Created attachment 202531 [details]
Minimal EMF image with only Arabic text

There are two main records used in EMF image:
* EMR_EXTCREATEFONTINDIRECTW, where Font Facename is "Traditional Arabic". I think is it unable to find such font, and that's why it is not displaying correctly.

* EMR_EXTTEXTOUTW it contain the content of text to display. As font is not choosing correctly in EMR_EXTCREATEFONTINDIRECTW, it is displayed wrongly.

More information:
https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-emf/7e266b6d-32e5-4201-b687-8ec40c24cd73
and
https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-emf/a59a79ac-328e-492d-a34d-e02727af6edf
Comment 6 Bartosz 2025-08-26 21:31:08 UTC
Traditonal Arabic family is described at:
https://learn.microsoft.com/en-us/typography/font-list/traditional-arabic

Please make sure you have installed such fonts (Trado.ttf and Tradbdo.ttf).
Comment 7 Yousuf Philips (jay) (retired) 2025-08-27 04:36:02 UTC
I have traditional arabic installed on both windows and linux prior to filing the bug, as i opened a document with the EMF surprisingly in it, which was full of arabic text styled in traditional arabic and the text appeared fine.
Comment 8 Yousuf Philips (jay) (retired) 2025-08-27 04:37:50 UTC
Created attachment 202533 [details]
screenshot from LO on linux

Screenshot from the original document open with the EMF on the left page and the page on the right has text in traditional arabic where the cursor is set.