Implement initial support for RTL languages
Pull request checklist:
- [x]
CHANGELOG.mdwas updated, if applicable
Description

This is a dirty fix #720 for RTL languages. I don't have much experience with C++, the code is not well-structured and not optimized, but it is a try.
- [ ] Selection do not work yet.
- [ ] Neutral words (words that contain number, non-alphabetical characters like
& $ #etc...) won't be ordered correctly in RTL mode, this is due toQString::isRightToLeft()returningfalseboth on LTR and neutral words. this can also make the mode LTR when the text starts with a neutral word, when it should be RTL because the first non-neutral word is RTL.
this differs from #1970 by:
- [x] punctuation marks are displayed properly.
- [x] mixing RTL and LTR works (the correct way, not Twitch's way)
- [x] line breaks also work.
should be a slightly better temporary fix, please tell me if there are more issues other than the ones I mentioned. I will try to fix the remaining issues and refactor the code after that, any help/tips on how to structure the code are very appreciated!
The last commit should show proper mixing between RTL and LTR, Twitch is doing it the wrong way actually.
If the text starts with an RTL word (e.g. Arabic), with LTR in the middle, it will only swap the RTL sequences, which is wrong, and a frustrating issue on Twitch... Should be working here. And it makes emotes show in the correct way as well.
Example:

The artifacts to test these changes can be found here, incase any issues can be found by native RTL speakers.

thank you so much! Everything seems to work correctly so far.
~~From a functionality standpoint, it appears these changes push the "space" when using large emotes to the bottom, instead of the top of the message.~~ resolved
before:

after:

@Felanbird yes that was due to a weird thing I did, fixed after this refactor.
I refactored the fix a bit.
What is done is basically this:
we call _addElement normally, if we detect an RTL word in the container, we reorder the elements.
we call addElement on each element again, without adding the element to this->elements_, if the text starts with an RTL word, we render from right to left (so currentX_ will decrease instead of increase), otherwise render normally since we are calling _addElement in the correct order. since we need the previous element for Compact-Emotes, I pass the index for the previous element, I pass -2 by default, so that in the first call we just do it the old way, the second call it will start from -1.
I think this is better than making two _addElement functions, one for RTL and one for LTR with 90% similar code.
let me know if I can do it in a better way.
~~Top portion is this PR - bottom is normal chatterino incorrect rendering~~ resolved
Everything should be working now except selection, copying the entire message works for now as an alternative to selection.
I will see what I can do about selection soon.
Please test this as much as possible, preferably with other RTL languages other than Arabic.
To download the app with this changes. go to Checks, at the top, then build, then at the bottom you will find binaries for all operating systems:

ready for final review & merge.
Looks like this for me (left = your PR, right = master)

Testing with this text: a یک دو سه b
When switching to Segoe UI it looks correct to me

I attribute the previous errors I ran into to bad fonts on Linux
@mohad12211 Thanks for your contribution! As a first-time contributor, you can now add yourself to the contributors list that's shown inside the application.
To do so, open a new PR where you modify the resources/contributors.txt file and add yourself to the list. Make sure to read the comments at a top for instructions.