gdiplus: GdipDrawString

Stephan Rose kermos at somrek.net
Mon Jun 1 12:03:15 CDT 2009


>I don't know why gdiplus does its own linebreaks. I haven't really
>done any work in that area.
>
>If I had to guess, I'd say it's because StringFormatFlagsNoWrap has no
>equivalent flag for DrawText. That probably means you can't pass it
>off to DrawText.
>
>Since they'll probably have to be done differently, it's best to
>implement one direction at a time. When you're happy with horizontal
>alignment, you can send a patch for that regardless of the status of
>vertical alignment.
>
>You should be able to use GdipMeasureString to get the size of the
>text. In fact, the alignments will need to be implemented there too,
>and it may be better to start there.

Hmm the only way I can see alignments having any influence on MeasureString would be if the boundingBox of the text is to be aligned to the layoutRect based on the alignment flags. Should just be able to then take the calculated bounding rect and align that to the layout based on the flags.

And you're right, if I use MeasureString I solve my issue where I don't know the height of the text ahead of time. Perfect.

Thanks,

Stephan



More information about the wine-devel mailing list