I'm trying to show Jalali (卮賲爻蹖) date on my Polybar, and being able to show Persian text is the precursor to that, so I first used the text module. But it's not being rendered properly.
I asked the question on superuser and someone suggested that it's not possible.
Is it true? If so, please implement a feature where we can use bidirectional text in modules. If not, how can I fix the issue I mentioned in my question on superuser?
I wrote that answer, so yes it is true.
I do not have the capacity to implement support for Unicode control characters. I will mark this as a feature request.
PRs for this feature are welcome.
We do text rendering with cairo, but its text API is also limited to left-to-right text, so we probably need use something like pango for text rendering which means overhauling large parts of the renderer.
Hey @patrick96 ,
I'm interested in this feature, just take a look at Cairo, and Pango ( compiling and playing with some example) also take a look at renderer to file it looks like u have your wrapper around Cairo ( am I right? )
could you help me to have a better vision of how big is this task then maybe I can take this one? :D
@Aghabeiki Honestly, I don't really know how big this task is. The renderer is pretty tightly coupled to cairo, so if we have to remove cairo, this will probably mean a rewrite of the renderer. But, I think there is a way to use pango with cairo, though I have never used it.
We do all of our rendering directly with cairo, we don't use any third party wrapper. The text rendering itself is all done in the context.hpp file in the << operator for textblock (the function signature is: context& operator<<(const textblock& t)).
Maybe it is as simple as rewriting that function and use pango there. But there is probably more to it, for example this operator only renders text between formatting tags, so if you have some unicode control character (for example RTL override) at the beginning of your text but some formatting tags in the middle of the text, that control character will no longer apply to everything after the tag unless we handle this somehow.
Most helpful comment
I wrote that answer, so yes it is true.
I do not have the capacity to implement support for Unicode control characters. I will mark this as a feature request.
PRs for this feature are welcome.
We do text rendering with cairo, but its text API is also limited to left-to-right text, so we probably need use something like pango for text rendering which means overhauling large parts of the renderer.