Am I Reinventing the Wheel? (Part II)
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