• 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
Font Smoothing In A Bitmap
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Font Smoothing In A Bitmap


  • Subject: Font Smoothing In A Bitmap
  • From: Perry Clarke <email@hidden>
  • Date: Tue, 13 Apr 2004 17:35:49 -0700

My application renders text to an internal bitmap so it can be displayed repeatedly without all the calculations involving font metrics, etc having to be redone.

It all works like a charm and sped things up nicely (particularly sideways scrolling of marquee style text). Then someone points out that if you set the "Font smoothing style" in the Appearance System Preferences panel to something other than "Standard" the new text is not rendered correctly.

They are right, it isn't. The same -[NSAttributedString drawAtPoint:] call gives different results depending on whether the target context is the screen or an image buffer. At some fairly low level, the framework (or the OS) is asking itself "are we drawing to the screen" and doing something different in that case.

Alright, I think, all I need to do is set something appropriate in the graphics context (the same thing that some level of the framework is presumably setting when drawing to the screen) and everything will be pixel perfect. After a search, all I can find that is apropos is:

CGContextSetShouldSmoothFonts()

Unfortunately, this only takes a boolean (not the 4 levels the user can specify in the Appearance panel) and while setting it has *some* effect on the text that is rendered, it's only a pale approximation of what is seen on the screen (I'll accept an argument that all that is needed is a boolean because the end-user gets to choose the *amount* of smoothing but the call doesn't duplicate what's on the screen either way).

So, has anyone else run up against this? What was your solution?

Perry
_______________________________________________
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.


  • Follow-Ups:
    • Re: Font Smoothing In A Bitmap
      • From: Marcel Weiher <email@hidden>
  • Prev by Date: Deleting from TableView and MutableArray
  • Next by Date: Re: A pretty annoying problem with XCode???
  • Previous by thread: Re: Deleting from TableView and MutableArray
  • Next by thread: Re: Font Smoothing In A Bitmap
  • Index(es):
    • Date
    • Thread