3 ms·
My problem with this kind of essay is, even if it might contain useful information, it presents the problem as "omg this is way too complicated it's almost insu
by hsn915 4y ago
My problem with this kind of essay is, even if it might contain useful information, it presents the problem as "omg this is way too complicated it's almost insurmountable".
This is a common trend I keep seeing in technical blogs, and I don't understand why they do it.
Look, it's not that. It's just a series of small problems. Solve each problem one at a time, and you'll approximate a complete solution as you iterate further and further. Your first iteration will not be perfect, but so what?
- csande17 4y agoThe underlying assumption of all these "handling text is impossible" blog posts is that you're trying to write a text renderer that handles every language in the world. This is indeed very hard, as many languages require their own typesetting features and special cases. It's hard to solve this iteratively when you don't speak all of the languages involved. In some cases this is just an unspoken assumption because the blog posts are looking at, say, Firefox, and Firefox supports a lot of languages. In other cases, it's framed as a moral or professional imperative -- you're a bad developer if you don't consider the needs of Arabic users, if not a bad person. (I'm not sure how I feel about the globalist/colonialist worldview that seems to drive this idea that Arabic users won't have any software if Silicon Valley doesn't write it for them. I guess if you work at a big global megacorporation, it's your job to write big global megasoftware.) But yeah, if you aren't trying to do that, then text is a much easier problem than these posts describe. Tons and tons of embedded devices, video games, and so on get away with having much simpler text rendering and layout code that only supports a few languages. In English, you really can start with a very simple layout system, then add features like kerning and ligatures and hyphenation and watch the text get progressively nicer-looking!
- gernb 4y agoOr if you're smart you won't reinvent the wheel. It's already been done. use one of them
- hsn915 4y agoSupporting Arabic is not that hard. It's not as complicated as these blog posts are presenting it to be.
- csande17 4y agoI don't think any individual language is too hard—after all, humans can learn to read and write them—but doing all of them at once is tricky.
- hsn915 4y agoThat hard part is already done by HarfBuzz; segmenting text for feeding it into harfbuzz is not that hard. I've done it with hardly any prior experience (and even written a blog post about it) https://hasen.substack.com/p/imgui-text https://hasen.substack.com/p/imgui-text