theblazingangel
22nd May 2007 02:56 UTC
lining up text box text
i've got a text box on a custom page. i'm writing some results into it. i write each result on a new line, each line consists of the name of the check, two tabs, three dots, a tab, and the result.
problem: depending on the length of the text in each name the preceding tabs may not line up the text that follows with other lines.
i tried counting the length of the names and varying the number of tabs that followed (1 or 2), however it's not just the length of the text that affects it but the width of the characters in the font itself. for example a capital 'W' is a lot wider than a lot of other characters!
is there anything i can do to get the text to line up correctly? :(
Afrow UK
22nd May 2007 18:57 UTC
You need to use a fixed character width font such as Courier New.
What I would do is find the maximum possible length of the first string, second string etc, then you can work out how many spaces you need (tabs are bad) to space everything out perfectly. However, this would require a lot of code in NSIS (you'd probably have to use the NSISArray plugin).
Maybe it'd be easier to use the EmbeddedLists plugin.
Stu
theblazingangel
22nd May 2007 21:06 UTC
i'll just forget it, at least for now anyway. i may look at the courier new font and embeddedlists plugin solutions at a later date, but it's not a big problem at the minute and i'm under a lot of pressure to get the software done.
thanks