Bug 121596 - Writer does not include a key combination to insert thin spaces (U+200A)
Summary: Writer does not include a key combination to insert thin spaces (U+200A)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Heiko Tietze
URL:
Whiteboard: target:6.3.0 target:24.2.0
Keywords: difficultyBeginner, easyHack, skillDesign, topicUI
: 101909 (view as bug list)
Depends on:
Blocks: Formatting-Mark
  Show dependency treegraph
 
Reported: 2018-11-21 16:20 UTC by mrmister001
Modified: 2024-03-14 18:31 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Layout with Space, U200A, U202F (65.47 KB, image/png)
2019-01-23 08:21 UTC, Heiko Tietze
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mrmister001 2018-11-21 16:20:24 UTC
PROBLEM: LibreOffice Writer do not comply with the basic orthography in Spanish, regulations from 2010

The regulation in question is available here, in Spanish
https://preview.ibb.co/e9T7qV/RAE1.jpg

Translated into english the regulation state very clearly that, to separate the thousands in figures, is necessary to insert a "THIN SPACE" between the groups of 3 numbers. 

Example:

With a normal Space:
4 727 174

The space you saw above is a standard space, the same space you get when pressing the space bar in your keyboard.

*** However, the regulations in Spanish forces you to use a thiner space than a normal space or hard space. *** This is a thin space:


With thin Space (Unicode 200A)
4 727 174

*** As you may see there is a huge difference between the normal and thin space. ***

Without any Space
4727174

This is a thin space:
https://en.wikipedia.org/wiki/Thin_space

This is a normal or standard space (the same you get when pressing the space bar)
https://en.wikipedia.org/wiki/Space_(punctuation)

To see the differences among a normal, thin and long space, please, see this picture:
https://preview.ibb.co/jhvRjq/RAE2.jpg

-------------------
SUGGESTED SOLUTION:
-------------------
LibrOffice writer should be able to insert different kind of spaces when pressing spacebard on the keyboard with a combination of keys.
The proposed combination is as follows

Spacebar ----------> Insert a normal space
Ctrl + Spacebar ---> Insert a thin space 
Alt + Spacebar ----> Insert a EN space

Note to the programmers: The spaces can be inserted easily just using the Unicode code. Basically is necessary to create a combination of keys associated to the spacebar that insert the unicode code for thin space, EN space, etc.

More space combinations could be obtained by playing the combination of keys:
Alt + Shift + Spacebar, Tab + Spacebar, Ctrl + Alt + Spacebar

A list of the Unicode spaces are here:
--------------------------------------

http://jkorpela.fi/chars/spaces.html

https://en.wikipedia.org/wiki/Whitespace_character#Hair_spaces_around_dashes


REMINDER TO THE LIBREOFFICE COMMUNITY
-------------------------------------
As you may know LibreOffice is being adopted by many governments in the world, and they are switching to the Open Source software. In Spain the government is paying special attention to follow the basic rules of grammar, so I consider this enhancement is absolutely necessary and IT IS NOT just an "asthetic matter".

Not accepting this enhancement or considering it just as non-important imply going against the basic grammar rules. Please, have that in mind before taking any decission.
Comment 1 Heiko Tietze 2019-01-15 09:11:59 UTC
The character is also called hair space. You can insert it easily per special characters (add to favorites).

