bugGNUstep - Bugs: bug #23954, setFont not implemented in...


You are not allowed to post comments on this tracker with your current authentication level.

bug #23954: setFont not implemented in nSTextStorage

Submitted by:  Riccardo Mottola <rmottola>
Submitted on:  Mon 28 Jul 2008 09:57:53 PM UTC  
Category:  Gui/AppKit Severity:  3 - Normal
Item Group:  Change Request Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Tue 19 Aug 2008 07:01:32 AM UTC, comment #4:

Sorry, my fault. I change a sentence I wrote around, but didn't adjust the words. What I wanted to say was, NSTextView (and the abstract class NSText) both support setFont: in GNustep. For the class NSTextStorage this method is only provided as a scripting extension and currently GNUstep doesn't provide most of these extensions.

There wont be a problem to include this method if you really need it an provide an implementation. OK, this is really easy, here is one (code stolen from NSTextView), but why would we want it?

- (void) setFont: (NSFont *)font
if (!font)

[self addAttribute: NSFontAttributeName
value: font
range: NSMakeRange(0, [self length])];

As soon as you provide a good reason for it, I will add this method to a scripting category on NSTextStorage.

Fred Kiefer <FredKiefer>
Project Member
Sun 17 Aug 2008 07:57:50 PM UTC, comment #3:

I changed the code in FTP now, but the code I had was working fine under mac 10.3.

NSTextView inherits from NSText on the mac, which has setFont.

Riccardo Mottola <rmottola>
Project Member
Tue 12 Aug 2008 08:51:02 PM UTC, comment #2:

This method is one of the scripting methods of that class and currently GNustep does not plan to implement those methods.
You may go ahead to implement it yourself if you want to, though.

Why is FTP using this method at all and when did you start to do so? There should be better ways to achive the same result.

You second posting looks like you are mistaking NSTextView for NSTextStorage, the later has a setFont: method.

Fred Kiefer <FredKiefer>
Project Member
Tue 29 Jul 2008 10:56:52 PM UTC, comment #1:

this is a class not existent on OpenStep, so it is more a Feature request.
Interestingly though NSTextView is a subclass of NSText, which had setFont even in OpenStep times and has it in GNUstep. So this exception is weird.

Riccardo Mottola <rmottola>
Project Member
Mon 28 Jul 2008 09:57:53 PM UTC, original submission:

/usr/GNUstep/Local/Applications/FTP.app/FTP: Uncaught exception NSInvalidArgumentException, reason: GSTextStorage(instance) does not recognize setFont:

(using Cairo on Linux, latest SVN)

Riccardo Mottola <rmottola>
Project Member


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by FredKiefer (Posted a comment)
  • -email is unavailable- added by rmottola (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-08-12 FredKiefer Item GroupNone => Change Request

    Back to the top

    Powered by Savane 3.3