Unicode has "combining characters". How to use them?
Asked Answered
M

4

12

with combining characters one can use 2 unicode characters at single location, creating a composition of two graphics. I'm thinking about simple ascii art, I would need to first use, as wikipedia says "SQUARE WITH HORIZONTAL FILL" ▤, and then on top of that, the letter "A". How to accomplish this?

Marlinmarline answered 23/6, 2018 at 15:25 Comment(3)
I'm not sure there are characters that can combine arbitrary other characters. Instead, I thought "combining characters" were characters that intend to modify other characters, like putting themselves on top of that other character. I really have no idea though.Ora
SQUARE WITH HORIZONTAL FILL is not a combining character, as you can see Combine: 0 in the properties. Combining characters are the ones that are supposed to put on another like Å (U+00C5) which has another representation: A (U+0041) + combining ring above (U+030A)Beryl
It is not arbitrary, it is the text rendering engine that combines them into a single glyph. It knows about the typographic rules in the current UI language. Quite unlikely that it does what you want it to do.Beneficent
K
11

What is possible with the method you describe is a kind of abuse of diacritical marks. Fell free to play around a bit with it using following demo ( http://demo.danielmclaren.com/2015/diacriticism/ ).

Below some screenshots of the Unicode code I have got from the demo above:

Claudio.txt content copied to a terminal Claudio.txt content copied to a terminal

Claudio.txt displayed in gedit Claudio.txt displayed in gedit

Claudio.txt displayed in SciTE Claudio.txt displayed in SciTE

Sorry, but I don't know at the moment why exactly the representation of same underlying Unicode text is looking different in SciTE.

Here the HexCode of the Claudio.txt file:

Claudio.txt displayed as hex code in GHex Claudio.txt displayed as hex code in GHex

and here the Unicode copied/pasted to the stackoverflow answer editor box:

C̱̙̳̲͇͉̄̄̚l̝̩̩̝̺̠͞ā̝͉̩̟͆u̻͈̘̞̪̅̿d̝̄̅͆̚i͇̙͈̎̚o̘̟̎̄̄̎

As you have to be able to show ASCII art in a terminal I assume that there is no way to overlay two arbitrary Unicode characters for this purpose.

Kisser answered 23/6, 2018 at 18:47 Comment(0)
G
3

Depending from the application or browser there are two ways to use the Unicode Combining Diacritical Marks:

  • With ā (a macron) as example, you may try to type in the 'a' first followed by the decimal code & #772;

  • or ALT+ (it must be the + from the numeric keypad) followed by the hexadecimal code 0304 (i.e U+0304).

In some cases you can type in the combining diacritical mark first, followed by the 'a' or any other leading letter.

Geryon answered 12/5, 2020 at 9:32 Comment(2)
For example in Ubuntu Text Editor type ` x CONTROL SHIFT U 364 SPACE` and you will get an x with an e on top of it.Liturgical
a first and ̄ next, in some cases ̄ first and a next. What the heck? There must be a standardized way of doing it. It's not about guessing, is it?Fasciation
E
1

Square with Horizontal Fill U+25A4.

Combining Latin Small Letter A U+0363.

To obtain Square with Horizontal Fill topped by 'a' ▤ͣ in Ubuntu Text Edit, type

SHIFT CONTROL U 25A4 SHIFT CONTROL U 363 SPACE

Combining Latin Capital Letter A does not exist.

Ertha answered 20/1, 2022 at 16:18 Comment(0)
S
0

This is just for the mac users, but I came across this question and had no way of attempting to do this myself, I found this afterward for actually writing unicode characters without having to fool around: https://www.webnots.com/how-to-use-unicode-hex-input-method-in-mac/

tldr; There's a keyboard input encoding for Unicode Character input in Mac OS in the same area that you would enable other keyboard layouts for other languages. It's under Other at the bottom.

Symbolism answered 29/8, 2023 at 19:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.