Hacker News
Font with Built-In Syntax Highlighting (2024)
cyanmagenta
|next
[-]
vbezhenar
|next
|previous
[-]
benrutter
|root
|parent
|next
[-]
I took it to be along the lines of an "easier to work with" type motivation, rather than reducing package sizes.
mg
|next
|previous
[-]
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?
onion2k
|root
|parent
|next
[-]
I slightly expect you to pull a "no true Scotsman" here and suggest it's actually no good because it doesn't really support mobile browsers very well, but Microsoft's Monaco editor that's driven from VS Code is quite good. https://microsoft.github.io/monaco-editor/
mg
|root
|parent
[-]
When I hit ctrl+f on that page and type "export":
First it says "1 of 4 matches" but nothing is highlighted.
When I hit enter, it says "2 of 4 matches" and again, nothing is highlighted.
When I hit enter again, it says "3 of 4 matches" and the first match is highlighted.
When I hit enter again, it says "4 of 4 matches" and the second match is highlighted.
gethly
|root
|parent
|previous
[-]
mg
|root
|parent
[-]
hyperhello
|root
|parent
[-]
jasonjmcghee
|next
|previous
[-]
665 points | 137 comments
spockz
|next
|previous
[-]
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.
Sayrus
|root
|parent
|next
[-]
> It only works where OpenType is supported. Fortunately, that's all major browsers and most modern programs. However, something like PowerPoint doesn't support OpenType.
zX41ZdbW
|next
|previous
[-]
This is a blocker for my applications.
eviks
|next
|previous
[-]
The whole post proves the opposite is true!
cluckindan
|next
|previous
[-]
Gracana
|next
|previous
[-]
koct9i
|root
|parent
[-]
ErroneousBosh
|root
|parent
[-]
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?
mock-possum
|next
|previous
[-]
Interesting indeed! This bit feels like a neat bit of hackery to keep in my back pocket for sure.
TheRealPomax
|next
|previous
[-]
But then why does the color disappear if I disallow scripts on this page? Instead of your font, now it uses Consolas.
Are you using JS to load the font in? (if so... web fonts don't need JS to load =)
california-og
|root
|parent
[-]
TheRealPomax
|root
|parent
[-]
california-og
|root
|parent
[-]
TheRealPomax
|root
|parent
[-]
california-og
|root
|parent
[-]
TheRealPomax
|root
|parent
[-]
Which doesn't work without JS. So adding the @font-face to the page itself, so that things works even without JS, would be lovely.