RE: Determining physical length of text string (not char count)

2004-08-12 Thread Mark W. Breneman
://www.vividmedia.com/ 608.270.9770 _ From: Burns, John D [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 11, 2004 3:10 PM To: CF-Talk Subject: RE: Determining physical length of text string (not char count) I haven't been paying much attention today, so I'm not 100% sure what's been said

Re: Determining physical length of text string (not char count)

2004-08-11 Thread Barney Boisvert
If you're not scared of Java, one approach would be to use the java.awt.FontMetrics class (probably via a temp image's Graphics instance), specifically the getStringBounds method.That'll give you all kinds of goodies about the font and strings written using that font. If you don't want that

RE: Determining physical length of text string (not char count)

2004-08-11 Thread Mark W. Breneman
So if I understand you correctly you need to know how long some text is, not the number of letters that makes it up. Just off the top of my head, if you know the font and point size you will be using in the PDF, you could build a look up table for each letter and return the pix with then add

RE: SUSPECT: Re: Determining physical length of text string (not char count)

2004-08-11 Thread Dirk Sieber
variations (bold/italic).I'm hoping to avoid that. :) Thanks! Dirk -Original Message- From: Barney Boisvert [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 11, 2004 9:25 AM To: CF-Talk Subject: SUSPECT: Re: Determining physical length of text string (not char count) If you're

RE: SUSPECT: RE: Determining physical length of text string (not char count)

2004-08-11 Thread Dirk Sieber
it. Dirk -Original Message- From: Mark W. Breneman [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 11, 2004 9:34 AM To: CF-Talk Subject: SUSPECT: RE: Determining physical length of text string (not char count) So if I understand you correctly you need to know how long some

Re: Determining physical length of text string (not char count)

2004-08-11 Thread Adam Haskell
I came up with this (you could easily turn it into a function): font_obj = createobject(java,java.awt.Font).init('Tahoma',1,8); font_metrics_obj = createobject(java,java.awt.Toolkit).getDefaultToolkit().getFontMetrics(font_obj); Pixel_Width = font_metrics_obj.stringWidth('My co-worker is mean');

Re: Determining physical length of text string (not char count)

2004-08-11 Thread Barney Boisvert
Two reasons.First FontMetrics has a protected constructor, so only it's subclasses can call it.Second, it's an abstract class, so even if it had a public constructor, you still couldn't instantiate it. That method of getting a FontMetrics object is a heck of a lot better than my temp image idea,

Re: Determining physical length of text string (not char count)

2004-08-11 Thread Adam Haskell
oh I see what your talkin' about I completely missed that in the doc I was looking at for the class :) Thanks for clearing that up for me. Adam H On Wed, 11 Aug 2004 12:46:55 -0700, Barney Boisvert [EMAIL PROTECTED] wrote: Two reasons.First FontMetrics has a protected constructor, so only

RE: Determining physical length of text string (not char count)

2004-08-11 Thread Burns, John D
width attribute so maybe that would help some.It'd be a little extra work to get that variable into CF, but it seems doable. John -Original Message- From: Adam Haskell [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 11, 2004 3:22 PM To: CF-Talk Subject: Re: Determining physical length

RE: SUSPECT: Re: Determining physical length of text string (not char count)

2004-08-11 Thread Dirk Sieber
: SUSPECT: Re: Determining physical length of text string (not char count) I came up with this (you could easily turn it into a function): font_obj = createobject(java,java.awt.Font).init('Tahoma',1,8); font_metrics_obj = createobject(java,java.awt.Toolkit).getDefaultToolkit

RE: SUSPECT: Re: Determining physical length of text string (not char count)

2004-08-11 Thread Dirk Sieber
: SUSPECT: Re: Determining physical length of text string (not char count) I came up with this (you could easily turn it into a function): font_obj = createobject(java,java.awt.Font).init('Tahoma',1,8); font_metrics_obj = createobject(java,java.awt.Toolkit).getDefaultToolkit().getFontMetri cs(font_obj