[Lazarus] How do I use Unicode characters on MacOS / Carbon?
Brad Campbell
brad at wasp.net.au
Sun Oct 5 11:09:28 CEST 2008
Mattias Gaertner wrote:
> On Sun, 05 Oct 2008 11:03:08 +0400
> Brad Campbell <brad at wasp.net.au> wrote:
>
>> G'day all.
>>
>> On Linux/gtk2 I simply do this
>>
>> Edit1.Text := WideChar($F080);
>>
>> I don't even need to specify the font name as it's the only one with
>> that character and it just gets pulled up.
>
> It does not show here (gtk2/ubuntu). It shows the usual box with the hex
> code.
That would probably be because you don't have this particular font. It uses a Unicode range for
"Manufacturer Specific" stuff..
>> On Carbon all I get is '?' in the non ASCII char ranges.
>
> Non ascii characters like 8364 (euro) works here (utf8/carbon).
Ok, I tried converting $F080 to UTF-8 and inserting it that way, but I got an odd symbol that was
not what I was expecting. I'll play with it some more.
For testing can I just manually convert to 3 byte UTF-8 and insert it like
Edit1.Text := Char($EF) + Char($82) + Char($80);
>> I've tried specifying the font by name ..
>>
>> Edit1.Font.Name := 'Parallax';
>>
>> ..and the ASCII chars use that font, but still nothing outside the
>> $20 - $7E range.
>
> Why do you think, that your font supports that character?
>
Because :
A) on Linux/gtk2 it displays the correct glyph when I use WideChar($F080)
B) I went through the font in FontForge and checked that the glyphs are assigned in the correct places.
I have this working flawlessly on Linux / GTK2, I just can't get it to work on Mac/Carbon.
I'll have a play with using UTF-8 instead of WideChar again. I did try it, and I got a glyph, just
not one that exists in this Font set.
Cheers for the advice guys :)
Brad
--
Dolphins are so intelligent that within a few weeks they can
train Americans to stand at the edge of the pool and throw them
fish.
More information about the Lazarus
mailing list