• 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
Am I Reinventing the Wheel? (Part II)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Am I Reinventing the Wheel? (Part II)


  • Subject: Am I Reinventing the Wheel? (Part II)
  • From: Charles Jenkins <email@hidden>
  • Date: Thu, 08 Jan 2015 07:43:47 -0500

This is the second issue for which I'm looking for an existing API call.

I have two ranges from an NSAttributedString. I want to compare their fonts and attributes in such a way as to derive a dictonary containing only the differences. Does a font-and-attribute comparison method already exist?

What I'm thinking of writing is a function to create a dictonary and toss in FamilyName, PointSize, plus everything in the range's associated attributes dictionary. Generate one of these for each attribute range, and then just write a dictionary-comparison function which will return a new dictionary containing only those attributes which differ.

The purpose is to find out where characters in a paragraph differ from the paragraph's overall style, so that my XML data file can store difference ranges and attributes only where necessary to recreate the original, rather than having to store a lot of redundant information.

—

Charles

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Am I Reinventing the Wheel? (Part II)
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Am I Reinventing the Wheel? (Part I)
  • Next by Date: Re: Saving NSAttributedString to a File
  • Previous by thread: Re: Am I Reinventing the Wheel? (Part I)
  • Next by thread: Re: Am I Reinventing the Wheel? (Part II)
  • Index(es):
    • Date
    • Thread