Hi Bob,

I also like this proposed approach (attach meaning to the text 
operator), but have a further question:

What about gathering text metrics? We'll need something to accommodate 
the following types of usage:

long int measureStringWidth ( const string & inString, const string & 
inEncoding)
{
        Magick::TypeMetric local ;
        mOffscreen.fontTypeMetrics ( inString, inEncoding, &local ) ;
        return (long int) local.textWidth () ;
}

I'd also like to thank Bob for all of the help he's been over these 
last few days.

Cheers,
Dom

On Sunday, August 18, 2002, at 05:05 PM, Bob Friesenhahn wrote:

> Andrew,
>
> Leonard Rosenthol forwarded your message to me regarding Magick++'s
> inability to specify that text is formatted as UTF-8.
>
> I'd like to get this fixed right the first time since I try to avoid
> changes to Magick++'s API.  It has got to be right the first time
> around.
>
> There are two options that I see for passing the text encoding option:
>
>  o Add a constructor to DrawableText that also specifies the encoding:
>
>      DrawableText ( const double x_, const double y_,
>                     const std::string &text_,
>                     const std::string &encoding_);
>
>   or
>
>  o Create a new drawable object for specifying the text encoding:
>
>      DrawableTextEncoding ( const std::string &encoding_ );
>
>    which is used like
>
>      list.push_back(DrawableTextEncoding("UTF-8"));
>      list.push_back(DrawableText(200,300,"stuff"));
>
> I currently have both schemes implemented, but expect to delete one of
> them.  I favor attaching the encoding to the text since it is possible
> that an application uses several encodings and this fully specifies
> the meaning of the text.  In addition, adding the encoding to the text
> allows DrawableText to be used without a list.
>
> Comments?
>
> Bob
> ======================================
> Bob Friesenhahn
> [EMAIL PROTECTED]
> http://www.simplesystems.org/users/bfriesen
>

Reply via email to