Messagekit: Japanese Emoji are not displayed.

Created on 15 Aug 2018  ·  6Comments  ·  Source: MessageKit/MessageKit

For example. Enter the following.
Ꮚ˘̴͈́ꈊ˘̴͈̀Ꮚ⋆✩

img_1076

It not displayed from the middle.

I used example app.

MessageKit Version
1.0.0

iOS Version
11.4.1

Swift Version
4.1.2

Device
iPhone X

confirmed bug

Most helpful comment

@SD10 It's totaly a weird issue. In ConversationViewCOntroller.swift Replacing;

let attributedText = NSAttributedString(string: text, attributes: [.font: UIFont.systemFont(ofSize: 18), .foregroundColor: UIColor.blue])

with

let font = UIFont.systemFont(ofSize: 18)
let attributedText = NSAttributedString(string: text, attributes: [.font: UIFont(name: font.fontName, size: 18), .foregroundColor: UIColor.blue])

solves the issue. Also, I have tried with other fonts as well. It all works with UIFont(name: font.fontName, size: 18)

All 6 comments

@nathantannar4 Any idea on this one?

No idea, can you try using NSAttributedString?

Sent with GitHawk

I also see something similar in https://github.com/MessageKit/MessageKit/issues/812. Maybe 1.1 will resolve it. Not sure what's happening

@SD10 It's totaly a weird issue. In ConversationViewCOntroller.swift Replacing;

let attributedText = NSAttributedString(string: text, attributes: [.font: UIFont.systemFont(ofSize: 18), .foregroundColor: UIColor.blue])

with

let font = UIFont.systemFont(ofSize: 18)
let attributedText = NSAttributedString(string: text, attributes: [.font: UIFont(name: font.fontName, size: 18), .foregroundColor: UIColor.blue])

solves the issue. Also, I have tried with other fonts as well. It all works with UIFont(name: font.fontName, size: 18)

Closing since fixed by #1 Made a mistake, the PR is still living on a fork.

I confirmed https://github.com/yokochi/MessageKit/pull/1 does fix the issue. Maybe @yokochi can submit a PR?

Was this page helpful?
0 / 5 - 0 ratings