> Merely keeping up with the stream of issues found by fuzzing costs Google at least 0.25 full time software engineers<p>I like this way of measuring extra work. Is this standard at Google?
I hope that if we switch away from FreeType, we'll still have a way to use TTF hinting instructions fully.<p>Windows/macOS don't seem to have a way to enable proper hinting anymore [0], and even FreeType (since 2.7 [1]) defaults to improper hinting (they call it "subpixel hinting", which doesn't make sense to me in theory, and practically still seems blurry, as if it's unhinted).<p>In case anyone's wondering what properly hinted text looks like, here's a screenshot [2]. This currently relies on setting the environment variable `FREETYPE_PROPERTIES=truetype:interpreter-version=35`, possibly some other configuration through fontconfig, and using a font with good hinting instructions (eg, DejaVu Sans and DejaVu Sans Mono in the screenshot).<p>My suspicion is that Windows moved away from font hinting after XP because it's very hard to create fonts with good sets of hinting instructions (aiui, OTF effectively only allows something like "autohinting"), so in the modern world of designer fonts it's easier to just have everyone look at blurry text. Some other minor reasons would be that UI scaling in Windows sometimes (or always?) introduces blurring anyway, and viewing raster images on screens of varying resolutions also introduces scaling blur.<p>[0] Windows still has a way to enable it, but it disables antialiasing at the same time. This is using an option called "Smooth edges of screen fonts" in "Performance Options"). This basically makes it look like XP, which imo is an improvement, but not as good as FreeType which can do hinting and antialiasing at the same time.<p>[1] <a href="https://freetype.org/freetype2/docs/hinting/subpixel-hinting.html" rel="nofollow">https://freetype.org/freetype2/docs/hinting/subpixel-hinting...</a><p>[2] <a href="https://gist.githubusercontent.com/Maxdamantus/3a58d8e764b299e8b1eaa524aab8e1bd/raw/313997632ad81ddd06f625ca02aa14ab244cf67f/hinted.png" rel="nofollow">https://gist.githubusercontent.com/Maxdamantus/3a58d8e764b29...</a>
This is the true power of Rust that many are missing (like Microsoft with its TypeScript rewrite in Go): a gradual migration towards safety and the capability of being embedded in existing project.<p>You don't have to do the Big Rewrite™, you can simply migrate components one by one instead.
So, there's Skia. Skia is a high-level library that converts texts to glyph indices, does high-level text layout, and caches glyphs (and it also makes GPU calls). But the actual parsing of the font file and converting glyphs to bitmaps happens below in FreeType.<p>Skia is made in C++. It's made by Google.<p>There's FreeType. It actually measures and renders glyphs, simultaneously supporting various antialiasing modes, hinting, kerning, interpreting TrueType bytecode and other things.<p>FreeType is made in C. It's not made by Google.<p>Question: why was it FreeType that got a Rust rewrite first?
I've recently been learning about how fonts render based on subpixel layouts in monitor panels. Windows assumes that all panels use RGB layout, and their ClearType software will render fonts with that assumption in mind. Unfortunately, this leads to visible text fringing on new display types, like the alternative stripe pattern used on WOLED monitors, or the triangular pattern used on QD-OLED.<p>Some third-party tools exist to tweak how ClearType works, like MacType[1] or Better ClearType Tuner[2]. Unfortunately, these tools don't work in Chrome/electron, which seems to implement its own font rendering. Reading this, I guess that's through FreeType.<p>I hope that as new panel technologies start becoming more prevalent, that somebody takes the initiative to help define a standard for communicating subpixel layouts from displays to the graphics layer, which text (or graphics) rendering engines can then make use of to improve type hinting. I do see some efforts in that area from Blur Busters[3] (the UFO Test guy), but still not much recognition from vendors.<p>Note I'm still learning about this topic, so please let me know if I'm mistaken about any points here.<p>[1] <a href="https://github.com/snowie2000/mactype" rel="nofollow">https://github.com/snowie2000/mactype</a><p>[2] <a href="https://github.com/bp2008/BetterClearTypeTuner" rel="nofollow">https://github.com/bp2008/BetterClearTypeTuner</a><p>[3] <a href="https://github.com/microsoft/PowerToys/issues/25595" rel="nofollow">https://github.com/microsoft/PowerToys/issues/25595</a>
I appreciate the pun in the repository name <a href="https://github.com/googlefonts/fontations/" rel="nofollow">https://github.com/googlefonts/fontations/</a>
> Fonts are passed through the OpenType Sanitizer prior to processing.<p>Are font formats so bad that the files need to be sanitized?<p>Also, note that the identified integer overflows as one of causes of vulnerabilities. It is sad that today many languages do not detect overflows, and even modern architectures like RISC-V do not include overflow traps although detecting an overflow doesn't require many logic gates. C is old, ok, but why new languages like Rust do not have overflow traps, I cannot understand. Don't Rust developers know about this thing?
I wonder what this means, if anything, for the future of WUFFS. TTF support is on their roadmap. If they can get acceptable performance and safety from Rust, will they still drive on with WUFFS?
If fresh code in Rust truly reduces the number or severity of CVE in a massively tested and fuzzed C library like this one it will be a major blow to the “carefully written and tested C/C++ is just as safe” perspective. Just need the resources and Rust performance to rewrite them all.
It's very annoying that Google's websites, including this blog, are automatically translated to my browser's preferred language.<p>Sillicon Valley devs clearly believe that machine translation is a magical technology that completely solved internationalization, like in Star Trek. No, it's far from it. Ever since internet has been flooded with automatically translated garbage, the experience of international users, at least bilingual ones, got much worse.
Look, a language that was conceived out of necessity to write a web browser in a safer way is being used just for that. It's a different, unrelated browser, but the language still reaches its design goals beautifully.
I get it, but switching to Rust places the codebase on an Island I can't easily get to. I am already switching between C++, Swift, Kotlin, and Python on an almost daily basis.