|
 |
William F Pokorny <ano### [at] anonymous org> wrote:
>
> Only tricky part is figuring out the base character size and spacing.
> I've not found an easy and reliable way to do that as yet. I got to the
> above values by trial and error.
>
> Used box characters for the rectangular frame using the strings:
> "┌─────────┐",
"└────
─────┘" and
"││││││││││
│││││",
>
> Bill P.
If you are using a mono-type font, this worked for me:
#local _t1 = text { ttf "fontname.ttf" "A" 1.0, 0 }
#local _t2 = text { ttf "fontname.ttf" "AA" 1.0, 0 }
#local _t1sz = max_extent(_t1) - min_extent(_t1);
#local _t2sz = max_extent(_t2) - min_extent(_t2);
#local _unit_width = (_t2sz - _t1sz).x;
text { ttf "fontname.ttf" "What the heck?" 1.0, -2*unit_width*x }
text { ttf "fontname.ttf" "What the heck?" 1.0, <-unit_width, -1, 0> translate
<0, 14, 0> }
-- Chris R
Post a reply to this message
Attachments:
Download 'text_test.png' (155 KB)
Preview of image 'text_test.png'

|
 |