mortie / swaylock-effects

Swaylock, with fancy effects
MIT License
708 stars 45 forks source link

Newline characters not rendered correctly in strftime #15

Open eddsalkield opened 4 years ago

eddsalkield commented 4 years ago

The strftime specification states:

       %n     A newline character. (SU)

On my machine, this is rendered by swaylock-effects as a blank box character instead.

mortie commented 4 years ago

Currently, swaylock-effects (and swaylock) just uses cairo to draw. Cairo's text drawing interface is very simple, and among other things, doesn't support multi-line text. Adding proper support to fancy text layout would require adding the libraries Pango and PangoCairo, and it would require rewriting the text-related parts of the rendering code which would make merging future upstream changes to that code harder.

I don't think that extra complexity is worth it, but I can be convinced otherwise if you have an example of a really compelling use case.

Regardless, I should probably document this limitation, and maybe print a warning when someone supplies a timestr/datestr with a newline in it.