Introducing Glyph Protocol for Terminals

24 points by goldstein 7 hours ago on lobsters | 7 comments

WilhelmVonWeiner | 3 hours ago

Why not just bundle nerd fonts in terminals? Do we need to do this much for graphics in a text-mode interface? Should you not just use a GUI at this point?

singpolyma | 2 hours ago

A "TUI" is a GUI, just not a very graphically good one.

I think most people would actually be happier with heavily keyboard driven "real" GUIs, but they're not very popular to make.

ThinkChaos | 3 hours ago

I just install the standalone nerd font, so all applications pick it up as a fallback and it just works. I'm not sure why patching is even a thing.

e3bc54b2 | 7 hours ago

Fonts are a distribution problem disguised as a rendering problem.

True!

If the user already has Nerd Fonts installed, a query lets you skip shipping your own glyph entirely; if they don’t, you ship the outline and the icon shows up anyway.

Nice! Before I went reading in, I was really hoping that application-shipped stuff to be easily overridden by user, similar to whole font right now, and the protocol actually puts that on priority. Thanks a lot for working on this, I cannot wait to see it evolve with more features.

abnercoimbre | 4 hours ago

Man.. we need sustained discussions on Unicode rendering in general! I'm about to ship UTF-8 support on my emulator next weekend and I'm surprised by lack of industry consensus.

Like I have to make bizarre choices around the grid placement of grapheme clusters, after text shaping the gnarlier codepoints. (Translation: how many grid columns should your emoji occupy?) This is an open-ended problem because terminals disagree on how to handle this -- notice the "closed" GitHub issue is still referenced all the damn time.

Back to our original quote:

Fonts are a distribution problem disguised as a rendering problem.

For sure. I have certain fallback fonts bundled with the emulator. We lazily load the glyphs we detect don’t exist in the user's font. Not super pleased with that complication, but it's less irritating than users reporting the terminal's broken.

This problem is an entirely alien experience for me, and I really don't want this complexity in my terminal. It's already nearly impossible to make reliable.

Please just start writing GUIs.

davidg | an hour ago

Not necessarily a bad idea - DEC terminals have been able to do this since the early 80s, though with bitmap fonts rather than vectors.

Use of APC strings is probably a bad idea - other programs do use these without any kind of prefix, so its not safe to assume other software will simply ignore an APC string it won't recognise. DCS strings are probably a better choice - this is what DEC terminals use for their soft-fonts among other things, and unlike APC strings they already have an established convention of using a prefix to denote the format of what follows.