Coder Social home page Coder Social logo

Comments (3)

lhecker avatar lhecker commented on June 8, 2024 2

I think Terminal is correct here.

It used to be correct! But nowadays, terminals are supposed to mostly handle grapheme clusters as per UAX#29 correctly (the Unicode Text Segmentation standard). The width of a glyph is the maximum width of each character in a grapheme cluster as per UAX#11 (the East Asian Width standard).

The two glyphs are syllable type L (leading consonant) and V (vowel), as per:

UAX#29 specifies that L×V do not break apart, which means that Windows Terminal has at least 1 bug: It should treat 르 as a single unit for cursor navigation, etc.

I'm not entirely sure whether ᄅ​ᅳ should be drawn as 르, because I'm not a native Korean speaker. But given the above it should definitely only get allocated 1 cell, which would mean that it should be drawn as 르, because it won't fit otherwise. I believe the only reason it currently gets drawn as ᄅ​ᅳ is because we rely on DirectWrite whose builtin support for modern Unicode is still incomplete. For instance, you can try pasting 르 into Word and it'll be broken just like it is in Windows Terminal. Both are built on top of DirectWrite. 😕

from terminal.

lhecker avatar lhecker commented on June 8, 2024 1

Found the answer: https://devblogs.microsoft.com/oldnewthing/20201009-00/?p=104351
tl;dr: Windows (DirectWrite) does it ""right"" but they're literally the only one to do so, which is why Windows is effectively wrong. There's no alternative to DirectWrite though... Hmm, I hope I can figure something out because normalizing the input text to NFC first would be super awkward and make performance optimizations difficult.

from terminal.

leejy12 avatar leejy12 commented on June 8, 2024

I think Terminal is correct here. The text file you provided contains two letters (U+1105) and (U+1173).
The browser seems to be combining those two together to render them as (U+B974), which I don't think should be happening.

from terminal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.