symbian字体使用方法汇总
2007-09-05 18:36
489 查看
windcao发表与:http://blog.csdn.net/windcao/archive/2007/09/05/1773637.aspx
先看看代码,由于标签的原有有些内容有误,
gc.DrawText(_L("SymbolFont /x671D/x5916/x5927/x8857"),TPoint(x,baseH));
被显示成了
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("SymbolFont g1DY16Y2757"),TPoint(x,baseH));
实际上/x671D/x5916/x5927/x8857是汉字 朝外大街。
获取固定大小的字体:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
void CTestView::Draw( const TRect& /**//*aRect*/ ) const
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Get the standard graphics context
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
CWindowGc& gc = SystemGc();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Gets the control's extent
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TRect drawRect( Rect());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Clears the screen
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.Clear( drawRect );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TInt baseH=0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TInt incH=10;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TInt x=0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
const CFont* myFont=NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//--------------------------拉丁字体
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=LatinPlain12();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("LatinPlain12 g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=LatinBold12();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//gc.DrawText(_L("LatinBold12 g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("LatinBold12"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=LatinBold13();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//gc.DrawText(_L("LatinBold13 g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("LatinBold13"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=LatinBold16();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//gc.DrawText(_L("LatinBold16 g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("LatinBold16"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=LatinBold17();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("LatinBold17 g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=LatinBold19();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("LatinBold19 g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=NumberPlain5();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("1234567890"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=ClockBold30();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("ClockBold30 g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=LatinClock14();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("LatinClock14 g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//---------------------中文字体
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=ApacPlain16();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// gc.DrawText(_L("ApacPlain16 g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("ApacPlain16"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=ApacPlain12();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// gc.DrawText(_L("ApacPlain12 g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("ApacPlain12"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
获取固定比例的字体。
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
void CTest2View::Draw( const TRect& /**//*aRect*/ ) const
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Get the standard graphics context
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
CWindowGc& gc = SystemGc();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Gets the control's extent
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TRect drawRect( Rect());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Clears the screen
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.Clear( drawRect );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TInt baseH=0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TInt incH=10;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TInt x=0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
const CFont* myFont=NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=CEikonEnv::Static()->TitleFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels() +1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("TitleFont g1DY16"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=CEikonEnv::Static()->NormalFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("NormalFont g1DY16Y27"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=CEikonEnv::Static()->AnnotationFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("AnnotationFont g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=CEikonEnv::Static()->LegendFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("LegendFont g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=CEikonEnv::Static()->SymbolFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("SymbolFont g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=CEikonEnv::Static()->DenseFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("DenseFont g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
下面是各个版本的s60 平台上面模拟器的截图。
先看看代码,由于标签的原有有些内容有误,
gc.DrawText(_L("SymbolFont /x671D/x5916/x5927/x8857"),TPoint(x,baseH));
被显示成了
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("SymbolFont g1DY16Y2757"),TPoint(x,baseH));
实际上/x671D/x5916/x5927/x8857是汉字 朝外大街。
获取固定大小的字体:
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
void CTestView::Draw( const TRect& /**//*aRect*/ ) const
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Get the standard graphics context
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
CWindowGc& gc = SystemGc();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Gets the control's extent
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TRect drawRect( Rect());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Clears the screen
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.Clear( drawRect );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TInt baseH=0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TInt incH=10;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TInt x=0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
const CFont* myFont=NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//--------------------------拉丁字体
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=LatinPlain12();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("LatinPlain12 g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=LatinBold12();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//gc.DrawText(_L("LatinBold12 g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("LatinBold12"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=LatinBold13();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//gc.DrawText(_L("LatinBold13 g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("LatinBold13"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=LatinBold16();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//gc.DrawText(_L("LatinBold16 g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("LatinBold16"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=LatinBold17();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("LatinBold17 g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=LatinBold19();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("LatinBold19 g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=NumberPlain5();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("1234567890"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=ClockBold30();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("ClockBold30 g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=LatinClock14();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("LatinClock14 g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//---------------------中文字体
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=ApacPlain16();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// gc.DrawText(_L("ApacPlain16 g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("ApacPlain16"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=ApacPlain12();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// gc.DrawText(_L("ApacPlain12 g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("ApacPlain12"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
获取固定比例的字体。
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
void CTest2View::Draw( const TRect& /**//*aRect*/ ) const
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Get the standard graphics context
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
CWindowGc& gc = SystemGc();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Gets the control's extent
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TRect drawRect( Rect());
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// Clears the screen
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.Clear( drawRect );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TInt baseH=0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TInt incH=10;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
TInt x=0;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
const CFont* myFont=NULL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=CEikonEnv::Static()->TitleFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels() +1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("TitleFont g1DY16"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=CEikonEnv::Static()->NormalFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("NormalFont g1DY16Y27"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=CEikonEnv::Static()->AnnotationFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("AnnotationFont g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=CEikonEnv::Static()->LegendFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("LegendFont g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=CEikonEnv::Static()->SymbolFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("SymbolFont g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
myFont=CEikonEnv::Static()->DenseFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.UseFont( myFont );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
baseH+=myFont->HeightInPixels()+1;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DrawText(_L("DenseFont g1DY16Y2757"),TPoint(x,baseH));
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
gc.DiscardFont();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
下面是各个版本的s60 平台上面模拟器的截图。
![](http://p.blog.csdn.net/images/p_blog_csdn_net/windcao/333210/o_s60fonts.jpg)
相关文章推荐
- symbian字体使用方法汇总
- symbian字体使用方法汇总
- symbian字体使用方法汇总
- symbian字体使用方法汇总
- symbian字体使用方法汇总
- symbian系统皮肤(theme)使用方法汇总
- symbian系统皮肤(theme)使用方法汇总
- symbian皮肤使用方法汇总
- Photoshop字体安装使用方法和技巧
- ExtJS的使用方法汇总(1)——配置和表格控件使用
- ExtJS的使用方法汇总(5)——布局
- 使用Selector改变TextView的字体颜色textColor的方法
- Android 中使用自定义字体的方法
- 解析Android中使用自定义字体的实现方法
- MTK 驱动开发(3)---GPIO口的使用方法汇总
- 常量,字段,构造方法 调试 ms 源代码 一个C#二维码图片识别的Demo 近期ASP.NET问题汇总及对应的解决办法 c# chart控件柱状图,改变柱子宽度 使用C#创建Windows服务 C#服务端判断客户端socket是否已断开的方法 线程 线程池 Task .NET 单元测试的利剑——模拟框架Moq
- Python3学习之使用Print输出带颜色字体方法步骤详解
- javascript 中数组使用方法汇总【转】
- Silverlight中关于ComboBox的各种使用(基本上是汇总了往上的一些方法)
- Android使用自定义字体的方法