Hacker News new | ask | show | jobs
by numpad0 13 days ago
I thought this discussion is more about somehow aligning pipes over multiple lines in existing console emulators(impossible), than about implementing a complete custom graphical text rendering system specific to your app that butcher font files to put glyphs wherever you want?

That feels like cheating since you're not rendering provided font at that point. Besides you might as well just use SVG for diagrams than pretending to be text only.

1 comments

> I thought this discussion is more about somehow aligning pipes over multiple lines in existing console emulators(impossible)

I am aligning pipes over multiple lines in my existing console emulator. It's not just not impossible, but near trivial.

> than about implementing a complete custom graphical text rendering system specific to your app that butcher font files to put glyphs wherever you want?

It's not butchering anything. It is using the font data to render them in the way that fits the constraints of the output.

> That feels like cheating since you're not rendering provided font at that point.

Any font renderer makes just adjustments to make the font look as good as possible. That is the entire point of providing a scalable font instead of a bitmap font: That you can render the provided glyphs at any scale suitable.

Fitting the bounding box of the glyph to the bounding box of the cell the text is rendering into is entirely reasonable and the lesser of two evils when faced with a glyph that does not fit the cell, which is a relatively common occurrence, when the alternative is to clip.

It looks awful if you were to render e.g. latin script with a proportional font in a fixed grid, but for many scripts with more uniform widths the variation is a lot less, and so it's butchering things far less than rendering fallback glyphs for missing code points.