Live data from Hacker News

Font with Built-In Syntax Highlighting (2024)

blog.glyphdrawing.club

11–20 of 39 posts

Re: Font with Built-In Syntax Highlighting (2024)

#12

So script inside web page is bad, but script inside font is good? That's interesting definition of bloat. I'd prefer ordinary webpage using locally installed fonts with explicit JavaScript snippet to highlight keywords.

Remember llama.otf?

llama.ttf

https://fuglede.github.io/llama.ttf

Re: Font with Built-In Syntax Highlighting (2024)

#13

I view stuff like this kind of like code that fits into a bootloader or whatever. It’s really more of the technical challenge than to actually solve a problem. The result is much better if you just run a script on your hand-coded file to add syntax highlighting as DOM elements. Still, love seeing stuff like this.

For blogs, I like the site to stay static. This is a neat way to keep it that way. Having your generator do it is better in my opinion though.

Re: Font with Built-In Syntax Highlighting (2024)

#16
post #9

Has anyone tried this with PowerPoint yet? Our org is very PowerPoint centric and always struggle a bit with the workflow for code. Copy pasting from IntelliJ does give colours but none of the other niceties such as kerning or litigation. Screenshots are nice visually but a pain to maintain.

*ligatures

Is kerning a thing for monospace fonts?

Re: Font with Built-In Syntax Highlighting (2024)

#17
post #11
post #6

Perhaps you could add this technology to Z80 sans, to get syntax highlighted Z80 disassembly. https://github.com/nevesnunes/z80-sans

And add Z80 emulator as well. Just in case.

Well someone else mentioned llama.ttf which is a font that embeds an llm, using Harfbuzz's WASM engine.

So, you could absolutely write a WASM Z80 emulator and embed it in a font. Whether or not you could make it do anything useful, or how strong your grip on reality would remain after? I don't know.

But it wasn't like you were doing anything else on the days between Christmas and New Year, right?

Re: Font with Built-In Syntax Highlighting (2024)

#18
This is interesting.

I have yet to see a good web based text editor with syntax highlighting. They all mess with the native search functionality of the browser. Because they can't just use a textarea for the edit area. With this approach, it would be possible.

I wonder how usable a Python version of this would be?

Re: Font with Built-In Syntax Highlighting (2024)

#20
post #18

This is interesting. I have yet to see a good web based text editor with syntax highlighting. They all mess with the native search functionality of the browser. Because they can't just use a textarea for the edit area. With this approach, it would be possible. I wonder how usable a Python version of this would be?

FYI, IDEs and editors too don't use "textarea". Contenteditable essentially makes the web browser work like editor does.
Post reply on HN