Re: boundingRectWithSize gives wrong size

2019-09-10 Thread Richard Charles via Cocoa-dev
> On Sep 10, 2019, at 10:54 AM, Gabriel Zachmann wrote: > >> I have had good results with CTLineGetTypographicBounds(). > > This seems to be suitable only for single lines of text. > But , usually, I've got 2 lines of text. > > I looked at Core Text a bit further, but I could not find how to

Re: boundingRectWithSize gives wrong size

2019-09-10 Thread Jens Alfke via Cocoa-dev
> On Sep 10, 2019, at 9:54 AM, Gabriel Zachmann wrote: > > The excess width is sometimes more, sometimes a bit less, I could not find a > pattern. > I guess , it has something to do with the actual glyphs in the string. How much bigger is it? By a fraction of a character width? Or is it more

Re: boundingRectWithSize gives wrong size

2019-09-10 Thread Gabriel Zachmann via Cocoa-dev
Thanks a lot to both of you for responding, and sorry for my delay! (In case you forget the context, I have enclosed my original question below.) >> NSRect string_rect = CGRectIntegral( [mesg_string boundingRectWithSize: >> drawRect_.size > What is drawRect_ set to when this is called? Here