Follow

Let me show you the oddest, coolest thing I've seen today.

Bonus points if you can figure out how it's done! Answer in next toot.

· · Web · 3 · 4 · 4

spoilers 

So first I thought it would be frontend magic, CSS at best, gnarly JS at worst, because we're talking about Twitter, ffs. But nope!

The answer is in the font, as it should be, but it's not (as some of you guessed) a ligature: ligatures turn two+ glyphs into one.

It's a single glyph substitution!

spoilers 

Font substitutions can take several shapes: multiple to one (ligatures), one to multiple (ligature decompositioning), and two versions of one to one substitution: one where alternate forms of the same glyph, often stuff like &, are provided, and one where a glyph is swapped.

spoilers 

We're dealing with the last kind here: :)

@rixx oh maybe this helps us with our issue with character replacement: github.com/rugk/unicodify/issu

Though I doubt so, as we inject JS there for that to work…

@rugk shouldn't matter, as this is a front rendering thing, not encoding

spoilers 

@rixx Does this mean the font replaces the colon with a special colon and the parens with a special parens if they are next to each other? Or have I understood it incorrectly?

spoilers 

@lukasbestle only the default colon glyph is replaced with a different one, when it is followed by a )

@rixx two glyphs being replaced by a single emoji glyph, with the baseline not reflecting the individual characters and hence being higher?

Sign in to participate in the conversation
chaos.social

chaos.social – a Fediverse instance for & by the Chaos community