⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 flashfontobj.h

📁 这是一个用VC++开发的flashsource端的程序
💻 H
字号:
// FlashFontObj.h: interface for the CFlashFontObj class.
//
//////////////////////////////////////////////////////////////////////

#ifndef __FONTOBJ_H
#define __FONTOBJ_H

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "ffont.h"
#include <windows.h>
#include <hash_map>
#include <string>

//class CFlashFontObj  : public CFlashObject
class fontInfo
{
public:
	std::string name;
	bool italics;
	bool underline;
	bool strikeout;
	long weight;

	bool operator==(fontInfo fi)
	{
		return (fi.name == name &&
				fi.italics == italics &&
				fi.underline == underline &&
				fi.strikeout == strikeout &&
				fi.weight == weight);
	}
};
class CFlashFontObj
{
	int font_size;

	int m_width;
	int m_height;
	BOOL m_italics, m_underline, m_strikeout;
	BOOL m_last_glyph;
	long m_weight;
	int m_oID;
	FlashTagDefineShape3 *m_shape;


public:

	static std::vector <fontInfo> font_infos;
	static std::vector  <FlashTagDefineFont2*> fonts;

	CFlashFontObj();
	virtual ~CFlashFontObj();

	int GetID() {return m_oID;}

	int GetWidth() { return m_width; }
	int GetHeight() { return m_height; }

	bool GetGlyphShape(const char *fontname, WORD charindex, FlashShape* s, long* advance, bool internal_ulines = false);
	
	int GetGlyphAdvance(const char *fontname, WORD charindex, WORD nextchar, int pointsize, BOOL usekern);

	void ConvertString (const char* text, char** buf);
	void WriteFontInfos(std::ostream &stream);
	bool WriteText(const char *fontname_, wchar_t *text, int x, int y, FlashRGB *color, int pointsize, BOOL italics, BOOL underline, BOOL strikeout, long weight, BOOL usekern, bool internal_ulines, std::ostream &stream, int characterId = 0);
};

#endif

⌨️ 快捷键说明

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