• 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
SOLVED (ish) Re: Cropped Italic Letters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SOLVED (ish) Re: Cropped Italic Letters


  • Subject: SOLVED (ish) Re: Cropped Italic Letters
  • From: Jesse Abram <email@hidden>
  • Date: Wed, 23 Feb 2005 22:00:56 -0800

Thanks everyone, discussing this has helped me get a better picture of things. I've been led by people to 2 fixes, one described in Cocoa Programming (Anguish/Buck/Yacktman), and that is to simply add a space at the end of the string (which feels like a bit of a hack to me, but I compensated for it to cause the character to still display in the center of the view). The other solution was to use drawInRect:withAttributes:, and then to add an attribute to center the character in the view (I was using code that determined the point for drawAtPoint:withAttributes:, causing it to be centered.) So, I'm satisfied now, knowing that there are odd quirks to the displaying of text, but there are ways to make it work! Thanks everyone!
Jesse


Message: 8
Date: Wed, 23 Feb 2005 13:58:21 -0800
From: Jesse Abram <email@hidden>
Subject: Re: Cropped Italic Letters
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; format=flowed

Hmm, I see what you mean about the cropping in the dock! The weird
thing in my case though, is that I am using drawAtPoint:withAttributes,
not drawInRect:withAttributes to finally do the drawing of the letter,
and there doesn't seem to be anything in the code that actually
restricts the size of the draw area, aside from the boundaries of the
view, which are many times larger than and very far from the edges of
the letter. Also, letters of different widths crop at a different
places on the screen, relative to the width of the letter, like a very
narrow lowercase f loses almost everything but the vertical stick, but
wider letters crop further to the right. Sort of like the cropping
itself is center-justified or something... Anyone else out there know
what might be going on?
Jesse

Message: 13
Date: Wed, 23 Feb 2005 09:44:56 -0800
From: Christopher Drum <email@hidden>
Subject: Re: Cropped Italic Letters
To: Cocoa-Dev Mailing List <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; format=flowed

I've noticed this problem both with italic letters and shadows. In
fact, the shadow problem can be seen even just in the Dock. Put
something in the dock whose name contains letters with long tails... p,
q, y, et. al.


Notice how the tail of the letter is cut off and the shadow doesn't
continue beyond some cutoff point, cropping the text into a rect that
is clearly not tall enough to display the word in toto. Even words in
the dock without letters with tails have their shadows cropped. It's
easier to see this with a white desktop background, but the shadows are
clearly cropped on the base of the letters.


In my screwing around with italics and shadows, I found I had to do
what Rick Sharp has already suggested. Basically, I just finessed the
rects until they displayed what I wanted to see.


I am currently working through Cocoa Programming For Mac OS X 2nd
Edition, and I've encountered a problem while working on an exercise
program. When I display an italic character in my view object,
(nowhere
near the edges), it is drastically cropped on the righthand side. The
characters have a shadow as well, which is cropped slightly even when
the text is not italic. I've pasted some of my code here, if anyone
knows why this is happening, I would be very happy to hear.

I haven't worked with the italic style, but I can at least confirm the
problems with shadows.


I filed a bug last December (<rdar://3910767>) entitled "Cocoa string
drawing doesn't take shadow metrics in account".


------------------------------------------------------------------
Christopher Drum
http://homepage.mac.com/christopherdrum

Check out FileWrangler, my five-star rated (MacUpdate, VersionTracker)
Cocoa app written in Objective-C for the batch renaming of files.




_______________________________________________ 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: Cropped Italic Letters
  • Next by Date: NSProgressIndicator thread crash
  • Previous by thread: AppleScript Text Suite and undo
  • Next by thread: NSProgressIndicator thread crash
  • Index(es):
    • Date
    • Thread