Printing emojis

Does anyone know how to print text in FMX (Delphi 11.3) that includes emojis (I guess I really mean full UTF8)?
Using a string (with appropriate values) in VCL I can do
myString := ‘GoobledygookĀā😊’ + #$1F600;
Printer.Canvas.TextOut(10,10, myString);
and it prints with UTF8 characters (like A with a macron) and emojis.

I can’t work out how to do it in FMX.
My closest attempt is
Printer.Canvas.FillText(RectF(10, 10, Printer.PageWidth, 50), myString, False, 1, [], TTextAlign.Leading, TTextAlign.Leading)
which prints the text and special characters, but the emojis show as a square box (undefined character I guess). Probably because they aren’t defined in the font.

What fonts are you using in VCL vs FMX?

The same as near as I can tell - Arial
Printer.Canvas.Font.Name := ‘Arial’

Printer.Canvas.Font.Family := ‘Arial’

I’ve tried other fonts (like Verdana) and the text and non-latin characters change (possibly also the emojis), but still no joy. I also tried not specifying a font at all (default).
Maybe the VCL is irrelevant (I was mainly using it to test that I could print an emoji). My issue is how to print an emoji in FMX on Windows (I’ll look at the other platforms later).

Can you post a minimal test project that reproduces?

Fairly simple, combo to select printer, then a label and memo (for testing display) and a button to do it.
The label and memo both display correctly (with the emojis in colour), while the showmessage is also correct (with black and white emojis).

procedure TForm1.Button1Click(Sender : TObject);
myString : string;

{ Set the default DPI for the printer. The SelectDPI routine defaults
to the closest available resolution as reported by the driver. }

Printer.ActivePrinter := Printer.Printers[ComboBox1.ItemIndex];
Printer.ActivePrinter.SelectDPI(300, 300);

{ Set canvas filling style. }
Printer.Canvas.Fill.Color := claBlack;
Printer.Canvas.Fill.Kind := TBrushKind.Solid;

{ Start printing. }

myString := ‘GoobledygookĀā😊’ + #$1F600;
Memo1.Text := myString;
Label1.Text := myString;
Printer.Canvas.Font.Family := ‘Arial’;
Printer.Canvas.Font.Size := 24; { font (points) to inches to mm to dots }
Printer.Canvas.FillText(RectF(10, 10, Printer.PageWidth, 50), myString, False, 1, [], TTextAlign.Leading, TTextAlign.Leading);
{ Finish the printing job. }
FMXPrintEmoji.dpr (244 Bytes)
FMXPrintEmoji.dproj (53.1 KB)
FMXPrintemojimain.fmx (1.5 KB)
FMXPrintemojimain.pas (1.9 KB)

Best I can find is the answer on the link below, which indicates that GDI+ text output is borked. :frowning:

Log the issue with Emb, post the link, collect votes :+1:

I’d test if a proper report printer package (Fast Report etc) does it correctly.