change unicode for better font support and fix some cases (#4139)

Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com>
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
Salman Abuhaimed 2022-11-12 11:30:44 +03:00 committed by GitHub
parent c714f15ce9
commit 070151fbc8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 7 deletions

View file

@ -5,7 +5,7 @@
- Major: Added support for Twitch's Chat Replies. [Wiki Page](https://wiki.chatterino.com/Features/#message-replies) (#3722, #3989, #4041, #4047, #4055, #4067, #4077, #3905)
- Major: Added multi-channel searching to search dialog via keyboard shortcut. (Ctrl+Shift+F by default) (#3694, #3875)
- Major: Added support for emotes and badges from [7TV](https://7tv.app). [Wiki Page](https://wiki.chatterino.com/Third_party_services/#7tv) (#4002, #4062)
- Major: Added support for Right-to-Left Languages (#3958)
- Major: Added support for Right-to-Left Languages (#3958, #4139)
- Minor: Allow hiding moderation actions in streamer mode. (#3926)
- Minor: Added highlights for `Elevated Messages`. (#4016)
- Minor: Removed total views from the usercard, as Twitch no longer updates the number. (#3792)

View file

@ -278,12 +278,13 @@ void MessageLayoutContainer::reorderRTL(int firstTextIndex)
// the second condition below covers the possible three cases:
// 1 - if we are in RTL mode (first non-neutral word is RTL)
// we render RTL, reversing LTR sequences,
// 2 - if we are in LTR mode (first non-neautral word is LTR or all wrods are neutral)
// 2 - if we are in LTR mode (first non-neutral word is LTR or all words are neutral)
// we render LTR, reversing RTL sequences
// 3 - neutral words follow previous words, we reverse a neutral word when the previous word was reversed
// the first condition checks if a neutral word is treated as a RTL word
// this is used later to add an invisible Arabic letter to fix orentation
// this is used later to add U+202B (RTL embedding) character signal to
// fix punctuation marks and mixing embedding LTR in an RTL word
// this can happen in two cases:
// 1 - in RTL mode, the previous word should be RTL (i.e. not reversed)
// 2 - in LTR mode, the previous word should be RTL (i.e. reversed)

View file

@ -14,8 +14,7 @@
namespace {
const QChar RTL_MARK(0x200F);
const QChar RTL_EMBED(0x202B);
} // namespace
namespace chatterino {
@ -295,8 +294,7 @@ void TextLayoutElement::paint(QPainter &painter)
QString text = this->getText();
if (text.isRightToLeft() || this->reversedNeutral)
{
text.prepend(RTL_MARK);
text.append(RTL_MARK);
text.prepend(RTL_EMBED);
}
painter.setPen(this->color_);