Each glyph should have the location, not shown, draws outside line fragment, and bidi level in order for NSLayoutManager to properly render. Usually the default values for attributes other than the location is fine.

Please file a bug for documentation enhancement.

Thanks,

Aki

On 2008/08/13, at 14:04, chaitanya pandit wrote:

Thanks Aki, that what exactly what i was looking for.
Is there any documentation that describes other essential attributes that i need to set?
Thanks again,
Chaitanya

On 13-Aug-08, at 12:38 AM, Aki Inoue wrote:

You need to specify all essential glyph attributes for NSLayoutManager.

In this case, you're not specifying the "not shown" attribute for the attachment. Attachment glyph should not be shown.

Aki

On 2008/08/12, at 19:54, chaitanya pandit wrote:

Hello,
Well i've been struggling with this for quite a while and would appreciate if anyone could point me in the right direction. I am trying to implement a custom NSTypesetter, to start with i just want to lay 2 characters, an "A" and an inline image, thats it. The character "A" gets drawn properly, but there is some problem with the inLine image. I see a small square besides the inLine image.

Here is what i am doing in my custom NSTypesetter class, which i have hard coded to draw just the two glyphs:

- (NSUInteger)layoutParagraphAtPoint:(NSPointPointer) lineFragmentOrigin
{
        // Begin para
        [self beginParagraph];

        // Begin Line
        [self beginLineWithGlyphAtIndex:0];
        
        // Start at 0,0 (the size of the inLine image is (53, 57))
        NSRect r = NSMakeRect(0, 0, 100, 57);
        NSPoint loc = NSMakePoint(0, 0);

        // Set the line fragment rectangle for the entire glyph range
[super setLineFragmentRect:r forGlyphRange:NSMakeRange(0, 2) usedRect:r baselineOffset:57];
        // Set the location for "A"
[super setLocation:loc withAdvancements:0 forStartOfGlyphRange:NSMakeRange(0, 1)];
        // Set the attachment size for the inLine image
[super setAttachmentSize:NSMakeSize(53, 57) forGlyphRange:NSMakeRange(1, 1)];
        // Position the image a bit further on the right of "A"
        loc = NSMakePoint(21, 0);
[super setLocation:loc withAdvancements:0 forStartOfGlyphRange:NSMakeRange(1, 1)];
        
        // End line
        [self endLineWithGlyphRange:NSMakeRange(0, 2)];
        
        // End para
        [self endParagraph];
        
        return 2;
}

Thanks,
Chaitanya
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/aki%40apple.com

This email sent to [EMAIL PROTECTED]



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to