* Switch to pure Core Text Implementation, Start extended Font API * mac fixes * First msw implementation * Fixing paste error * fixing typo * Rearranging lines to former fallthrough order * Blind fixes for covering new abstract methods * Blind gtk implementations * Fixing according to travis .. * Removing method defined in base * formatting adaptions * Extending the schema definition for new weights * fixing typo, using wxRound, other fixes according to comments * changes according to suggestions * fixing init order, before the init of m_info was overridden by Init() * redo * redo * redo * Cleanup Removing obsolete code snippets, proper traces for font names * Moving common code Only the Get/SetNumericWeight calls should now be implemented in the native part, the ‚old‘ Get/SetWeight are common code and use the numeric counterparts. * Updating docs * commit wa missing changes.txt * Doc fixes * Full stops added
		
			
				
	
	
		
			124 lines
		
	
	
		
			4.2 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			124 lines
		
	
	
		
			4.2 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
/////////////////////////////////////////////////////////////////////////////
 | 
						|
// Name:        wx/gtk/font.h
 | 
						|
// Purpose:
 | 
						|
// Author:      Robert Roebling
 | 
						|
// Copyright:   (c) 1998 Robert Roebling
 | 
						|
// Licence:     wxWindows licence
 | 
						|
/////////////////////////////////////////////////////////////////////////////
 | 
						|
 | 
						|
#ifndef _WX_GTK_FONT_H_
 | 
						|
#define _WX_GTK_FONT_H_
 | 
						|
 | 
						|
// ----------------------------------------------------------------------------
 | 
						|
// wxFont
 | 
						|
// ----------------------------------------------------------------------------
 | 
						|
 | 
						|
class WXDLLIMPEXP_CORE wxFont : public wxFontBase
 | 
						|
{
 | 
						|
public:
 | 
						|
    wxFont() { }
 | 
						|
 | 
						|
    wxFont(const wxFontInfo& info);
 | 
						|
 | 
						|
    wxFont(const wxString& nativeFontInfoString)
 | 
						|
    {
 | 
						|
        Create(nativeFontInfoString);
 | 
						|
    }
 | 
						|
 | 
						|
    wxFont(const wxNativeFontInfo& info);
 | 
						|
 | 
						|
    wxFont(int size,
 | 
						|
           wxFontFamily family,
 | 
						|
           wxFontStyle style,
 | 
						|
           wxFontWeight weight,
 | 
						|
           bool underlined = false,
 | 
						|
           const wxString& face = wxEmptyString,
 | 
						|
           wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
 | 
						|
    {
 | 
						|
        Create(size, family, style, weight, underlined, face, encoding);
 | 
						|
    }
 | 
						|
 | 
						|
    wxFont(const wxSize& pixelSize,
 | 
						|
           wxFontFamily family,
 | 
						|
           wxFontStyle style,
 | 
						|
           wxFontWeight weight,
 | 
						|
           bool underlined = false,
 | 
						|
           const wxString& face = wxEmptyString,
 | 
						|
           wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
 | 
						|
    {
 | 
						|
        Create(10, family, style, weight, underlined, face, encoding);
 | 
						|
        SetPixelSize(pixelSize);
 | 
						|
    }
 | 
						|
 | 
						|
    bool Create(int size,
 | 
						|
                wxFontFamily family,
 | 
						|
                wxFontStyle style,
 | 
						|
                wxFontWeight weight,
 | 
						|
                bool underlined = false,
 | 
						|
                const wxString& face = wxEmptyString,
 | 
						|
                wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
 | 
						|
 | 
						|
    // wxGTK-specific
 | 
						|
    bool Create(const wxString& fontname);
 | 
						|
 | 
						|
    virtual ~wxFont();
 | 
						|
 | 
						|
    // implement base class pure virtuals
 | 
						|
    virtual float GetFractionalPointSize() const wxOVERRIDE;
 | 
						|
    virtual wxFontStyle GetStyle() const wxOVERRIDE;
 | 
						|
    virtual wxFontWeight GetWeight() const wxOVERRIDE;
 | 
						|
    virtual int GetNumericWeight() const wxOVERRIDE;
 | 
						|
    virtual wxString GetFaceName() const wxOVERRIDE;
 | 
						|
    virtual bool GetUnderlined() const wxOVERRIDE;
 | 
						|
    virtual bool GetStrikethrough() const wxOVERRIDE;
 | 
						|
    virtual wxFontEncoding GetEncoding() const wxOVERRIDE;
 | 
						|
    virtual const wxNativeFontInfo *GetNativeFontInfo() const wxOVERRIDE;
 | 
						|
    virtual bool IsFixedWidth() const wxOVERRIDE;
 | 
						|
 | 
						|
    virtual void SetPointSize(float pointSize) wxOVERRIDE;
 | 
						|
    virtual void SetFamily(wxFontFamily family) wxOVERRIDE;
 | 
						|
    virtual void SetStyle(wxFontStyle style) wxOVERRIDE;
 | 
						|
    virtual void SetWeight(wxFontWeight weight) wxOVERRIDE;
 | 
						|
    virtual void SetNumericWeight(int weight) wxOVERRIDE;
 | 
						|
    virtual bool SetFaceName( const wxString& faceName ) wxOVERRIDE;
 | 
						|
    virtual void SetUnderlined( bool underlined ) wxOVERRIDE;
 | 
						|
    virtual void SetStrikethrough(bool strikethrough) wxOVERRIDE;
 | 
						|
    virtual void SetEncoding(wxFontEncoding encoding) wxOVERRIDE;
 | 
						|
 | 
						|
    wxDECLARE_COMMON_FONT_METHODS();
 | 
						|
 | 
						|
    wxDEPRECATED_MSG("use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants")
 | 
						|
    wxFont(int size,
 | 
						|
           int family,
 | 
						|
           int style,
 | 
						|
           int weight,
 | 
						|
           bool underlined = false,
 | 
						|
           const wxString& face = wxEmptyString,
 | 
						|
           wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
 | 
						|
    {
 | 
						|
        (void)Create(size, (wxFontFamily)family, (wxFontStyle)style, (wxFontWeight)weight, underlined, face, encoding);
 | 
						|
    }
 | 
						|
 | 
						|
    // Set Pango attributes in the specified layout. Currently only
 | 
						|
    // underlined and strike-through attributes are handled by this function.
 | 
						|
    //
 | 
						|
    // If neither of them is specified, returns false, otherwise sets up the
 | 
						|
    // attributes and returns true.
 | 
						|
    bool GTKSetPangoAttrs(PangoLayout* layout) const;
 | 
						|
 | 
						|
protected:
 | 
						|
    virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info ) wxOVERRIDE;
 | 
						|
 | 
						|
    virtual wxGDIRefData* CreateGDIRefData() const wxOVERRIDE;
 | 
						|
    virtual wxGDIRefData* CloneGDIRefData(const wxGDIRefData* data) const wxOVERRIDE;
 | 
						|
 | 
						|
    virtual wxFontFamily DoGetFamily() const wxOVERRIDE;
 | 
						|
 | 
						|
private:
 | 
						|
    void Init();
 | 
						|
 | 
						|
    wxDECLARE_DYNAMIC_CLASS(wxFont);
 | 
						|
};
 | 
						|
 | 
						|
#endif // _WX_GTK_FONT_H_
 |