Skip to content

Comment on Writing a TrueType font renderer

Comments

Working in games, font code is truely the depths of hell that you try to punt to someone else as often as you can.

Maybe one day we will support right to left text!

relevant: https://faultlore.com/blah/text-hates-you/ ("Text Rendering Hates You"; discussed quite a bit but under its old URL https://hn.algolia.com/?query=text%20rendering%20hates%20you... )

It's not quite one of the "misconceptions programmers have about ..." but in the same vein, IMHO

Godot first merged support for RTL/BiDi about three years ago. It looks like unreal might also support those too but I can’t confirm that.

Maybe you know this one: for UI in games, do devs create an entire windowing environment from scratch? It seems like that would be the best way to do it but man what a lot of work.

Sometimes. It depends on the UI requirement for the game.

I have seen some extremely-UI-heavy games which do exactly what you say; building a whole windowing environment entirely from scratch. (I'm working on a game that's doing that right now!).

But most major game engines provide a basic UI toolkit if your needs aren't too intense, and those are often more than enough for most games and are a whole heap less effort; they can typically be themed so that your UI doesn't look like everybody else's UI, and if all you need is a single window with some widgets and buttons and maybe a text field, that's probably going to be more than enough for you. Like, 95% of games would probably be totally fine with just that.

Maybe five years back I worked on and adjacent to a couple large games that were building their UI in an embedded copy of Flash (which wasn't as dead as people think!) Not sure whether large games are still doing that now, but it wouldn't surprise me if there are still some holdouts building their game UIs entirely in Flash!

Ubisoft used to use ScaleForm, the alternative Flash runtime for games, for a lot of the Assassin's Creed games.

I know some games use a specialised version of WebKit, for example Sea of Thieves uses Coherent UI[1]. There's also Ultralight[2] (ex Awesomium) which is similar.

Games using vanilla Unreal Engine can use what they call UMG, but otherwise there's plugins for most frameworks.

Some other games have completely custom frameworks of course.

[1] https://coherent-labs.com/Documentation/cpp/ [2] https://ultralig.ht/

I was part of a team that delivered four SKUs, DOS and Windows versions of two games. We made a fairly complete version of a GUI environment so that the DOS games would look like the Windows versions. We didn’t rasterize the TrueType fonts. We only used one size in Windows, so we used a bitmap font for DOS and it was enough.

The other day I saw a comment saying that fonts are made complicated by turning them into programs, which you can legally protect as IP, is there any truth to that?

Roughly true. Rasterized fonts are typically not copyrightable. The font files, or as you suggest, programs, are.

If you see a font you think is cool, you can pretty much rip off the style without any real consequences. This is often why font licenses for print media are priced very differently than digital media where the font is redistributed.

To clarify fonts are not made complicated so they can legally pose as software. There are many real reasons why they are complicated. Yes they are licensed as software (they are sort of plugins) but its not related to the complicateness.

PostScript fonts exist and PostScript is a Turing-complete language. Source code is copyrightable, so this tracks

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.