So the question is if we want to assign special whitespaces by default to shift/alt/ctrl+space. I would say yes but hard to say which one/s is/are the most needed https://en.wikipedia.org/wiki/Whitespace_character
Comment 2 V Stuart Foote 2019-01-15 16:50:05 UTC
(In reply to Heiko Tietze from comment #1)
> 
> So the question is if we want to assign special whitespaces by default to
> shift/alt/ctrl+space. I would say yes but hard to say which one/s is/are the
> most needed https://en.wikipedia.org/wiki/Whitespace_character

The <Shift>, <Ctrl>, <Alt> + <Space> keys are available to assign as Keyboard shortcuts for the U+200A (HAIR SPACE), U+2009 (THIN SPACE), or U+2002 (EN SPACE) so my +1 to shortcut assignment by default.  

Document canvas needs some indication when any of these reduced/expanded spaces are present [1]. It would be appropriate that these codepoints be handled as current set of NPC, so that toggling the paragraph marks will also show them.

Finally, would there be enough variation in "official" typography that this set of spacing shortcuts need to be localized with a stanza added i18npool/source/localedata/data/*.xml?

=-ref-=
[1]https://en.wikipedia.org/wiki/Whitespace_character#Unicode
Comment 3 Heiko Tietze 2019-01-17 14:43:46 UTC
We discussed this in the design meeting and agree on the benefit of a shortcut. However, ctrl+space is occupied in many OS/DE and likely alt+space is also used in some so we suggest to have only one shortcut for ctrl+alt+space, which is ideally the U+200A thin space.
Comment 4 V Stuart Foote 2019-01-17 15:56:16 UTC
(In reply to Heiko Tietze from comment #3)
> We discussed this in the design meeting and agree on the benefit of a
> shortcut. However, ctrl+space is occupied in many OS/DE and likely alt+space
> is also used in some so we suggest to have only one shortcut for
> ctrl+alt+space, which is ideally the U+200A thin space.

REasonable, but the U+200A "HAIR SPACE" will need some treatment as a NPC, either Field shading <Ctrl>+<F8> or the NPC of the Formatting marks <Ctrl>+<F10> toggle. We'd be causing real problems with hidden characters if we do not address bug 58434
Comment 5 Alex Thurgood 2019-01-17 16:27:57 UTC
Please note :

On macOS :

Ctrl-Alt-Space launches the Finder Search dialog
Cmd-Alt-Space toggles keyboard configuration language

Please don't start messing with these.
Comment 6 Eike Rathke 2019-01-18 12:46:01 UTC
(In reply to V Stuart Foote from comment #2)
> Finally, would there be enough variation in "official" typography that this
> set of spacing shortcuts need to be localized with a stanza added
> i18npool/source/localedata/data/*.xml?
For number formatting, if the group separator in normal writing is a space then a U+00A0 NO-BREAK SPACE (NBSP) should be used (as also defined in locale data where applicable) instead, because you don't want your numbers wrap to the next line. Similar, if the group separator should be a thin space then for number formatting purposes it should be a U+202F NARROW NO-BREAK SPACE (NNBSP).

Whatever keyboard shortcuts would be assigned to enter various spaces is beyond the scope of i18npool's locale data.

However, programmatically the es-ES locale uses '.' dot as group (thousand) separator, see also https://ssl.icu-project.org/icu-bin/locexp?d_=en&_=es_ES under "Numbers : Western Digits" and https://unicode.org/cldr/charts/latest/verify/numbers/es.html

The cited article (attached screenshot) seems to talk about ISO 31-0 ("la normativa internacional"), in which the decimal separator can be either dot or comma and the group separator a small space, see https://en.wikipedia.org/wiki/ISO_31-0#Numbers
Comment 7 Heiko Tietze 2019-01-23 07:02:28 UTC
(In reply to Eike Rathke from comment #6)
> For number formatting...
Maybe far-fetched but would it be feasible to have some kind of number style in Writer like known from Calc that formats the selection according the locale?

U+202F sounds like a good idea. Will implement that...
Comment 8 Heiko Tietze 2019-01-23 08:21:48 UTC
Created attachment 148540 [details]
Layout with Space, U200A, U202F

Somehow U202F is not really narrow (using Liberation Serif). Going with 200A for the first patch, also because of the difficult autocorrection in textsh.cxx line 156.
Comment 9 Heiko Tietze 2019-01-23 09:31:30 UTC
Here is the patch https://gerrit.libreoffice.org/#/c/66776/ comments welcome
Comment 10 Heiko Tietze 2019-01-23 09:32:25 UTC
(In reply to Heiko Tietze from comment #9)
> Here is the patch https://gerrit.libreoffice.org/#/c/66776/ comments welcome

PS: I assigned the command to shift+alt+space which seems not to be occupied on macOS (at least on my system).
Comment 11 Eike Rathke 2019-01-24 13:45:45 UTC
(In reply to Heiko Tietze from comment #8)
> Created attachment 148540 [details]
> Layout with Space, U200A, U202F
> 
> Somehow U202F is not really narrow (using Liberation Serif). Going with 200A
> for the first patch, also because of the difficult autocorrection in
> textsh.cxx line 156.
U+200A HAIR SPACE is the thinnest available space of all and probably in some fonts barely makes a difference, do we really want that? It is not a commonly used space character, apparently used only between quotation characters of different levels and around EM dashes. Plus it is a breaking space not very suitable for the groups (aka thousands) separator, which was the original case of the request. SI defines a thin space, see https://www.bipm.org/en/publications/si-brochure/section5-3-4.html

Maybe we should define the purpose and use case first.

How does the actually used space character relate to "the difficult autocorrection in textsh.cxx line 156"?
(which is sw/source/uibase/shells/textsh.cxx in case someone wants to look it up)
Comment 12 Commit Notification 2019-02-18 11:28:39 UTC
heiko tietze committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/16bd9c99b8116f36e4f0825860e699d79cdf0d58%5E%21

Resolves tdf#121596 - Include a key combination to insert thin spaces

It will be available in 6.3.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 13 Heiko Tietze 2020-03-25 16:10:13 UTC
*** Bug 101909 has been marked as a duplicate of this bug. ***
Comment 14 Commit Notification 2023-09-20 21:33:39 UTC
Seth Chaiklin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/1c54900b4d40d11cbef8f14d2907d8d9f12c9f7b

(related)tdf#107447 update option names; tdf#121596 add "narrow no-break space"