Denis Oliver Kropp wrote:
> Phil Endecott wrote:
>>>> I am slowly working through all the places where small changes will be 
>>>> needed to work with my text rotation feature.
>> 
>> At present, the logical_rect returned by GetStringExtents can have 
>> negative width (or height?) for non-left-to-right scripts.  Is this a 
>> useful feature, or is it just how it worked out?
>> 
>> I have to decide whether a rotated (e.g. upside-down) font should 
>> return a rectangle with negative dimensions in the same way, or not.
>> 
>> The easiest thing for me to do is to always return a "valid" rectangle 
>> with positive height and width: I simply find the coordinates of the 
>> four corners of the string and use min and max to get the bounding 
>> box.  But this would change the current behaviour for right-to-left scripts.
>> 
>> Does anyone rely on the current behaviour of GetStringExtents?
>
> Yes, it's important that you can do this:
>
> 1) DrawString( 10,10 )
> 2) GetStringExtents( &rect )
> 3) region = translate( rect, 10, 10 )
> 4) Flip( &region )
>
> In this case ink_rect would be used, but logical_rect should not have a
> different orientation or offset.

But at present, with fonts for right-to-left scripts, logical_rect can 
return a rectangle with negative width.  If you used that in your 
example above then the region passed to Flip would still have a 
negative width, which I guess it would not like (right? - at least, it 
should be equally happy with an equivalent rectangle with positive 
dimensions).  So I think that that is an example of something that 
would benefit from the change that I am proposing.

(Or maybe I am missing something....  it's late!)

Phil.





_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to