I am creating a C ++ project using Embarcadero RAD Studio (10.2 Tokyo starter) and Windows GDI to draw text using the DrawText () function.
I recently saw that Windows 10 provides a new font called “Segoe UI Emoji,” which potentially allows text functions to draw colored emojis. I found some examples using Direct2D, but none of them have pure GDI features.
I also tried simple code, for example:
HDC hDC = ::GetDC(Handle); std::auto_ptr<TCanvas> pCanvas(new TCanvas()); pCanvas->Handle = hDC; pCanvas->Brush->Color = clWhite; pCanvas->Brush->Style = bsSolid; pCanvas->FillRect(TRect(0, 0, ClientWidth, ClientHeight)); const std::wstring text = L"Test 😀 😬 😁 😂 😃 😄 😅 😆"; TRect textRect(10, 10, ClientWidth - 10, ClientHeight - 10); hFont = ::CreateFont(-40, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_OUTLINE_PRECIS, CLIP_DEFAULT_PRECIS, CLEARTYPE_QUALITY, VARIABLE_PITCH, L"Segoe UI Emoji"); ::SelectObject(hDC, hFont); ::DrawTextW(hDC, text.c_str(), text.length(), &textRect, DT_LEFT | DT_TOP | DT_SINGLELINE); ::DeleteObject(hFont);
The output sounds good in terms of symbols, but they are painted in black and white, without colors, as you can see in the screenshot below: 
I could not find any additional parameters that could allow me to draw text using colored characters instead of black and white. Is there a way to activate color support in the GDI DrawText () function, and if so, how to do it? Or can only Direct2D draw color emotions?
EDITED until 10/30/2017
Since GDI cannot do this work (unfortunately, and as I thought), I am posting here a version of Direct2D of the above code that worked for me.
const std::wstring text = L"Test 😀 😬 😁 😂 😃 😄 😅 😆"; HDC hDC = ::GetDC(Handle); std::auto_ptr<TCanvas> pGDICanvas(new TCanvas()); pGDICanvas->Handle = hDC; pGDICanvas->Brush->Color = clWhite; pGDICanvas->Brush->Style = bsSolid; pGDICanvas->FillRect(TRect(0, 0, ClientWidth, ClientHeight)); ::D2D1_RECT_F textRect; textRect.left = 10; textRect.top = 10; textRect.right = ClientWidth - 10; textRect.bottom = ClientHeight - 10; std::auto_ptr<TDirect2DCanvas> pCanvas(new TDirect2DCanvas(hDC, TRect(0, 0, ClientWidth, ClientHeight)));
Of course, this code will draw colored emotions only in the latest versions of Windows 10 and above. In previous versions, the text will be drawn as described above (and the code cannot be compiled).