<table><tr><td style="">mglb created this revision.<br />mglb added reviewers: Konsole, VDG.<br />mglb added a project: Konsole.<br />mglb requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D15758">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Adds a code for getting character width togeter with LUTs generated<br />
using uni2characterwidth from Unicode 11 lists.</p>

<p>Skin tone, flags, gender, and other emoji with and modifer are not<br />
joined (you will see e.g. a skin tone square + generic yellow emoji).<br />
I think joining them would cause problems in most editors, command line<br />
prompts, and other programs which use character width data, as the<br />
characters would behave as combining or emoji depending on context (like<br />
ligatures).</p>

<p>Examples:</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">light thumb up: đŸ‘đŸģ</li>
<li class="remarkup-list-item">dark thumb up:  đŸ‘đŸŋ</li>
<li class="remarkup-list-item">Polish flag:    đŸ‡ĩ🇱</li>
</ul>

<p>This behavior is allowed:</p>

<ul class="remarkup-list">
<li class="remarkup-list-item"><a href="https://unicode.org/reports/tr51/#Emoji_Modifiers_Display" class="remarkup-link" target="_blank" rel="noreferrer">https://unicode.org/reports/tr51/#Emoji_Modifiers_Display</a></li>
<li class="remarkup-list-item"><a href="https://unicode.org/reports/tr51/#Emoji_ZWJ_Sequences" class="remarkup-link" target="_blank" rel="noreferrer">https://unicode.org/reports/tr51/#Emoji_ZWJ_Sequences</a></li>
</ul>

<p>It is possible to add support for sequences, but those would work<br />
only for a string width functions.</p>

<p>Some characters which can be presented as emoji are narrow (e.g. âœ–ī¸, ÂŠī¸).<br />
Those characters are listed without "presentation" mode, which means<br />
they should be rendered as text by default (real presentation depends on<br />
renderer and/or font). Noto Sans Color Emoji renders them as wide,<br />
DejaVu Sans as narrow. Vim, bash and zsh treat them as narrow, so I made<br />
them narrow.</p>

<p><a href="https://unicode.org/reports/tr51/#Presentation_Style" class="remarkup-link" target="_blank" rel="noreferrer">https://unicode.org/reports/tr51/#Presentation_Style</a></p>

<p>BUG: 396435<br />
BUG: 378124<br />
BUG: 392171<br />
BUG: 339439</p>

<p>Depents on <a href="https://phabricator.kde.org/D15757" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">D15757</a></p></div></div><br /><div><strong>TEST PLAN</strong><div><ul class="remarkup-list">
<li class="remarkup-list-item">Look at emoji_test.txt - emojis should look "normal" (two characters</li>
</ul>

<p>width).</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">Look at GLASS.txt - characters width should look correct.</li>
<li class="remarkup-list-item">CharacterWidthTest should pass.</li>
</ul></div></div><br /><div><strong>BRANCH</strong><div><div>arc/396435/Use-new-character-width-code-based-on-Unicode-11 (branched from master)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D15758">https://phabricator.kde.org/D15758</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>COPYING.Unicode<br />
src/CMakeLists.txt<br />
src/Character.h<br />
src/CharacterWidth.cpp<br />
src/CharacterWidth.h<br />
src/CharacterWidth.src.cpp<br />
src/Filter.cpp<br />
src/TerminalCharacterDecoder.cpp<br />
src/TerminalDisplay.cpp<br />
src/autotests/CharacterWidthTest.cpp<br />
src/konsole_wcwidth.cpp<br />
src/konsole_wcwidth.h<br />
tools/uni2characterwidth/overrides.txt<br />
tools/uni2characterwidth/template.example</div></div></div><br /><div><strong>To: </strong>mglb, Konsole, VDG<br /><strong>Cc: </strong>konsole-devel, herrold, ngraham, maximilianocuria, hindenburg<br /></div>