zlacker

Bad Apple Font

submitted by notmys+(OP) on 2023-08-30 02:46:32 | 177 points 62 comments
[view article] [source] [go to bottom]

NOTE: showing posts with links only show all posts
8. thalia+wb[view] [source] 2023-08-30 04:44:28
>>notmys+(OP)
The post also links to some examples of using Wasm to solve complex typographical problems, which I found interesting.

https://github.com/harfbuzz/harfbuzz-wasm-examples

◧◩
10. userbi+hd[view] [source] [discussion] 2023-08-30 05:02:51
>>robotn+64
It's a convenient double-reference, given Apple's history of well-known font-rendering exploits: >>16177535
◧◩◪
15. jansan+An[view] [source] [discussion] 2023-08-30 06:49:23
>>zerocr+yl
Should be no problem. GSUB lookup type 4.1* uses a uint16 to store the number of ligatures, so 65000 ligatures should be feasible. To store the actual glyphs, 32bit offsets are used, so you theoretically have a 2GByte of memory available, which should be plenty (although I have never seen a font larger than 15MB).

Using Wasm for this animation really is an overkill IMHO.

*) https://learn.microsoft.com/en-us/typography/opentype/spec/g...

Edit: IIRC Ligatures are applied recursively, so you can have a ligature based on other ligatures. If I am right here, each ligature can consist only of two glyphs (the glyph of the previous animation frame followed by a dot). This would keep the GSUB table small.

◧◩
19. winter+4s[view] [source] [discussion] 2023-08-30 07:32:39
>>triclo+X1
Font files already have embedded code for hinting. So while this might increase the attack surface somewhat, it was already there and I honestly trust wasm execution more than the severely underdocumented and poorly understood hinting VM.

https://www.truetype-typography.com/tthints.htm

◧◩
20. urband+qs[view] [source] [discussion] 2023-08-30 07:35:38
>>skrebb+vq
They posted a YouTube video near the end of the blog post showing the result. See:

https://m.youtube.com/watch?v=GF2sn2DXjlA

◧◩
21. p4bl0+Ut[view] [source] [discussion] 2023-08-30 07:53:09
>>gpvos+Eo
I came here to ask the same thing, then saw interroboink's guess in another comment and it seems plausible: >>37317687
◧◩
35. sshine+HM[view] [source] [discussion] 2023-08-30 10:51:30
>>Leande+YG
Does your browser have a "Reader" mode?

There are font systems that target code and aren't monospace.

An example is Input: https://input.djr.com/ - https://input.djr.com/preview/

The niche seems to be people who like to code without monospace, or who present code without monospace, e.g. in slides or in blog posts. Or if you want typographical consistency between non-code and code, as I understand you are suggesting.

◧◩
39. the847+ZV[view] [source] [discussion] 2023-08-30 11:53:46
>>triclo+X1
> That entire stack feels a lot like an attack surface to me, especially given stuff like the fact that windows used to render fonts in the kernel layer.

Indeed. https://googleprojectzero.github.io/0days-in-the-wild/0day-R...

44. Eiim+591[view] [source] 2023-08-30 13:04:17
>>notmys+(OP)
Hey, I'm the person who made SmilApple (typo'd here as SmllApple)! Super great to see my quick and dirty project used like this, I just wish I'd thought of it first

https://github.com/Eiim/SmilApple

◧◩◪
48. erk__+5f1[view] [source] [discussion] 2023-08-30 13:28:11
>>vultou+9Y
Yes this is exactly ligature, I just became aware that it was possible to use wasm for them in HarfBuzz, if you want to see some wasm examples that is not possible with ligatures have a look at https://github.com/harfbuzz/harfbuzz-wasm-examples
◧◩
49. dmytro+fg1[view] [source] [discussion] 2023-08-30 13:33:14
>>yankpu+S11
In theory, a font is purely set of vector graphics. In practice, just rasterizing vector graphics usually doesn't lead to good results on small font sizes combined with small pixel density, so vector graphics needs to be adjusted to better fit into pixel grid. There are multiple ways to do it, one of the ways is to write a script to adjust graphics so it better fits the pixel grid. For example TypeType fonts contain a virtual machine that is capable of just that [1]. By conceptual extension, then a font format might just as well contain a full blown virtual machine with potentially a program per glyph, WASM is a reasonable candidate for something like that.

- [1] https://learn.microsoft.com/en-us/typography/truetype/hintin...

◧◩
51. Nzen+Mp1[view] [source] [discussion] 2023-08-30 14:16:47
>>interr+ca
Fontemon [0] makes this a bit more obvious by including a web page with the font embedded, so we can control the animation by typing, rather than watching someone else type. However, mmulet embeds some sort of Blender project [1], rather than a wasm binary to accomplish the font shaping.

[0] https://www.coderelay.io/fontemon.html

[1] https://github.com/mmulet/code-relay/blob/main/markdown/Tuto...

◧◩◪
57. Tade0+Dg2[view] [source] [discussion] 2023-08-30 17:34:24
>>sphars+vi
Part of the reason why it became such a cultural phenomenon is the permissive license governing the use of the characters:

https://touhou.fandom.com/wiki/Touhou_Wiki:Copyrights

◧◩
58. krolta+4r2[view] [source] [discussion] 2023-08-30 18:12:39
>>Leande+YG
I like "the Half-Life HUD font", which is some variant of something specified by the German DIN technical standards, from what I understand.

I have used the font "Alte DIN 1451 Mittelschrift" before, and it fits your requirements pretty well.

https://www.1001fonts.com/alte-din-1451-mittelschrift-font.h...

◧◩◪◨
62. dmytro+WJ4[view] [source] [discussion] 2023-08-31 11:00:11
>>yankpu+nq3
A font is processed by software, one part of the font rendering stack is converting a string into glyphs and their positions, other part is rasterizing glyphs into bitmap. In this case one library from the stack, HarfBuzz [1], got the support for, I assume, an extension to OpenType format, that allows to embed an extra section into the file [2]. So HarfBuzz can open these special OpenType files and make run wasm embedded into them. Which means software based on it, like Chrome browser or Android, will also be open these font files, but Windows likely not.

- [1] https://en.wikipedia.org/wiki/HarfBuzz - [2] https://www.phoronix.com/news/HarfBuzz-8.0

[go to top]