2013-03-09 62 views
1

我使用WxPerl,我想繪製unicode或utf8文本。是否可以使用unicode或utf8在WxDC中繪製文本?

這可能嗎?

目前,我有這樣的事情: $ dc-> DrawText($ linestr,$ x,$ y * $ th);但它似乎只能像文字一樣繪製ascii。

我才發現原來是

$this->{Font} = Wx::Font->new(10, wxMODERN, wxNORMAL, wxNORMAL); 
$this->{Font}-> SetDefaultEncoding(wxFONTENCODING_UTF8); # error for this line see later 
$dc->SetFont($this->{Font}); 

不幸的是,我得到一個錯誤 使用方法:........

回答

0

蠟質::字體:: SetDefaultEncoding(編碼),我發現出來。

$ this - > {Font} - > SetDefaultEncoding(wxFONTENCODING_UTF8); 需要$ this - > {Font} - > SetEncoding(wxFONTENCODING_UTF8); 某些版本中功能的名稱已更改。

相關問題