/*---------------------------------------------------------------------------* Project: Horizon File: font_PairFont.h Copyright (C)2009-2010 Nintendo Co., Ltd./HAL Laboratory, Inc. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. 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. $Revision: 32031 $ *---------------------------------------------------------------------------*/ #ifndef NN_FONT_FONT_PAIR_FONT_H_ #define NN_FONT_FONT_PAIR_FONT_H_ #include #include namespace nn { 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 nn #endif // NN_FONT_FONT_PAIR_FONT_H_