The font I'm using in my iOS app has an unfortunate quality: its characters are unusually small, and as a result, if a user types in a string which includes emoji (or possibly other characters not included in the font? Haven't tested that), when iOS draws those glyphs in the AppleColorEmoji font they come out huge relative to the other glyphs.
This is of course complicated by the fact that emoji are "two-part" glyphs so I can't just do a simple for-each-character-in-the-string loop.
What I need is a method along the lines of
-(NSAttributedString *)attributedStringByAddingAttributes:(NSArray *)attrs toString:(NSString*)myString forCharactersNotInFont:(UIFont *)font
... Or failing that, at least
-(NSAttributedString *)attributedStringByAddingAttributes:(NSArray *)attrs toStringForEmoji:(NSString*)myString
...or something.
Not sure of the best way to do this.
Code I ended up with, using code adapted from here:
So far, seems to work quite nicely!