x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
QuartzTextStyleAttribute.h - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\scintilla\macosx\QuartzTextStyleAttribute.h
旋转
特效
属性
历史版本
/* * QuartzTextStyleAttribute.h * * Original Code by Evan Jones on Wed Oct 02 2002. * Contributors: * Shane Caraveo, ActiveState * Bernd Paradies, Adobe * */ #include
#ifndef _QUARTZ_TEXT_STYLE_ATTRIBUTE_H #define _QUARTZ_TEXT_STYLE_ATTRIBUTE_H class QuartzTextStyleAttribute { public: QuartzTextStyleAttribute() {} virtual ~QuartzTextStyleAttribute() {} virtual ByteCount getSize() const = 0; virtual ATSUAttributeValuePtr getValuePtr() = 0; virtual ATSUAttributeTag getTag() const = 0; }; class QuartzTextSize : public QuartzTextStyleAttribute { public: QuartzTextSize( float points ) { size = X2Fix( points ); } ByteCount getSize() const { return sizeof( size ); } ATSUAttributeValuePtr getValuePtr() { return &size; } ATSUAttributeTag getTag() const { return kATSUSizeTag; } private: Fixed size; }; class QuartzTextStyleAttributeBoolean : public QuartzTextStyleAttribute { public: QuartzTextStyleAttributeBoolean( bool newVal ) : value( newVal ) {} ByteCount getSize() const { return sizeof( value ); } ATSUAttributeValuePtr getValuePtr() { return &value; } virtual ATSUAttributeTag getTag() const = 0; private: Boolean value; }; class QuartzTextBold : public QuartzTextStyleAttributeBoolean { public: QuartzTextBold( bool newVal ) : QuartzTextStyleAttributeBoolean( newVal ) {} ATSUAttributeTag getTag() const { return kATSUQDBoldfaceTag; } }; class QuartzTextItalic : public QuartzTextStyleAttributeBoolean { public: QuartzTextItalic( bool newVal ) : QuartzTextStyleAttributeBoolean( newVal ) {} ATSUAttributeTag getTag() const { return kATSUQDItalicTag; } }; class QuartzTextUnderline : public QuartzTextStyleAttributeBoolean { public: QuartzTextUnderline( bool newVal ) : QuartzTextStyleAttributeBoolean( newVal ) {} ATSUAttributeTag getTag() const { return kATSUQDUnderlineTag; } }; class QuartzFont : public QuartzTextStyleAttribute { public: /** Create a font style from a name. */ QuartzFont( const char* name, int length ) { assert( name != NULL && length > 0 && name[length] == '\0' ); // try to create font OSStatus err = ATSUFindFontFromName( const_cast
( name ), length, kFontFullName, (unsigned) kFontNoPlatform, kFontRomanScript, (unsigned) kFontNoLanguage, &fontid ); // need a fallback if font isn't installed if( err != noErr || fontid == kATSUInvalidFontID ) ::ATSUFindFontFromName( "Lucida Grande", 13, kFontFullName, (unsigned) kFontNoPlatform, kFontRomanScript, (unsigned) kFontNoLanguage, &fontid ); } ByteCount getSize() const { return sizeof( fontid ); } ATSUAttributeValuePtr getValuePtr() { return &fontid; } ATSUAttributeTag getTag() const { return kATSUFontTag; } ATSUFontID getFontID() const { return fontid; } private: ATSUFontID fontid; }; #endif
QuartzTextStyleAttribute.h
网页地址
文件地址
上一页
9/20
下一页
下载
( 3 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.