fix handling of text scaling

Fixes #179.  This patch is very much along the lines outlined in
comments on the ticket.  There will be accompanying patches to backends.
Merge pull request #182 from diagrams/text-scale

fix handling of text scaling