font.pkg

来自「cegui界面库」· PKG 代码 · 共 54 行

PKG
54
字号
/***********************************************************************
	TextFormatting
***********************************************************************/
enum TextFormatting
{
	LeftAligned,
	RightAligned,
	Centred,
	Justified,
	WordWrapLeftAligned,
	WordWrapRightAligned,
	WordWrapCentred,
	WordWrapJustified
};


/***********************************************************************
	Font
***********************************************************************/
class Font //: public PropertySet
{
	//////////////////////////////////////////////
	// PropertySet
	void setProperty(string name, string value);
	string getProperty(string name) const;
	string getPropertyDefault(string name) const;
	string getPropertyHelp(string name) const;

	bool isPropertyPresent(string name) const;
	bool isPropertyDefault(string name) const;

    tolua_outside PropertyIterator ceguiLua_getPropertyIterator @ getPropertyIterator() const;

    static void setDefaultResourceGroup(string resourceGroup);
    static string getDefaultResourceGroup();

    void load ();

	bool isCodepointAvailable(unsigned long cp) const;

	void setNativeResolution(const Size& sz);
	void notifyScreenResolution(const Size& sz);

	float getTextExtent(string text, float xscale=1);
	float getLineSpacing(float yscale=1) const;
	float getFontHeight(float yscale=1) const;

	unsigned long getCharAtPixel(string text, unsigned long start_char, float pixel, float xscale=1);
	unsigned long getCharAtPixel(string text, float pixel, float xscale=1);

	unsigned long getFormattedLineCount(string text, const Rect& format_area, TextFormatting fmt, float xscale=1);
	float getFormattedTextExtent(string text, const Rect& format_area, TextFormatting fmt, float xscale=1);
};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?