It’s not wrong that "🤦🏼♂️".length == 7 (2019)
1–10 of 315 posts
Re: It’s not wrong that "🤦🏼♂️".length == 7 (2019)
#2Also please make sure to read the first heading after the title, which summarizes the whole point of this essay.
Re: It’s not wrong that "🤦🏼♂️".length == 7 (2019)
#3HN discards emojis in the title. The original emoji was https://emojipedia.org/man-facepalming-medium-light-skin-ton... which consists of 5 Unicode code points. Also please make sure to read the first heading after the title, which summarizes the whole point of this essay.
Re: It’s not wrong that "🤦🏼♂️".length == 7 (2019)
#4Apparently the thing to use is a library with a very strange name, which does glyph placement. I’ll go look for it.
EDIT: harfbuzz https://harfbuzz.github.io/why-do-i-need-a-shaping-engine.ht...
Re: It’s not wrong that "🤦🏼♂️".length == 7 (2019)
#5Did I miss the part where he explains this take? It's made up of 5 valid unicode code units. For a language where you're not supposed to need to know the byte size semantics, the correct length should be 5. What am I missing?
The close second being 17, because length in bytes. Is another fine way to represent this data, e.g. what a successful write of some sort would look like. Network or file.
I guess I'm basing this all on the idea that it's almost always a mistake to confuse how a program manages some data, vs how a drawing lib might. Your language shouldn't concern it self with how many glyphs it needs to draw... until you actually try to draw them.
Re: It’s not wrong that "🤦🏼♂️".length == 7 (2019)
#6Re: It’s not wrong that "🤦🏼♂️".length == 7 (2019)
#7Re: It’s not wrong that "🤦🏼♂️".length == 7 (2019)
#8> Python 3’s approach is unambiguously the worst one, though. Did I miss the part where he explains this take? It's made up of 5 valid unicode code units. For a language where you're not supposed to need to know the byte size semantics, the correct length should be 5. What am I missing? The close second being 17, because length in bytes. Is another fine way to represent this data, e.g. what a successful write of some…
Re: It’s not wrong that "🤦🏼♂️".length == 7 (2019)
#9Measuring the length of text is really hard. Font fallback is hard. All of these things, you take for granted till you write your own game engine. Apparently the thing to use is a library with a very strange name, which does glyph placement. I’ll go look for it. EDIT: harfbuzz https://harfbuzz.github.io/why-do-i-need-a-shaping-engine.ht...
Re: It’s not wrong that "🤦🏼♂️".length == 7 (2019)
#10Measuring the length of text is really hard. Font fallback is hard. All of these things, you take for granted till you write your own game engine. Apparently the thing to use is a library with a very strange name, which does glyph placement. I’ll go look for it. EDIT: harfbuzz https://harfbuzz.github.io/why-do-i-need-a-shaping-engine.ht...