Hi All,

4D v15.2 Mac/Win

I’m sure I’ve seen this recently but can’t find it (something about double 
processing width/height). I recall reading but not quite understanding it. What 
was it’s topic name? Anyway...

I am working on a project where I need to place short text strings exactly at a 
various points within a circle. Easy enough using a little trig.

Even though my centering text on a point works, for the most part, I’m not sure 
it’s exactly precise. I notice when changing the font and font size that it’s 
off by a pixel or a few. And I can see it and it doesn’t look right to me eyes.

So before I check my question:

Does anyone have routine that will reliably center an SVG text string on a 
point? Here’s what I am using.

$Dom_Ref:=SVG_New 
$tDom_Text:=SVG_New_text 
($Dom_Ref;$text_t;$ptr_W->;$ptr_H->;$fontName;$fontSize;$fontStyle;$fontAlign)
$pic:=SVG_Export_to_picture ($tDom_Text)
SVG_CLEAR ($Dom_Ref)

PICTURE PROPERTIES($pic;$ptr_W->;$ptr_H->)

Is this the best approach? Or is there a more precise algorithm like double 
processing width/height?

Thanks,
John...
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to