• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
controlling width of space character
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

controlling width of space character


  • Subject: controlling width of space character
  • From: Jae Ho Lee <email@hidden>
  • Date: Mon, 10 Jul 2006 01:14:59 +0900

Hi everyone,

I am using Cocoa Text System in my application and I need to
control the width of space character.

I read NSTypetter's document which tells me below and I am figuring I could map space character
to NSControlGlyph to control width of space character.


"NSTypesetter's document says boundingBoxForControlGlyphAtIndex: method returns the bounding
rectangle for the control glyph and the typesetter calls this method when it encounterr an NSControlGlyph.
And NSGlyphGenerator can choose whether or not to map control characters to NSControlGlyph."


What I don't understand is how to use NSGlyphGenerator to map space character to NSControlGlyph.
I tried to subclass NSGlyphGenerator and override generateGlyphsForGlyphStorage: method and then called
NSLayoutManager's setGlyphGenerator: method.


- (void)generateGlyphsForGlyphStorage:(id <NSGlyphStorage>) glyphStorage desiredNumberOfCharacters:(unsigned int)nChars glyphIndex:(unsigned int *)glyphIndex characterIndex:(unsigned int *) charIndex {
NSLog(@"generateg glyphs:%d atGlyphIndex:%d atCharacterIndex:%d", nChars, *glyphIndex, *charIndex);
[super generateGlyphsForGlyphStorage:glyphStorage desiredNumberOfCharacters:nChars glyphIndex:glyphIndex characterIndex:charIndex];
}


All I did is to pass the method call to super, but I am getting error message.

What am I doing wrong here?

Thanks in advance,

Jaeho



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: A problem of NSImageView
  • Next by Date: Re: A problem of NSImageView
  • Previous by thread: KVC validation and overriding "Discard Changes" button
  • Next by thread: Outline view with variable-height rows & text wrapping...
  • Index(es):
    • Date
    • Thread