controlling width of space character
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