本文整理汇总了C++中Font::GetFace方法的典型用法代码示例。如果您正苦于以下问题:C++ Font::GetFace方法的具体用法?C++ Font::GetFace怎么用?C++ Font::GetFace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Font
的用法示例。
在下文中一共展示了Font::GetFace方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TextUnicode
NAMESPACE_UPP
#ifdef flagWINGL
#include <WinGl/FontGl.h>
#include <WinGl/ResGl.h>
#endif
#define LLOG(x) // LOG(x)
#define LTIMING(x) // TIMING(x)
WString TextUnicode(const char *s, int n, byte cs, Font font)
{
if(n < 0)
n = (int)strlen(s);
#ifdef PLATFORM_WIN32
if(font.GetFace() == Font::SYMBOL) {
WStringBuffer b(n);
wchar *t = b;
while(n > 0) {
*t++ = *s++;
n--;
}
return b;
}
#endif
return ToUnicode(s, n, cs);
}
示例2: GetWin32Font
HFONT GetWin32Font(Font fnt, int angle)
{
LTIMING("GetWin32Font");
static HFontEntry cache[FONTCACHE];
ONCELOCK {
for(int i = 0; i < FONTCACHE; i++)
cache[i].font.Height(-30000);
}
HFontEntry be;
be = cache[0];
for(int i = 0; i < FONTCACHE; i++) {
HFontEntry e = cache[i];
if(i)
cache[i] = be;
if(e.font == fnt && e.angle == angle) {
if(i)
cache[0] = e;
return e.hfont;
}
be = e;
}
LTIMING("GetWin32Font2");
if(be.hfont)
DeleteObject(be.hfont);
be.font = fnt;
be.angle = angle;
#ifdef PLATFORM_WINCE
LOGFONT lfnt;
Zero(lfnt);
lfnt.lfHeight = fnt.GetHeight() ? -abs(fnt.GetHeight()) : -12;
lfnt.lfWeight = fnt.IsBold() ? FW_BOLD : FW_NORMAL;
lfnt.lfItalic = fnt.IsItalic();
lfnt.lfUnderline = fnt.IsUnderline();
lfnt.lfStrikeOut = fnt.IsStrikeout();
wcscpy(lfnt.lfFaceName, ToSystemCharset(fnt.GetFaceName()));
be.hfont = CreateFontIndirect(&lfnt);
#else
be.hfont = CreateFont(
fnt.GetHeight() ? -abs(fnt.GetHeight()) : -12,
fnt.GetWidth(), angle, angle, fnt.IsBold() ? FW_BOLD : FW_NORMAL,
fnt.IsItalic(), fnt.IsUnderline(), fnt.IsStrikeout(),
fnt.GetFace() == Font::SYMBOL ? SYMBOL_CHARSET : DEFAULT_CHARSET,
fnt.IsTrueTypeOnly() ? OUT_TT_ONLY_PRECIS : OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
fnt.IsNonAntiAliased() ? NONANTIALIASED_QUALITY : DEFAULT_QUALITY,
DEFAULT_PITCH|FF_DONTCARE,
fnt.GetFaceName()
);
#endif
cache[0] = be;
return be.hfont;
}
示例3: GetFontStyle
FtFontStyle GetFontStyle(Font font)
{
Vector<FtFontData>& fd = sFontData();
int face = font.GetFace();
if(face >= 0 && face < fd.GetCount()) {
const FtFontData& d = fd[face];
int ii = font.IsBold() + 2 * font.IsItalic();
if(d.style[ii])
return d.style[ii];
if(d.style[0])
return d.style[0];
}
return fd.At(0).style[0];
}
示例4: TextUnicode
WString TextUnicode(const char *s, int n, byte cs, Font font)
{
if(n < 0)
n = (int)strlen(s);
#ifdef PLATFORM_WIN32
if(font.GetFace() == Font::SYMBOL) {
WStringBuffer b(n);
wchar *t = b;
while(n > 0) {
*t++ = *s++;
n--;
}
return b;
}
#endif
return ToUnicode(s, n, cs);
}
示例5: Set
void FontSelectManager::Set(Font f) {
int fi = f.GetFace();
if(!face->HasKey(fi)) {
fi = face->FindValue(f.GetFaceName());
if(fi < 0)
fi = Font::COURIER;
else
fi = face->GetKey(fi);
}
face->SetData(fi);
FaceSelect();
height->SetData(f.GetHeight());
for(int i = 0; i < height->GetCount(); i++) {
int q = height->GetKey(i);
if(f.GetHeight() <= q) {
height->SetData(q);
break;
}
}
*bold = f.IsBold();
*italic = f.IsItalic();
*naa = f.IsNonAntiAliased();
}