作者AuronC (AuronC)
看板Programming
标题Re: [问题] 字型档(*.ttf, *.ttc ) Viewer
时间Sun Oct 28 00:20:38 2007
※ 引述《AuronC (AuronC)》之铭言:
: Dear all:
: 我想写一支能看字型档内容的程式,例如参数给
: Arial.ttf, 秀出第n个的图形.....
: 可是对字型档的结构不清楚....
: 可否有先进提供一些资料 or links,谢谢。
先作一个简单的实验...
我用VC6 开了一个 dialog based的AP....
想画出一个中文字: "上",程式码如下: (还是画不出来,有人知道怎麽改吗?)
//==================================================
// TODO: Add your control notification handler code here
CClientDC dc( this );
char ch[] = { 0x0A, 0x4E }; // 0x4E0A: 中文字= 上
// Font
CFont font;
LOGFONT lf;
dc.GetCurrentFont()->GetLogFont( &lf );
strcpy( lf.lfFaceName, "细明体" );
font.CreateFontIndirect( &lf );
dc.SelectObject(&font);
// Draw
dc.TextOut( 0, 0, ch, 2 );
//===================================================
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 122.124.179.151