user12135943
user12135943

Reputation:

How to assign (display) Unicode UTF-32 (Miscellaneous Symbols and Pictographs) to TLabel.Caption?

I want to display 📍 (U+1F4CD - round pushpin) in a TLabel caption (lblLocation) displaying something like : "📍 Pretoria, South Africa", but I keep getting a weird block-like thing instead.

I have tried pasting the character directly into my source code, but this also results in a weird block-like thing (my source code is UTF-8 encoded).

Before Pasting 📍:

image

Directly after pasting 📍:

image

I have also tried using ConvertFromUtf32(), per How to convert unicode codepoint like U+1F4DB to char?.

lblLocation.Caption := lblLocation.Caption + ConvertFromUtf32(StrToInt('$1F4CD'));

Running the above code gives this in the caption of the TLabel:

image

Upvotes: 2

Views: 423

Answers (1)

David Heffernan
David Heffernan

Reputation: 612954

The character that you are trying to display does not have a glyph in the font that you are using. You need to find a font that does have a glyph for this character.

Upvotes: 5

Related Questions