[MacRuby] #628: CTFramesetterCreateFrame doesn't like the CFRange type
#628: CTFramesetterCreateFrame doesn't like the CFRange type ---------------------------+------------------------------------------------ Reporter: easco@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ---------------------------+------------------------------------------------ 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); -- Ticket URL: <http://www.macruby.org/trac/ticket/628> MacRuby <http://macruby.org/>
#628: CTFramesetterCreateFrame doesn't like the CFRange type ---------------------------+------------------------------------------------ Reporter: easco@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ---------------------------+------------------------------------------------ Description changed by martinlagardette@…: Old description:
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);
New description: 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: {{{ #!ruby 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); }}} -- -- Ticket URL: <http://www.macruby.org/trac/ticket/628#comment:1> MacRuby <http://macruby.org/>
#628: CTFramesetterCreateFrame doesn't like the CFRange type ---------------------------+------------------------------------------------ Reporter: easco@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: ---------------------------+------------------------------------------------ Comment(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). -- Ticket URL: <http://www.macruby.org/trac/ticket/628#comment:2> MacRuby <http://macruby.org/>
#628: CTFramesetterCreateFrame doesn't like the CFRange type ---------------------------+------------------------------------------------ Reporter: easco@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: major | Milestone: MacRuby 0.6 Component: MacRuby | Resolution: fixed Keywords: | ---------------------------+------------------------------------------------ Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.6 Comment: Should be fixed in r3962. -- Ticket URL: <http://www.macruby.org/trac/ticket/628#comment:3> MacRuby <http://macruby.org/>
On 26/04/2010, at 1:33 PM, MacRuby wrote:
#628: CTFramesetterCreateFrame doesn't like the CFRange type ---------------------------+------------------------------------------------ Reporter: easco@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: major | Milestone: MacRuby 0.6 Component: MacRuby | Resolution: fixed Keywords: | ---------------------------+------------------------------------------------ Changes (by lsansonetti@…):
* status: new => closed * resolution: => fixed * milestone: => MacRuby 0.6
Hi Laurent, What would be a feasible workaround for this problem, given than I'm using MacRuby 0.5 ? i.e. I'm also trying to call: CTFramesetterCreateFrame(framesetter, CFRangeMake(0, 0), path, nil) The second argument is a range which produces the error. Can I edit the bridge support file? Or is there some other workaround? Can I use a more recent built of MacRuby? Or are these too buggy compared to 0.5? Thanks, Paul Howson Queensland, Australia
Hi Paul, On May 5, 2010, at 7:57 PM, Paul Howson wrote:
On 26/04/2010, at 1:33 PM, MacRuby wrote:
#628: CTFramesetterCreateFrame doesn't like the CFRange type ---------------------------+------------------------------------------------ Reporter: easco@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: major | Milestone: MacRuby 0.6 Component: MacRuby | Resolution: fixed Keywords: | ---------------------------+------------------------------------------------ Changes (by lsansonetti@…):
* status: new => closed * resolution: => fixed * milestone: => MacRuby 0.6
Hi Laurent,
What would be a feasible workaround for this problem, given than I'm using MacRuby 0.5 ?
i.e. I'm also trying to call:
CTFramesetterCreateFrame(framesetter, CFRangeMake(0, 0), path, nil)
The second argument is a range which produces the error.
Can I edit the bridge support file? Or is there some other workaround? Can I use a more recent built of MacRuby? Or are these too buggy compared to 0.5?
Do you have any reason why you cannot use 0.6? It's much stabler than 0.5 :) http://www.macruby.org/blog/2010/04/30/macruby06.html Laurent
Hi, I have strange timeout problems with 0.6 and 0.7 $ time macruby_select 0.7 -e 'framework "Cocoa"' 2010-05-06 07:03:55.018 macruby[1922:607] __CFServiceControllerBeginPBSLoadForLocalizations timed out while talking to pbs real 0m1.588s user 0m0.699s sys 0m0.096s 0.6 takes even longer: $ time macruby_select 0.6 -e 'framework "Cocoa"' 2010-05-06 07:03:43.672 macruby[1913:607] __CFServiceControllerBeginPBSLoadForLocalizations timed out while talking to pbs real 0m2.170s user 0m0.698s sys 0m0.102s while 0.5 has no timeout: $ time macruby_select 0.5 -e 'framework "Cocoa“‘ real 0m0.398s user 0m0.380s sys 0m0.057s I’m still on OS X Version 10.6.2, is that the reason? In the meantime I removed the MacRuby runtimes ala Matt Aimonetti, but that did’nt help. - Bernd
Hi! I cannot really reproduce this unfortunately, but I would have a couple of questions: - That might be stupid, but did you try rebooting? - What language are you using on your system? - Did you ever try to "shrink" applications by getting rid of different languages? Thanks :-) -- Thibault Martin-Lagardette On May 5, 2010, at 22:10, B. Ohr wrote:
Hi, I have strange timeout problems with 0.6 and 0.7
$ time macruby_select 0.7 -e 'framework "Cocoa"' 2010-05-06 07:03:55.018 macruby[1922:607] __CFServiceControllerBeginPBSLoadForLocalizations timed out while talking to pbs real 0m1.588s user 0m0.699s sys 0m0.096s
0.6 takes even longer:
$ time macruby_select 0.6 -e 'framework "Cocoa"' 2010-05-06 07:03:43.672 macruby[1913:607] __CFServiceControllerBeginPBSLoadForLocalizations timed out while talking to pbs real 0m2.170s user 0m0.698s sys 0m0.102s
while 0.5 has no timeout:
$ time macruby_select 0.5 -e 'framework "Cocoa“‘ real 0m0.398s user 0m0.380s sys 0m0.057s
I’m still on OS X Version 10.6.2, is that the reason?
In the meantime I removed the MacRuby runtimes ala Matt Aimonetti, but that did’nt help.
- Bernd
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Hi, thanks, after the reboot (not stupid!) the problem disappeared! Very interesting, I didn’t expected that because 0.5 had no problems. Maybe that happened because 0.7 is still slower than 0.5: $ time macruby_select 0.7 -e 'framework "Cocoa“‘ real 0m0.626s user 0m0.665s sys 0m0.085s $ time macruby_select 0.5 -e 'framework "Cocoa“‘ real 0m0.385s user 0m0.378s sys 0m0.053s - Bernd Am 07.05.2010 um 00:25 schrieb Thibault Martin-Lagardette:
Hi!
I cannot really reproduce this unfortunately, but I would have a couple of questions: - That might be stupid, but did you try rebooting? - What language are you using on your system? - Did you ever try to "shrink" applications by getting rid of different languages?
Thanks :-)
-- Thibault Martin-Lagardette
On May 5, 2010, at 22:10, B. Ohr wrote:
Hi, I have strange timeout problems with 0.6 and 0.7
$ time macruby_select 0.7 -e 'framework "Cocoa"' 2010-05-06 07:03:55.018 macruby[1922:607] __CFServiceControllerBeginPBSLoadForLocalizations timed out while talking to pbs real 0m1.588s user 0m0.699s sys 0m0.096s
0.6 takes even longer:
$ time macruby_select 0.6 -e 'framework "Cocoa"' 2010-05-06 07:03:43.672 macruby[1913:607] __CFServiceControllerBeginPBSLoadForLocalizations timed out while talking to pbs real 0m2.170s user 0m0.698s sys 0m0.102s
while 0.5 has no timeout:
$ time macruby_select 0.5 -e 'framework "Cocoa“‘ real 0m0.398s user 0m0.380s sys 0m0.057s
I’m still on OS X Version 10.6.2, is that the reason?
In the meantime I removed the MacRuby runtimes ala Matt Aimonetti, but that did’nt help.
- Bernd
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Hi! The problem might have been some Internationalization cache somewhere, which is why I thought about rebooting. Glad it fixed the problem :-). As for loading framework Cocoa, 0.7 is not really that slower, it just depends on which one you're calling first: $> time macruby_select 0.5 -e 'framework "Cocoa"' real 0m1.832s user 0m0.400s sys 0m0.093s $> time macruby_select 0.7 -e 'framework "Cocoa"' real 0m0.540s user 0m0.597s sys 0m0.077s As you can see, because I ran 0.5 first, it is slower than 0.7 But if I re-run the same command lines just after: $> time macruby_select 0.5 -e 'framework "Cocoa"' real 0m0.447s user 0m0.359s sys 0m0.057s $> time macruby_select 0.7 -e 'framework "Cocoa"' real 0m0.498s user 0m0.606s sys 0m0.080s As you can see, the times are almost similar. 0.7 is still 50 to 200ms slower sometimes, but not 1 second :-) -- Thibault Martin-Lagardette On May 7, 2010, at 06:28, B. Ohr wrote:
Hi,
thanks, after the reboot (not stupid!) the problem disappeared!
Very interesting, I didn’t expected that because 0.5 had no problems.
Maybe that happened because 0.7 is still slower than 0.5:
$ time macruby_select 0.7 -e 'framework "Cocoa“‘ real 0m0.626s user 0m0.665s sys 0m0.085s
$ time macruby_select 0.5 -e 'framework "Cocoa“‘ real 0m0.385s user 0m0.378s sys 0m0.053s
- Bernd
Am 07.05.2010 um 00:25 schrieb Thibault Martin-Lagardette:
Hi!
I cannot really reproduce this unfortunately, but I would have a couple of questions: - That might be stupid, but did you try rebooting? - What language are you using on your system? - Did you ever try to "shrink" applications by getting rid of different languages?
Thanks :-)
-- Thibault Martin-Lagardette
On May 5, 2010, at 22:10, B. Ohr wrote:
Hi, I have strange timeout problems with 0.6 and 0.7
$ time macruby_select 0.7 -e 'framework "Cocoa"' 2010-05-06 07:03:55.018 macruby[1922:607] __CFServiceControllerBeginPBSLoadForLocalizations timed out while talking to pbs real 0m1.588s user 0m0.699s sys 0m0.096s
0.6 takes even longer:
$ time macruby_select 0.6 -e 'framework "Cocoa"' 2010-05-06 07:03:43.672 macruby[1913:607] __CFServiceControllerBeginPBSLoadForLocalizations timed out while talking to pbs real 0m2.170s user 0m0.698s sys 0m0.102s
while 0.5 has no timeout:
$ time macruby_select 0.5 -e 'framework "Cocoa“‘ real 0m0.398s user 0m0.380s sys 0m0.057s
I’m still on OS X Version 10.6.2, is that the reason?
In the meantime I removed the MacRuby runtimes ala Matt Aimonetti, but that did’nt help.
- Bernd
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
On 06/05/2010, at 1:18 PM, Laurent Sansonetti wrote:
Hi Paul,
On May 5, 2010, at 7:57 PM, Paul Howson wrote:
On 26/04/2010, at 1:33 PM, MacRuby wrote:
Hi Laurent,
What would be a feasible workaround for this problem, given than I'm using MacRuby 0.5 ?
i.e. I'm also trying to call:
CTFramesetterCreateFrame(framesetter, CFRangeMake(0, 0), path, nil)
The second argument is a range which produces the error.
Can I edit the bridge support file? Or is there some other workaround? Can I use a more recent built of MacRuby? Or are these too buggy compared to 0.5?
Do you have any reason why you cannot use 0.6? It's much stabler than 0.5 :)
http://www.macruby.org/blog/2010/04/30/macruby06.html
Laurent
No reason other than I had not yet noticed the announcement of 0.6! I will upgrade. Thanks. Paul
participants (5)
-
B. Ohr
-
Laurent Sansonetti
-
MacRuby
-
Paul Howson
-
Thibault Martin-Lagardette