Increase font size of emoji characters in UITextView in iOS 5.x

If I have a UITextView and set the font size, say 32. When I launch the application (both in the simulator and on the device), I see a large cursor and the text that I entered, just as I would have expected. But if I switch the Emoji keyboard, they will appear small. As the font size never increased.

I know these scales of emoji fonts since I blew them to gigantic proportions in OSX Lion, and if I create a UIButton with the emoji symbol as a label and put the font on "Apple Color Emoji" and size up to 64, they look huge and gorgeous on my device. UITextView does not seem to resize them.

+8
ios fonts ios5 uitextview emoji
source share
2 answers

Have you tried installing the UITextView font on AppleColorEmoji? On iOS, it seems that AppleColorEmoji is the only font that will draw enlarged emoji. Use any other font, and emoji will never be more than approximately 20x20 pixels, as you noticed.

I performed my tests using this handy free app called Fonts! , which is a good way to get quick feedback on the device itself.

I note that the Game Center app seems to be able to mix an interesting font with an extended emoji, so it’s clear that this can be done better than an emoji font (quite pedestrian)! I do not know if this is something special in its code, or something special regarding the font used, which looks like a custom one.

+8
source share

You can scale emojis with ANY font, you set UITextViews contentScaleFactor, and then scale the text box with CGTransform. (You can even scale them more (high resolution) than AppleColorEmoji allows you by default by default.

float scaleFactor = 2.0f; float resolutionFactor = 2.0f; CGPoint tempCenter = theTextView.center; theTextView.contentScaleFactor *= resolutionFactor; theTextView.layer.contentsScale *= resolutionFactor; for (UIView *subview in [theTextView subviews]) { subview.contentScaleFactor *= resolutionFactor; subview.layer.contentsScale *= resolutionFactor; } theTextView.transform = CGAffineTransformScale(CGAffineTransformIdentity, scaleFactor, scaleFactor); theTextView.center = tempCenter; 
-one
source share

All Articles