3

I want to type zero-width space, Unicode U+200B; and also thin-space U+202F or hair-space U+200A (to achieve emphasis where I do not have control of the letter-spacing through CSS).

I prefer not to install the Unicode Hex Input Keyboard because then I have to rotate through it every time I switch languages, which I often do. I am willing to take a few seconds to open an app and type the Unicode.

This can be done with Character Viewer for many other characters. But with these characters, the character does not appear when I type it (screenshot below).

How can I enter these characters? I was hoping that some sort of key combination, e.g. ⌘⇧ ⌥-200B, would do this, but something like Character Viewer is good too.

enter image description here

5
  • Apple does not use key combos with numbers like that, except via the Hex keyboard, so that is not an option. Commented Feb 27, 2022 at 15:11
  • Assuming a finite number of characters (e.g. odd spaces), search by name (e.g. 'thin', 'hair'). The results should include them in the second results section (should be titled 'Unicode Name'). It might be easier to test with a visible character but among the results, there should be a blank area which you can click on, as you have clicked on the 'u' above — if you search for 'space', you should get many such results. When you click on the 'space', then on the right, you should see its name so you can confirm. Then click 'add to favorites', which will add section on left and in it, the space.
    – Mockman
    Commented Feb 27, 2022 at 16:04
  • As well, you could then add some text shortcuts (under keyboard in Sys.Prefs) to facilitate entry. For example, I have added 'sq2' to type the 'squared' 2 superscript (e.g. ²). This doesn't work everywhere (like in this text entry box) but it's handy.
    – Mockman
    Commented Feb 27, 2022 at 16:10
  • Mockman, you are right about searching for 'thin' or space. I don't, however, see how to add this to a keyboard.
    – Joshua Fox
    Commented Feb 27, 2022 at 16:39
  • @Mockman please add the idea of searching for 'thin' or 'space' as an answer, so I can upvote it
    – Joshua Fox
    Commented Feb 27, 2022 at 16:58

2 Answers 2

2

In Character Viewer, add Unicode to your list on the left and go to the 2000 General Punctuation range. Unicode is found in the "Code Tables" category when you click on the Gear Wheel and select Customize.

Also you can pretty easily add the extra characters you need to any language layout with Ukelele.

3
  • The Ukelele suggestion is great, thanks!
    – Joshua Fox
    Commented Feb 27, 2022 at 16:57
  • Re adding Unicode, thank you, but I don't see "Unicode" in Char Viewer imgur.com/a/EyULiUf I see Emoji, Arrows, Latin, etc, but not Unicode.
    – Joshua Fox
    Commented Feb 27, 2022 at 16:57
  • 2
    @JoshuaFox you click on the gear wheel to customize the list. Look at Code Tables Commented Feb 27, 2022 at 19:49
1

Within the character viewer, you can also search for unicode characters by name, e.g. 'thin', 'hair', 'space'. When you do, the search results will have a second section, 'Unicode Name'. This will contain characters that contain the search string in their name (e.g. 'thin space', 'hair space', 'no-break space', and even 'backspace').

Once you click on an individual result (as 'u' is in the OP), you can then click 'Add to Favorites'. This will add a 'Favorites' section on the left, above Search Results, and all characters so added will be available there‡.

Normally, to simplify entry, you can add a keyboard shortcut, but alas, it looks like you can't use just a space, thin or otherwise, as a replacement character in a keyboard shortcut. Maybe because shortcuts are triggered with a space… dunno.

However, as a clumsy alternative, you could add an oddball character, using something like  ⎋, as the replacement and then backspace to delete the . First, using the character viewer, add a thin space along with the oddball character to an otherwise empty TextEdit document, select all and copy to the clipboard. Then (at least in Sierra) go to System Preferences > Keyboard > Text. Below the 'replace' section… click the + button and type some unique string, e.g. ths for thin space. Hit tab to move to the 'with' side and paste the previously copied text and hit return. Thereafter, if you type ths in a document and then type space (or some punctuation) it will replace the 'ths' with an actual thin space along with the extraneous character. If you do this, I would suggest using a character you would never use otherwise as then you can also do a standard search and replace to get rid of every instance.

It might be worth testing with a visible character to see how it all works. Repeat for hair space or any other oft-used awkward character. FYI, there are some environments in which these shortcuts don't work, e.g. some text entry boxes such as this one, or in the Terminal.

Incidentally, you can add 'Unicode' as a character set on the left of the character viewer window by clicking the gear drop down and then 'customize list…'.

‡ As a bonus: Some character sets are fairly deep (e.g. kanji, unicode), which means that it can be difficult to determine where to look for the character (i.e. browsing rather than searching). When you have a character selected, its background changes, and if you click on a character set that contains it, it will automatically be highlighted within that set and you will henceforth know how it is categorized.

2
  • Re adding Unicode, thank you, but I don't see "Unicode" in Char Viewer imgur.com/a/EyULiUf . I see Emoji, Arrows, Latin, etc, but not Unicode. – Joshua Fox 2
    – Joshua Fox
    Commented Feb 27, 2022 at 19:46
  • 1
    @JoshuaFox it’s in Code Tables Commented Feb 27, 2022 at 19:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .