IwGxFontDrawText 함수를 사용하여 마멀레이드 프로젝트에서 키릴 문자의 문자열을 표시하려고합니다. 나는 TimesNewRoman의 TTF 파일을 추가 한, 그리고 내 코드 :IwGxFontDrawText를 사용하여 키릴 문자 표시
int main()
{
// Initialise Iw2D
Iw2DInit();
// Create the font that is used to display the score
CIwGxFont *Font = IwGxFontCreateTTFont("TNR_B.ttf", 14);
IwGxLightingOn();
IwGxFontSetFont(Font);
IwGxFontSetRect(CIwRect((int16)10, (int16)10, (int16)IwGxGetScreenWidth(), (int16)IwGxGetScreenHeight()));
int scores = 0;
while (!s3eDeviceCheckQuitRequest())
{
// Clear background to blue
Iw2DSurfaceClear(0xff8080);
IwGxFontDrawText("Привет: ");
// Convert the score number to text
char str[32];
snprintf(str, 32, " %d", scores);
IwGxFontDrawText(str);
scores++;
// Flip the surface buffer to screen
Iw2DSurfaceShow();
s3eDeviceYield(0); // Yield to OS
}
Iw2DTerminate();
return 0;
}
나는 라틴어 텍스트를 표시 할 때 - 모든 작품,하지만 난 키릴 텍스트를 표시 할 때 - 나는
가 어떻게 키릴 보여줄 수있는 오류가 본문?
메시지가 묻는 메시지 : 소스 코드 (따라서 문자열 리터럴) [UTF-8] (http://en.wikipedia.org/wiki/UTF-8)가 인코딩 되었습니까? 많은 편집자가 Windows에서 UTF-8이 아닌 기본 인코딩을 사용합니다. – Csq
@Csq, 어떻게 문자열 리터럴을 UTF-8로 변환 할 수 있습니까? – daleijn
어떤 편집기를 사용합니까? 해당 설정에서 UTF-8 인코딩을 검색하십시오. 대부분의 편집기는 UTF-8을 사용할 수 있습니다. 예를 들어 Notepad ++는 UTF-8 파일을 저장하고 변환 할 수 있습니다 (인코딩 메뉴 참조). – Csq