Draw: Fixed Color Emoji with FreeType

This commit is contained in:
Mirek Fidler 2021-12-12 16:36:17 +01:00
parent 7edfc57742
commit d16b2ab18a
9 changed files with 77 additions and 26 deletions

View file

@ -5,20 +5,21 @@ using namespace Upp;
struct MyApp : TopWindow {
void Paint(Draw& w) {
String text;
text << WString(0x1F970, 1).ToString();
text << WString(0x1F603, 1).ToString();
text << WString(0x1F923, 1).ToString();
text << " Quick brown fox, 訓民正音 (훈민정음) ";
w.DrawRect(GetSize(), White());
int y = 10;
int x = 10;
for(int i = 0; i < Font::GetFaceCount(); i++)
for(int i = 0; i < 3/*Font::GetFaceCount()*/; i++)
{
Font fnt(i, 30);
DLOG(i << " " << fnt << " " << fnt[0x1F970]);
if(fnt.IsSpecial()) continue;
fnt.Italic();
String n = AsString(i) + ": " + fnt.GetFaceName() + ": ";
if(fnt.IsSpecial())
n << " (special)";
String n; // = AsString(i) + ": " + fnt.GetFaceName() + ": ";
w.DrawText(x, y, n, StdFont());
w.DrawText(x + GetTextSize(n, StdFont()).cx, y, text, fnt);
y += fnt.GetLineHeight() + 10;