Bug 167297 - DOC/DOCX: Support w:hint using ODF's style:script-type
Summary: DOC/DOCX: Support w:hint using ODF's style:script-type
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
25.8.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Jonathan Clark
URL:
Whiteboard: target:26.2.0 target:25.8.0.2
Keywords: filter:doc, filter:docx
Depends on:
Blocks: DOCX DOC Script-Assignment
  Show dependency treegraph
 
Reported: 2025-06-30 12:25 UTC by Jonathan Clark
Modified: 2025-07-17 22:27 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Example DOCX (14.02 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2025-07-15 20:35 UTC, Jonathan Clark
Details
Example DOC (29.50 KB, application/msword)
2025-07-15 20:36 UTC, Jonathan Clark
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Clark 2025-06-30 12:25:02 UTC
After fixing bug 166011, we now have layout support for script type hinting. We should build upon this feature to implement the OOXML w:hint attribute.

Support for w:hint is necessary in order to correctly emulate the OOXML two-step algorithm for font slot character classification. See ECMA-376-1:2016 17.3.2.26 for more information about that algorithm.
Comment 1 Buovjaga 2025-07-10 05:45:39 UTC
Let's set to NEW.
Comment 2 Commit Notification 2025-07-12 04:29:35 UTC
Jonathan Clark committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/38ae7a6e1cb9adfd3fe67be409fb7b5bcaba3c82

tdf#167297 sw: Add support for DOC/DOCX script type hinting

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Eyal Rozenberg 2025-07-12 07:43:53 UTC
Jonathan, I take it that, to faithfully reproduce the w:hint semantics, we would need to choose a different set of characters which take hints, as discussed in bug 167301? 

And if that is the case - should this really be marked fixed already?
Comment 4 Eyal Rozenberg 2025-07-13 20:02:10 UTC
For completeness of this bug, can you briefly give an example of a use of w:hint in OOXML?
Comment 5 Commit Notification 2025-07-14 19:38:55 UTC
Jonathan Clark committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/9824f9feb562424ddb478dee32c76aa85db5e90e

tdf#167297 sw: Add support for DOC/DOCX script type hinting

It will be available in 25.8.0.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Jonathan Clark 2025-07-15 20:35:51 UTC
Created attachment 201812 [details]
Example DOCX
Comment 7 Jonathan Clark 2025-07-15 20:36:09 UTC
Created attachment 201813 [details]
Example DOC
Comment 8 Jonathan Clark 2025-07-15 20:53:46 UTC
(In reply to Eyal Rozenberg from comment #3)
> Jonathan, I take it that, to faithfully reproduce the w:hint semantics, we
> would need to choose a different set of characters which take hints, as
> discussed in bug 167301? 
> 
> And if that is the case - should this really be marked fixed already?

Yes. In my mind, this bug tracks I/O and mapping these attributes into our document model. The semantic differences are already known and arguably tracked by other bugs - but we could be more specific about the need for a compatibility flag for a Word-compatible script assignment/bidi algorithm (bug 129038, for instance).

One thing to note: This is only applicable to CJK documents. Even though the cs value is accepted, Word doesn't use w:hint for RTL/CTL. Instead, it uses <cs/> for a hard override. We don't handle <cs/> yet.
Comment 9 Eyal Rozenberg 2025-07-17 22:26:40 UTC
Expanded the title somewhat to better clarify that we don't yet have the w:hint semantics.
Comment 10 Eyal Rozenberg 2025-07-17 22:27:49 UTC
(In reply to Eyal Rozenberg from comment #9)

Well, it's not quite clear, but one can at least deduce that w:hint is not fully implemented if we only have style:script-type.