CBasePlatformFont


All platform-dependent classes have been moved to Platform Package in release 10.0.0.
This object has been removed in version 8.0.0. Use Windows OpenGL Renderer instead.

Class implements basic features of platform fonts. Its goal is to be a base class for platform fonts.

You can find more information in comments below. Overrided methods can be found in corresponding base class or interface.

class CBasePlatformFont :public virtual IPlatformFont
        {
        public:
            struct CHAR // Character data 
            {
                wchar_t Char; // Character 
                float Width; // Width returned by system 
                float Height; // Height returned by system 
                BitmapMask Data; // Character image 
                // Texture coordinates of the character in all characters texture 
                float Tx1;
                float Ty1;
                float Tx2;
                float Ty2;
            };
        protected:
            std::vector<CHAR*> m_aChars; // List of characters data 
            PointF m_sCharacterSize; // Custom character size 
    
            CHAR *GetChar(const wchar_t chr); // Find character informataion. Create if not found and possible 
    
            virtual CHAR *CreateChar(const wchar_t chr) = 0; // Create character data 
        public:
            bool isItalic() override;
            bool isUnderline() override;
            bool isStrikeOut() override;
            String getFontName() override;
            int getHeight() override;
            FONT_WEIGHT getWeight() override;
            PointF getStringSize(const String &str, const float distance) override;
            // Since 3.0.0 
            PointF getCharacterSize() override;
            bool isMonospace() override;
    
            void Release() override;
            IPlatformFontService *QueryService() override;
    
            CBasePlatformFont(const String &fontname, const int height, const FONT_WEIGHT weight, const bool italic, const bool underline, const bool strikeout, const PointF character_size); // Create with specified information 
            virtual ~CBasePlatformFont();
        };
Namespace: nitisa::standard
Include: Standard/Platform/Base/BasePlatformFont.h