(guy who's always messing with the line spacing function voice): so I was messing with the line spacing function again today
by which I mean, I gutted all the old code and made something new! Here are the goals I had:
Equalize the line lengths
Stop making 'scroll' samplers-- a 1:2 height:width ratio is okay, but a 1:4 is not
And here's what I came up with:
Once Samplerbot has the text it wants to samplerify, and has chosen its font and border, have it run the numbers for what the sampler size and line breakdown would be for a wide variety of potential line lengths. For each of those possibilities, Samplerbot calculates:
The standard deviation of the lengths of all the lines of text. This is the most important-- a small standard deviation in length means they're all close to the same size. Samplerbot starts by finding the fifteen line lengths that would lead to the smallest standard deviations, then runs the other calculations over those fifteen.
The ratio of total sampler height divided by width. It eliminates any options that are much wider than they are tall, and also vice versa, though it's less restrictive for height. Samplerbot then finds the absolute value of the difference between height/width and the golden ratio (and width/height and the golden ratio, whichever is smaller)-- another calculation where smaller is better.
Whether or not the given line length would create any single-word lines; if it would, it give that a value of '2', and if not, a '0'. Small is once again the goal here.
Samplerbot then finds the average of those three numbers-- standard deviation of the line lengths, difference from the golden ratio, and the single-word penalty-- and whichever line length has the lowest average is the one it goes with!
I've had it set up to make batches of ~50 test samplers at a time to see how they'll look, and I think it's a good improvement! Good enough that I considered figuring out how to have Samplerbot re-generate some of the ones already in its queue, but-- not this time!
The first samplers from this update will go live in late June.
Have a good night, all!
-Bot Dev





















