twemoji-color-font icon indicating copy to clipboard operation
twemoji-color-font copied to clipboard

[Question] In spite of iOS12 OpenType-SVG support, Twemoji falls back to black.

Open yuki-takeichi opened this issue 6 years ago • 4 comments

iOS 12 and macOS 10.14 Mojave support OpenType-SVG font in UIKit level, but TwitterColorEmojiSVGinOT can't be rendered correctly.

See Attachment 1 below. The label on the top of the screen uses TwitterColorEmojiSVGinOT, and the one on the bottom uses another OpenType-SVG font. The top label unintentionally falls back to black otherwise the bottom one is rendered correctly.

Do you have any ideas why it happens?

Thank you.

Attachment 1: image

Source code:

import UIKit

class ViewController: UIViewController {

    @IBOutlet weak var label: UILabel!
    @IBOutlet weak var label2: UILabel!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        guard let twemoji = UIFont(name: "TwitterColorEmojiSVGinOT", size: 40) else {
            fatalError()
        }
        label.font = UIFontMetrics.default.scaledFont(for: twemoji)
        
        guard let abelone = UIFont(name: "Abelone", size: 40) else {
            fatalError()
        }
        label2.font = abelone
    }

}

yuki-takeichi avatar Aug 21 '18 04:08 yuki-takeichi

Huh. Interesting. Can you try my other SVGinOT fonts? Note: I don't use a Mac, so this isn't something I can test easily.

http://xerographer.github.io/reinebow/

13rac1 avatar Aug 26 '18 23:08 13rac1

@13rac1

Can you try my other SVGinOT fonts?

Reinebow-SVGinOT.ttf can be rendered correctly. See below. I'd appreciate if you suggest possible solutions. Feel free to ask me to try other font files if you want.

image

yuki-takeichi avatar Aug 27 '18 05:08 yuki-takeichi

It occurs to me. Which version of the font are you using? The standard or the OSX/MacOS version? I've got no way to test this, and have been hoping someone else had an idea.

13rac1 avatar Nov 01 '18 23:11 13rac1

Confirmed in #50 this issue applies to MacOS also with the Mac version (aka "Apple Color Emoji" replacing)

13rac1 avatar Nov 09 '18 21:11 13rac1