Is there any relationship between font size, and how much height, and width
(in units)?
So far, I don't see any relationship at all. And it makes parametrically
very hard to center it on an object.
I have an object that the text is translated() to be centered. But when I
change the parameters of length and/or width, I can't seem to find way to
recenter it by some modifier.
If there isn't is there a way to get back the size (in units) of the
rectangle it fits in? I could then use that to translate using recalculated
values.
Jerry
--
Extra Ham Operator: K7AZJ
Registered Linux User: 275424
Raspberry Pi and Arduino developer
The most exciting phrase to hear in science - the one that heralds new
discoveries - is not "Eureka!" but "That's funny...".- Isaac. Asimov
I
*f you give someone a program, you will frustrate them for a day; if you
teach them how to program, you will frustrate them for a lifetime. *-
Anonymous
If writing good code requires very little comments, then writing really
excellent code requires no comments at all!- Ken Thompson
On 11/15/2015 03:09 PM, Jerry Davis wrote:
Is there any relationship between font size, and how much height,
and width (in units)?
Yes, that is defined in the actual font file and can vary quite
a lot for different fonts.
A very detailed description can be found in the documentation of
the freetype2 library that is used for text handling.
http://www.freetype.org/freetype2/docs/tutorial/step2.html
I have an object that the text is translated() to be centered. But
when I change the parameters of length and/or width, I can't seem
to find way to recenter it by some modifier.
Where did you search? Have a look at the alignment chapter:
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Text#Alignment
If there isn't is there a way to get back the size (in units) of
the rectangle it fits in? I could then use that to translate using
recalculated values.
Getting the actual coordinates of the generated geometry is currently
not possible. In some cases, it might be possible to use resize()
to fit the text into a specific area.
ciao,
Torsten.