OverStrike control character

abrahamgross at disroot.org abrahamgross at disroot.org
Tue Jun 16 11:43:16 CDT 2020


> What are these "pixels" to which you refer?  Fonts these days are defined in terms of strokes, not pixels. 
> 

even though fonts are vectors, they still get rendered onto a raster screen. but the point was that they get overlayed and centered horizontally.

> Consider <l, OVERSTRIKE, m> and <m, OVERSTRIKE, l> in a proportional
> width font.  Are you expecting the rendering system to position the 'l'
> using the knowledge that it will be overstruck? Overstriking is
> designed for a teletype with fixed width characters.

You can think of the knowledge of being overstruck like the knowledge fonts have of characters being combined to with diacritics – Fonts can specify an anchor point where the diacritics will go. Except with overstrike, the anchor will always be the center. The overstrike character is sorta like a ZWJ (zero width joiner) that turns the next character into a "diacritic". (hope this explanation makes sense)

> Besides, even if it worked as you said, with the narrow character centered, how long would it take before you found some examples that didn't really quite work out right?  Like overlaying a HEBREW LETTER YOD on a LATIN CAPITAL LETTER L, but what you really wanted was the YOD centered in the negative space of the L and not between the side-bearings, so next you'll want to be able to add some control over the exact positioning.  And of course that won't work right in general, because it all depends on the font(s) involved.
> 

I will never make a proposal for the addition of control character to control positioning. If it doesnt come out quite right, then either live with it, or find another character that fits better. After all, since fonts are different you cant expect it to come out the same on every device (I'm agreeing with you on this). But i still think that an almost perfect rendition of the overstriked characters is way better than having none at all.

> Can I have "ab←←xy" (using ← for the overstrike) to overstrike a&x and b&y?  What about "a←b←c←d←e←f←g←h"?  What about "abc←d←←fg"? The f&b are overstruck and so are the c&d&g?  Is that combination of c←d overstruck with g different from c←d←g or the same?  What about other combinations?  These are all things that need answers. 
> 

You can only put one overstrike character in a row. If you type a second one, then it gets ignored. So ab←←xy will render as "a[bx]y" where [bracketed] characters are rendered overlayed.
a←b←c←d←e←f←g←h will look like [abcdefgh], all on top of each other.
abc←d←←fg will be ab[cdf]g. to get a[bf][cdg] you need to type ab←fc←d←g

the exact rendering will of course depend on the font of the device you're using, but again, i still think that an almost perfect rendition of the overstriked characters is way better than having none at all.

> What about overstriking a LTR character with a RTL one, or vice-versa?  Which way does the text go after that?
> 

The text after that goes in the direction of the text afterwards. So for “L←י‎א‎ב” its gonna look like “[L‌י‎]‎ב‎א‎” and for “L←יab” its gonna look like “[Lי]ab”. Meaning that only the very next letter gets overstruck, and anything afterwards continues on like it would normally.

Going back to the L←י example, heres what it would look like: https://imgur.com/a/N9QApwh

Here's a short command to generate the images, and it works for any 2 letter combinations. Just replace whats after `label:` with the letters you want to test how overstriking it might look like. (You need to install ImageMagick before using this though.)

```
	magick -background none -pointsize 100 \
		label:L label:י \
		\( -clone 0 \) -delete "%[fx:u.w>v.w?2:0]" \
		-gravity center -compose Over -composite \
		-background white -flatten \
	out.png
```
How it would like in a serif font:
```
	magick -background none -font "FreeSerif" -pointsize 100 \
		label:L label:י \
		\( -clone 0 \) -delete "%[fx:u.w>v.w?2:0]" \
		-gravity center -compose Over -composite \
		-background white -flatten \
	out.png
```
For windows users:
```
	magick ^
		in0.png in1.png ( -clone 0 ) ^
		-delete "%%[fx:u.w>v.w?2:0]" ^
		-compose Over -composite ^
		-background white -flatten ^
	out.png
```

Here's an example of a symbol that isn't widespread enough for its own codepoint, but which can be easily implemented through the usage of the overstrike key:
The symbol in usage: https://imgur.com/AMAVrZT
The symbol by overstriking ♡←𝄞: https://imgur.com/46ReTNu
The ImageMagick command to generate it: 
```
	magick -background none -font "FreeSerif" -pointsize 100 \
		label:𝄞 label:♡ \
		\( -clone 0 \) -delete "%[fx:u.w>v.w?2:0]" \
		-gravity center -compose Over -composite \
		-background white -flatten \
	clefheart.png
```


As for arrow keys, it should pass an overstruck combination in a single key press. However, the backspace key should remove only one of the overstruck characters, and not both/all at once. It should work like how combining diacritics work: it takes 3 presses of the arrow keys to go past "xỳz", but 4 BackSpace key presses to remove all of it because the grave gets deleted separately than the "y".



More information about the Unicode mailing list