Register
Site Login
Site Search
Forums
Advertisement
Welcome to PocketMatrix. PocketMatrix is dedicated to providing the best online community for mobile device developers and enthusiests. What's new?

How to support the Chinese?


How to support the Chinese?

Postby wdfwdf » Mar 31, 2008 @ 4:03pm

Drawing Chinese drawtext not, how can we show that this kind?
wdfwdf
pm Member
 
Posts: 2
Joined: Nov 9, 2007 @ 6:47pm


Re: How to support the Chinese?

Postby Marijn » Mar 31, 2008 @ 6:45pm

wdfwdf wrote:Drawing Chinese drawtext not, how can we show that this kind?


If you are talking about the default font (CGapiDisplay::GetSystemFont), your are right, because the image does not contain chinees characters. You have to make your own font, and after you make your GapiBitmapFont, you need to load the font with the create surface function, and after that you use the create font function with the chinees characters.

Its pritty easy and you can read about it here. http://www.gapidraw.com/docs/gapidraw/3 ... -frame.htm
Marijn
pm Member
 
Posts: 2
Joined: Mar 24, 2008 @ 10:24pm


Postby wprintf » Apr 1, 2008 @ 6:45am

wprintf
pm Member
 
Posts: 26
Joined: Jun 5, 2007 @ 9:25am


Re: How to support the Chinese?

Postby wdfwdf » Apr 1, 2008 @ 2:22pm

I would like to use the system fonts
wdfwdf
pm Member
 
Posts: 2
Joined: Nov 9, 2007 @ 6:47pm


Re: How to support the Chinese?

Postby Johan » Apr 1, 2008 @ 2:55pm

wdfwdf wrote:I would like to use the system fonts


Easiest way to do this is to use GetDC on a surface and draw to it using standard Win32 device context functions.

It will however be slower than using bitmapped fonts, and there might also be an overhead if the surface needs to be rotated to fit the device context.

Cheers
Johan
Johan Sanneblad, M.Sc, Ph.D
GapiDraw Systems Architect
[http://www.gapidraw.com]
User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Postby pytyj » Jun 18, 2008 @ 6:46am

// CGapiSurface* m_background;
if (SUCCEEDED(m_background->GetDC(&hdcSurf)))
{
CDC dc;
dc.Attach(hdcSurf);
//设置显示字体
dc.SetBkMode(TRANSPARENT);
CFont font;

VERIFY(font.CreateFont(
40, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
FW_BOLD,//FW_NORMAL, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
_T("宋体"))); // lpszFacename
dc.SelectObject(&font);

//dc.SetTextColor(RGB(0,0,255)); //设置字体颜色白色
CString txt(_T("你好"));
dc.DrawText(txt,CRect(10,30,200,70),DT_LEFT);
font.DeleteObject();
m_background->ReleaseDC(hdcSurf);
}
pytyj
pm Member
 
Posts: 4
Joined: Mar 29, 2007 @ 3:41am


Return to GapiDraw


Sort


Forum Description

The Cross-platform Graphics SDK for Palms, Pocket PCs, Symbian Devices, and Stationary PCs.

Moderators:

sponge, Johan

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron