This is definitely not how I imagined my Thursday would start
I saw the best minds of my generation destroyed by the slop machine, hysterically feeding tokens to an LLM looking for an angry fix.
@ebassi HarfBuzz? Yeah, that sucks.
@scaroo @ebassi
Can you (or anyone) explain what HarfBuzz is/does like I'm 5?
@retrimental @ebassi Can't really help you. HarfBuzz, Freetype, the toolkits and their responsabilities and interactions are a mystery to me. But I know that half the world (GTK, Qt, Chrome, Firefox and many others) depends on it for displaying text.

@retrimental it turns text into individual elements that can be mapped to individual shapes that can then be rendered. Latin is somewhat simple (if you ignore ligature marks and things like word breaks), but it gets really complicated for other, non-western writing systems

@scaroo

@ebassi @scaroo
Okay I think I get the gist of it now. Seems to convert the Latin alphabet into other languages outside the Latin alphabet in a way that tries to conform to our a standard way of writing/reading.

I could be wrong but that's what I got of it. Thank you guys.

So why the hell does that need AI?

@retrimental no, it does not convert "Latin alphabet" into other languages: it allows other languages to be drawn on screen. Imagine using arabic, and not being able to write a document with it; HarfBuzz is what made that possible on open source systems first, and now basically everywhere on the web.

The primary author has been working on this for the past 25 years; recently he started using genAI to "code" a bunch of it.

@scaroo

@retrimental @ebassi @scaroo That's the problem. It doesn't.

@retrimental @ebassi @scaroo

Simple fonts for certain scripts like Latin can just have one glyph for each Unicode character they cover and it will work. Advanced fonts are more complex and need to map sequences of characters onto sequences of glyphs.

HarfBuzz takes the sequence of characters, the rules defined by the font standard, the rules and metadata defined in the font itself, and various other context and figures out which of the font's glyphs need to be used,

@retrimental @scaroo @ebassi My understanding from quickly reading https://harfbuzz.github.io/what-is-harfbuzz.html, is that it takes a Unicode string and font, figures out which drawing (glyph) to take from the font, and in which order, and returns that sequence. It basically takes "48 45 4C 4C 4F" and replies "take an H, then an E, then an L ... and that's how you draw HELLO".
What is HarfBuzz?: HarfBuzz Manual