Bug 106733 - Implement ODF attribute fo:hyphenate to exclude a portion of text from hyphenation
Summary: Implement ODF attribute fo:hyphenate to exclude a portion of text from hyphen...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.4.0.0.alpha0+
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL: https://docs.oasis-open.org/office/Op...
Whiteboard: target:24.8.0 target:24.2.1
Keywords:
Depends on:
Blocks: ODF-import Authors
  Show dependency treegraph
 
Reported: 2017-03-23 23:39 UTC by Regina Henschel
Modified: 2024-01-24 20:01 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshot of the new checkbox "Exclude from hyphenation" (142.73 KB, image/png)
2024-01-24 14:00 UTC, László Németh
Details
test document (9.50 KB, application/vnd.oasis.opendocument.text-flat-xml)
2024-01-24 20:01 UTC, László Németh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2017-03-23 23:39:09 UTC
This is translated feature request from http://listarchives.libreoffice.org/de/discuss/msg20770.html

Request: Add an option to exclude a portion of text from hyphenation. There is a workaround to set the language to "none". But then you loose spell check and thesaurus.

ODF 1.2 has already the suitable attribute "fo:hyphenate" in section 20.188, part 1. Currently LibreOffice does not even keep the attribute, if it is present.
Comment 1 Buovjaga 2017-03-30 12:21:13 UTC
Ok -> NEW
Comment 2 Regina Henschel 2021-12-10 22:54:47 UTC
20.195 fo:hyphenate in ODF 1.3

Implementation is still missing in Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 4ac9032163cf55c160145373e7c41741c9c339ca
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: de-DE (en_US); UI: en-US
Calc: CL
Comment 3 Regina Henschel 2021-12-10 23:00:10 UTC
Next step: Proposal for UI for the new feature.
Comment 4 Heiko Tietze 2021-12-13 11:01:58 UTC
I see no difference to v1.2 20.188 fo:hyphenate. What exactly has changed? 

Hyphenation is enabled for whole paragraph via Text Flow > Hyphenation = Automatically. So we need this option on the character properties dialog and I suggest to have one frame labeled "Hyphenation" under Spacing containing the checkbox "[ ] Exclude from hyphenation".

The topic reminds me on bug 131487 where spell-checking should be suppressed for mixed-language words. We could name the frame Options and have another checkbox there.
Comment 5 Regina Henschel 2021-12-13 14:07:06 UTC
(In reply to Heiko Tietze from comment #4)
> I see no difference to v1.2 20.188 fo:hyphenate. What exactly has changed?

No content change, but section number is shifted from ODF 1.2 to ODF 1.3.
Comment 6 Commit Notification 2024-01-18 23:43:29 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/73bd04a71e741788a2f2f3b26cc46ddb6a361372

tdf#106733 xmloff: keep fo:hyphenate in character formatting

It will be available in 24.8.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 7 László Németh 2024-01-19 11:47:22 UTC
Description of the previous commit:

tdf#106733 xmloff: keep fo:hyphenate in character formatting

In the case of character formatting, map fo:hyphenate to the
unused CharNoHyphenation character property to keep it
during ODF import/export instead of losing it completely.

This is the first step to disable hyphenation for single
words or text spans in paragraphs with automatic hyphenation.

Note: using fo:hyphenate as character property is part of
the ODF standard.

Note: the old workaround to disable hyphenation, changing
the language of the text to None had got some serious fallbacks:
losing spell checking and losing language-dependent text
layout (supported by both OpenType and Graphite font engines
in LibreOffice).
Comment 8 Commit Notification 2024-01-19 16:38:25 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/b5e275f47a54bd7fee39dad516a433fde5be872d

tdf#106733 sw: implement CharNoHyphenation

It will be available in 24.8.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 9 László Németh 2024-01-19 16:42:55 UTC
Description of the previous commit:

tdf#106733 sw: implement CharNoHyphenation

Implement CharNoHyphenation character property to
disable automatic hyphenation of words in paragraphs
with enabled hyphenation.

Fix also fo:hyphenate mapping to CharNoHyphenation
using automatic inversion of their boolean values
defined by xmloff's XML_TYPE_NBOOL, as suggested by
Michael Stahl.

Update also the test for tdf#159102 to check the available
hyphenation dictionary (also custom hyphenation patterns
work only with supported locales of the hyphenator).

Note: patch of thints.cxx contains also partial revert
of commit 53b289eabb3d265b47bc7fb6cc430291c97f0c0b
"use more TypedWhichId".

Follow-up to commit 73bd04a71e741788a2f2f3b26cc46ddb6a361372
"tdf#106733 xmloff: keep fo:hyphenate in character formatting".
Comment 10 Commit Notification 2024-01-22 12:02:08 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/05292d3fd50c64ac0b2a927334c39fe63aa3a108

tdf#106733 xmloff: keep fo:hyphenate in character formatting

It will be available in 24.2.1.

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 11 Commit Notification 2024-01-22 15:56:53 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9193e61d3e7b850b3715c848c09434e24855340b

tdf#106733 sw: fix bad downcast in SwTextNode::GetLang()

It will be available in 24.8.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 12 Commit Notification 2024-01-24 11:12:36 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/04c92ff9cfec039f7fc03277de46d77bb3109431

tdf#106733 sw: implement CharNoHyphenation

It will be available in 24.2.1.

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 13 Commit Notification 2024-01-24 11:12:39 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/de8a6c90c7aa5d26f758a590bad955cd62251702

tdf#106733 sw: fix bad downcast in SwTextNode::GetLang()

It will be available in 24.2.1.

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 14 László Németh 2024-01-24 14:00:43 UTC
Created attachment 192147 [details]
screenshot of the new checkbox "Exclude from hyphenation"
Comment 15 Commit Notification 2024-01-24 19:57:49 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/03c5a31a0f374a90fbc821718c14dc5f8a385adf

tdf#106733 sw cui: add CharNoHyphenation checkbox

It will be available in 24.8.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 16 László Németh 2024-01-24 20:00:28 UTC
Commit description:

tdf#106733 sw cui: add CharNoHyphenation checkbox

On Position tab of Character formatting dialog window
as a new checkbox "Exclude from hyphenation" (UX design
by Heiko Tietze).

With this, it's possible to disable hyphenation
with direct character formatting (e.g. combined with
Find All), or using character styles, and setting
"Exclude from hyphenation" in them. This feature
is conformant to the OpenDocument standard, and
unlike the previous locale=None workaround, it keeps
spell checking and locale dependent text layout.

Note: Clear direct formatting (Ctrl-M) is an
alternative way to remove the enabled CharNoHyphenation
(e.g. in version 24.2, where this commit won't
be back-ported).

Follow-up to commit b5e275f47a54bd7fee39dad516a433fde5be872d
"tdf#106733 sw: implement CharNoHyphenation".
Comment 17 László Németh 2024-01-24 20:01:11 UTC
Created attachment 192152 [details]
test document