Projects

Ticket #628 (closed defect: fixed)

Opened 2 years ago

Last modified 22 months ago

CTFramesetterCreateFrame doesn't like the CFRange type

Reported by: easco@… Owned by: lsansonetti@…
Priority: major Milestone: MacRuby 0.6
Component: MacRuby Keywords:
Cc:

Description (last modified by martinlagardette@…) (diff)

An attempt to call CTFramesetterCreateFrame and passing a CFRange structure generates an error message:

unrecognized runtime type `{?=qq}'

Here's the script I was using:

font = NSFont.fontWithName("TrebuchetMS", :size=> 24.0)
attributes = NSDictionary.dictionaryWithObjectsAndKeys(font, NSFontAttributeName, nil)
attributedString = CFAttributedStringCreate(nil, "$", attributes)
framesetter = CTFramesetterCreateWithAttributedString(attributedString)

framePath = CGPathCreateMutable()
CGPathAddRect(framePath, nil, CGRectMake(4, 4, 32, 32));
textFrame = CTFramesetterCreateFrame(framesetter, CFRangeMake(0.0, 1.0), framePath, nil);

Change History

Changed 2 years ago by martinlagardette@…

  • description modified (diff)

Changed 22 months ago by lsansonetti@…

The problem is because of the CoreText.framework BridgeSupport file:

<function name='CTFramesetterCreateFrame'>
<arg type='^{__CTFramesetter=}'/>
<arg type64='{?=qq}' type='{?=ii}'/>
<arg type='^{CGPath=}'/>
<arg type='^{__CFDictionary=}'/>
<retval already_retained='true' type='^{__CTFrame=}'/>
</function>

The second argument type is unnamed. Technically this problem might disappear with the new BridgeSupport generator that we are working on, but in any case, I believe MacRuby should be able to handle these special unnamed structure types and convert boxed objects whose signatures match (like an NSRange).

Changed 22 months ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to MacRuby 0.6

Should be fixed in r3962.

Note: See TracTickets for help on using tickets.