Skip to main content
Topic: Text alignment with title formatting (Read 491 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Text alignment with title formatting

I have a panel wish does not allow me to align the text to the left. It is always centered. Is it possible to somehow solve this with title formatting? I mean with code. Something like "$alignleft(%title%)". Or maybe with some other method?


Re: Text alignment with title formatting

Reply #2
$tab() only seem to push the string a bit. But it doesn't make strings of different length to start at the same left place, and that is what I'm after.

I've actually tried $pad() before, but same problem with this one. It doesn't make strings of different length to start at the same left place.

Re: Text alignment with title formatting

Reply #3
Assuming you can or want to..... using a monospaced font while padding each line to the same length should do the trick.

I'm still on XP and I don't know if newer Windows have any decent monospaced fonts, but I use this one with the Text Display component. If it doesn't turn you on, there's plenty more out there.
https://www.fontsquirrel.com/fonts/Bitstream-Vera-Sans-Mono
https://en.wikipedia.org/wiki/Bitstream_Vera

Re: Text alignment with title formatting

Reply #4
What panel are we talking about? Different UI elements tend to react differently to $tab(). Also as far as I remember, $pad() needs to have a font that has uniform distances between characters for it to work (as it basically just inputs spaces).

Re: Text alignment with title formatting

Reply #5
Yeah I have thought about fonts with the same character width. But I really want to use the same font as everything else in my player: Segoe UI.

The panel in question is ESLyric. But if anyone know of another panel with these criteria it would be really awesome:
 - Display left aligned text
 - Background color / image
 - Edge style None

I have tried Text Display, but that has sunken edge style. And I have tried Lyric Show 3, but the whole player lags a bit when playing a new track. Gets worse the more instances of LS3 I have. I have even removed all lyric sources.

Re: Text alignment with title formatting

Reply #6
Lyrics Show 3 and JScript/Monkey panel comes to my mind (the latter a bit more involved). I haven't noticed any issues with LS3 personally so I'm not sure what causes yours.

Re: Text alignment with title formatting

Reply #7
Lyrics Show 3 and JScript/Monkey panel comes to my mind (the latter a bit more involved). I haven't noticed any issues with LS3 personally so I'm not sure what causes yours.

Hmm, I tried out Spider Monkey Panel, but I can't write any JavaScript... However I'm willing to learn, or at least try. But is this just plain JavaScript? Because document.write("Hello World"); doesn't work.

Re: Text alignment with title formatting

Reply #8
EDIT: Maybe there is a tutorial for coding more basic stuff with Spider Monkey Panel? I haven't found one myself.

Re: Text alignment with title formatting

Reply #9
These are probably your best bets regarding Spider Monkey Panel:
https://github.com/marc2k3/smp_2003 (text reader.js is probably the closest to what you want)
https://github.com/TheQwertiest/foo_spider_monkey_panel/tree/master/component/samples

You could also try your luck asking in the SMP topic on this forum and/or those who write scripts for it (many are here also) if you are looking for something very specific.

 

Re: Text alignment with title formatting

Reply #10
Oh thanks, I'll try that out. Thanks for the tips and help as always. =)

 
SimplePortal 1.0.0 RC1 © 2008-2019