Monday, 15 March 2010

ios - Strange behaviour of UILabel.attributedText combined with Emoji font -



ios - Strange behaviour of UILabel.attributedText combined with Emoji font -

i found unusual behviour of uilabel attributed text , emoji icons. have no thought how prepare it.

here code i'm doing every time text changes on textfield.

nslog(@"bef %@", self.textview.attributedtext); self.textview.attributedtext = [[nsmutableattributedstring alloc] initwithstring:self.textview.text]; nslog(@"after %@", self.textview.attributedtext);

output is:

bef qwe{ nsfont = "<uictfont: 0x7fc88b0e23d0> font-family: \"helvetica\"; font-weight: normal; font-style: normal; font-size: 12.00pt"; nsoriginalfont = "<uictfont: 0x7fc88b0e23d0> font-family: \"helvetica\"; font-weight: normal; font-style: normal; font-size: 12.00pt"; }😄{ nsfont = "<uictfont: 0x7fc88a4d6aa0> font-family: \"apple color emoji\"; font-weight: normal; font-style: normal; font-size: 12.00pt"; nsoriginalfont = "<uictfont: 0x7fc88b0e23d0> font-family: \"helvetica\"; font-weight: normal; font-style: normal; font-size: 12.00pt"; }1{ nsfont = "<uictfont: 0x7fc88b0e23d0> font-family: \"helvetica\"; font-weight: normal; font-style: normal; font-size: 12.00pt"; } 2014-11-06 15:49:04.256 inbot dev[31162:506070] after qwe{ nsfont = "<uictfont: 0x7fc88b0e23d0> font-family: \"helvetica\"; font-weight: normal; font-style: normal; font-size: 12.00pt"; nsoriginalfont = "<uictfont: 0x7fc88b0e23d0> font-family: \"helvetica\"; font-weight: normal; font-style: normal; font-size: 12.00pt"; }😄1{ nsfont = "<uictfont: 0x7fc88a4d6aa0> font-family: \"apple color emoji\"; font-weight: normal; font-style: normal; font-size: 12.00pt"; nsoriginalfont = "<uictfont: 0x7fc88b0e23d0> font-family: \"helvetica\"; font-weight: normal; font-style: normal; font-size: 12.00pt"; }

actual problem "1" after emoji getting within emoji block, shouldn't. i'm doing custom decoration on nsmutableattributedstring, that's illustration of problem narrowed down.

more interesting thing happens numbers, if set letter after emoji okey...

seems while setting attributedtext doing stuff emoji. got problem before ?

actually problem solved setting default font whole text while creating nsmutableattributedstring.

seems problem occurs when using helvetica fallback

ios objective-c uilabel nsattributedstring emoji

No comments:

Post a Comment