• 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
Text system's white "descender gap" below images
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Text system's white "descender gap" below images


  • Subject: Text system's white "descender gap" below images
  • From: Leon McNeill <email@hidden>
  • Date: Mon, 10 Feb 2003 15:09:45 +0000

Images within an NSTextView's text storage exhibit a certain behavior that I'd like to override if possible. You can easily see this behavior yourself in TextEdit, or look at this picture to see what I mean: <http://host188.softchaos.com/gaps.gif>

An image on a line by itself ends up with a few extra pixels of whitespace below it, presumably to align the image with the optical bottom of other text that may later be added to the line. In other words, the white space gap seems to correspond to the amount of vertical space the current font's descenders use.

Two images on a line by themselves do not end up with this whitespace below it. In other words, any images on the line below will abut with this line seamlessly (what I want).

However, if any text is on a line with images, this horizontal gap will also appear. This is fine for me, except when the text on the line of images consists entirely of spaces.

I've fiddled around with my NSLayoutManager to some degree but can't figure out how to affect this "descender gap". I've also made my own NSTextAttachmentCell subclass in order to control some other image behavior, but I can't seem to address this issue there. FWIW, letting the system use its own default text attachment cell for images exhibits the same behavior.

With the dizzying complexity (at least to me) of the text system architecture, surely there's a good way for me to control this "descender gap"! Help!

----

Leon McNeill
Softchaos Ltd.
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Set the Backup Date
  • Next by Date: Re: Splash Screen Strategy?
  • Previous by thread: Set the Backup Date
  • Next by thread: "BAD_ACCESS" error when showing window [newbie to cocoa]
  • Index(es):
    • Date
    • Thread