/*---------------------------------------------------------------------------* Project: NintendoWare File: font_PairFont.h Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo and/or its licensed developers and are protected by national and international copyright laws. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. The content herein is highly confidential and should be handled accordingly. $Revision: 31311 $ *---------------------------------------------------------------------------*/ #ifndef NW_FONT_PAIRFONT_H_ #define NW_FONT_PAIRFONT_H_ #include #include namespace nw { namespace font { //--------------------------------------------------------------------------- //! @brief 内部に2つのフォントを保持し、1つのフォントのように扱います。 //--------------------------------------------------------------------------- class PairFont : public Font { public: /* ------------------------------------------------------------------------ 関数 ------------------------------------------------------------------------ */ //! @name コンストラクタ / デストラクタ //@{ //! @brief コンストラクタです。 //! //! @param[in] primary フォントへのポインタ。 //! @param[in] secondary フォントへのポインタ。 //! PairFont( Font* primary, Font* secondary); //! デストラクタです。 virtual ~PairFont(); //@} //! @name フォント情報の取得 //@{ virtual int GetWidth() const; virtual int GetHeight() const; virtual int GetAscent() const; virtual int GetDescent() const; virtual int GetMaxCharWidth() const; virtual Type GetType() const; virtual TexFmt GetTextureFormat() const; virtual int GetLineFeed() const; virtual const CharWidths GetDefaultCharWidths() const; //@} //! @name フォント情報の設定 //@{ virtual void SetDefaultCharWidths(const CharWidths& widths); virtual bool SetAlternateChar(CharCode c); virtual void SetLineFeed(int linefeed); //@} //! @name 文字情報の取得 //@{ virtual int GetCharWidth( CharCode c // 幅を求める文字 ) const; virtual const CharWidths GetCharWidths( CharCode c // 幅を求める文字 ) const; virtual void GetGlyph( Glyph* glyph, // グリフ情報を受け取るバッファ CharCode c // グリフ情報を取得する文字 ) const; virtual bool HasGlyph( CharCode c // グリフ情報の有無を取得する文字 ) const; //@} //! @name 文字列エンコーディング //@{ virtual CharacterCode GetCharacterCode() const; //@} //! @name シート情報の取得 //@{ virtual int GetBaselinePos() const; virtual int GetCellHeight() const; virtual int GetCellWidth() const; //@} //! @name テクスチャ補間 //@{ virtual void EnableLinearFilter( bool atSmall, bool atLarge); virtual bool IsLinearFilterEnableAtSmall() const; virtual bool IsLinearFilterEnableAtLarge() const; virtual u32 GetTextureWrapFilterValue() const; //@} private: /* ------------------------------------------------------------------------ 変数 ------------------------------------------------------------------------ */ // フォントの実体へのポインタ Font* m_Primary; Font* m_Secondary; // 代替文字を1つ目のフォントから取得するかどうか bool m_AlternateWithPrimary; u8 m_Padding[3]; }; } // namespace font } // namespace nw #endif // NW_FONT_PAIRFONT_H_