typeplate/typeplate.github.com — pull request #70 by eldruz (2013-03-03 11:59:07+00:00)
Title: User-defined scales

Hi there,

First of all thanks guys for typeplate, I used it to setup my blog and it has been a breeze to use. The only thing that made me tickle is the absence of support for user-defined scales, as typeplate hard-coded its own scale from the base value of 18 pixels, which made experimenting with different scales tedious.

So I changed how the $zeta through $tera values are defined. They now take their values from a list, which is called $values_list. To change the scale, you just have to change the list. I provided a function which returns a list computed from the diatonic scale as an example. I also built a helper function which applies a scale, which is defined as a list of multipliers, to a base value and constructs the $values_list. I replicated the scale you provided as the default value. So now, users can define several scales and easily switch between them to see the effect the scales have on their design.

Everything I just said is commented in the code, along with some examples. I prefixed every function name with "eldruz" for clarity. Let me now if you found this useful, or if you have any questions at all.

Andrés, aka eldruz.

P.S.: you can safely ignore the first commit (hashed '4ebeb4d'), I should have deleted it really.