Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

Drawing colored emoji using ofTrueTypeFont

$
0
0

@kotaonaga wrote:

Hi
I am really new to oF. I tried to display emoji using ofTrueTypeFont, but the drawn emoji was not colored. it was gray. is there any way to display colored emoji?

I don’t mean using ofSetColor. I wanted to use the default emoji color.

I looked at this page

my code is like this:

ofApp.h:

ofTrueTypeFont font;

ofApp.cpp:

void ofApp::setup(){
    ofBackground(40);
    ofTrueTypeFontSettings font_settings("Apple Color Emoji.ttc", 30);
    font_settings.antialiased = true;
    font_settings.addRanges(ofAlphabet::Emoji);
    font.load(font_settings);
}

void ofApp::draw(){
    font.drawString("🍣", 100, 400);
}

Output:
43

My oF version: 0.11.0
OS I use: macOS Catalina 10.15.4(19E266)
IDE I use: Version 11.4 (11E146)

Thank you.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles