diff options
author | Bo Xu <bo_xu@foxitsoftware.com> | 2014-10-28 23:03:33 -0700 |
---|---|---|
committer | Bo Xu <bo_xu@foxitsoftware.com> | 2014-11-03 11:10:11 -0800 |
commit | fdc00a7042d912aafaabddae4d9c84199921ef23 (patch) | |
tree | 32ab8ac91cc68d2cd15b9168782a71b3f3f5e7b9 /core/include | |
parent | e9b38fa38de2c95d8260be31c57d9272c4d127ed (diff) | |
download | pdfium-fdc00a7042d912aafaabddae4d9c84199921ef23.tar.xz |
Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
Diffstat (limited to 'core/include')
-rw-r--r-- | core/include/fpdfdoc/fpdf_doc.h | 3 | ||||
-rw-r--r-- | core/include/fxcodec/fx_codec.h | 184 | ||||
-rw-r--r-- | core/include/fxcodec/fx_codec_def.h | 15 | ||||
-rw-r--r-- | core/include/fxcodec/fx_codec_provider.h | 4 | ||||
-rw-r--r-- | core/include/fxcrt/fx_arb.h | 48 | ||||
-rw-r--r-- | core/include/fxcrt/fx_basic.h | 7 | ||||
-rw-r--r-- | core/include/fxcrt/fx_ext.h | 18 | ||||
-rw-r--r-- | core/include/fxcrt/fx_stream.h | 9 | ||||
-rw-r--r-- | core/include/fxcrt/fx_ucd.h | 99 | ||||
-rw-r--r-- | core/include/fxge/fx_font.h | 39 |
10 files changed, 421 insertions, 5 deletions
diff --git a/core/include/fpdfdoc/fpdf_doc.h b/core/include/fpdfdoc/fpdf_doc.h index e4cf777c1f..960e943e4a 100644 --- a/core/include/fpdfdoc/fpdf_doc.h +++ b/core/include/fpdfdoc/fpdf_doc.h @@ -1230,8 +1230,9 @@ public: FX_BOOL ClearSelectedOptions(FX_BOOL bNotify = FALSE); + FX_BOOL ClearOptions(FX_BOOL bNotify = FALSE);
- + int InsertOption(CFX_WideString csOptLabel, int index = -1, FX_BOOL bNotify = FALSE);
FX_FLOAT GetFontSize() { diff --git a/core/include/fxcodec/fx_codec.h b/core/include/fxcodec/fx_codec.h index da8b309dd6..b0eecc3e52 100644 --- a/core/include/fxcodec/fx_codec.h +++ b/core/include/fxcodec/fx_codec.h @@ -13,6 +13,7 @@ #include "fx_codec_provider.h" class CFX_DIBSource; class ICodec_ScanlineDecoder; +class ICodec_ProgressiveDecoder;
class ICodec_BasicModule; class ICodec_FaxModule; class ICodec_JpegModule; @@ -21,6 +22,11 @@ class ICodec_Jbig2Module; class ICodec_IccModule; class ICodec_FlateModule; class ICodec_Jbig2Encoder; +class ICodec_PngModule;
+class ICodec_GifModule;
+class ICodec_BmpModule;
+class ICodec_TiffModule;
+class CFX_DIBAttribute;
class ICodec_ScanlineDecoder; class CCodec_ModuleMgr : public CFX_Object { @@ -37,6 +43,9 @@ public: void InitIccDecoder(); +
+ ICodec_ProgressiveDecoder* CreateProgressiveDecoder();
+
ICodec_Jbig2Encoder* CreateJbig2Encoder(); protected: CCodec_ModuleMgr(); @@ -70,6 +79,22 @@ public: { return m_pFlateModule; } + ICodec_PngModule* GetPngModule()
+ {
+ return m_pPngModule;
+ }
+ ICodec_GifModule* GetGifModule()
+ {
+ return m_pGifModule;
+ }
+ ICodec_BmpModule* GetBmpModule()
+ {
+ return m_pBmpModule;
+ }
+ ICodec_TiffModule* GetTiffModule()
+ {
+ return m_pTiffModule;
+ }
protected: ICodec_BasicModule* m_pBasicModule; ICodec_FaxModule* m_pFaxModule; @@ -78,6 +103,10 @@ protected: ICodec_Jbig2Module* m_pJbig2Module; ICodec_IccModule* m_pIccModule; ICodec_FlateModule* m_pFlateModule; + ICodec_PngModule* m_pPngModule;
+ ICodec_GifModule* m_pGifModule;
+ ICodec_BmpModule* m_pBmpModule;
+ ICodec_TiffModule* m_pTiffModule;
}; class ICodec_BasicModule : public CFX_Object @@ -170,7 +199,7 @@ public: virtual void Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size) = 0; - virtual int ReadHeader(void* pContext, int* width, int* height, int* nComps) = 0; + virtual int ReadHeader(void* pContext, int* width, int* height, int* nComps, CFX_DIBAttribute* pAttribute = NULL) = 0;
virtual int StartScanline(void* pContext, int down_scale) = 0; @@ -197,6 +226,97 @@ public: virtual void DestroyDecoder(FX_LPVOID ctx) = 0; }; +class ICodec_PngModule : public CFX_Object
+{
+public:
+
+ virtual ~ICodec_PngModule() {}
+
+ virtual void* Start(void* pModule) = 0;
+
+ virtual void Finish(void* pContext) = 0;
+
+ virtual FX_BOOL Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size, CFX_DIBAttribute* pAttribute = NULL) = 0;
+
+ FX_BOOL (*ReadHeaderCallback)(void* pModule, int width, int height, int bpc, int pass, int* color_type, double* gamma);
+
+ FX_BOOL (*AskScanlineBufCallback)(void* pModule, int line, FX_LPBYTE& src_buf);
+
+ void (*FillScanlineBufCompletedCallback)(void* pModule, int pass, int line);
+};
+class ICodec_GifModule : public CFX_Object
+{
+public:
+
+ virtual ~ICodec_GifModule() {}
+
+ virtual void* Start(void* pModule) = 0;
+
+ virtual void Finish(void* pContext) = 0;
+
+ virtual FX_DWORD GetAvailInput(void* pContext, FX_LPBYTE* avail_buf_ptr = NULL) = 0;
+
+ virtual void Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size) = 0;
+
+ virtual FX_INT32 ReadHeader(void* pContext, int* width, int* height,
+ int* pal_num, void** pal_pp, int* bg_index, CFX_DIBAttribute* pAttribute = NULL) = 0;
+
+ virtual FX_INT32 LoadFrameInfo(void* pContext, int* frame_num) = 0;
+
+ void (*RecordCurrentPositionCallback)(void* pModule, FX_DWORD& cur_pos);
+
+ FX_LPBYTE (*AskLocalPaletteBufCallback)(void* pModule, FX_INT32 frame_num, FX_INT32 pal_size);
+
+ virtual FX_INT32 LoadFrame(void* pContext, int frame_num, CFX_DIBAttribute* pAttribute = NULL) = 0;
+
+ FX_BOOL (*InputRecordPositionBufCallback)(void* pModule, FX_DWORD rcd_pos, const FX_RECT& img_rc,
+ FX_INT32 pal_num, void* pal_ptr,
+ FX_INT32 delay_time, FX_BOOL user_input,
+ FX_INT32 trans_index, FX_INT32 disposal_method, FX_BOOL interlace);
+
+ void (*ReadScanlineCallback)(void* pModule, FX_INT32 row_num, FX_LPBYTE row_buf);
+};
+class ICodec_BmpModule : public CFX_Object
+{
+public:
+
+ virtual ~ICodec_BmpModule() {}
+
+ virtual void* Start(void* pModule) = 0;
+
+ virtual void Finish(void* pContext) = 0;
+
+ virtual FX_DWORD GetAvailInput(void* pContext, FX_LPBYTE* avail_buf_ptr = NULL) = 0;
+
+ virtual void Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size) = 0;
+
+ virtual FX_INT32 ReadHeader(void* pContext, FX_INT32* width, FX_INT32* height, FX_BOOL* tb_flag, FX_INT32* components,
+ int* pal_num, FX_DWORD** pal_pp, CFX_DIBAttribute* pAttribute = NULL) = 0;
+
+ virtual FX_INT32 LoadImage(void* pContext) = 0;
+
+ FX_BOOL (*InputImagePositionBufCallback)(void* pModule, FX_DWORD rcd_pos);
+
+ void (*ReadScanlineCallback)(void* pModule, FX_INT32 row_num, FX_LPBYTE row_buf);
+};
+class ICodec_TiffModule : public CFX_Object
+{
+public:
+
+ virtual ~ICodec_TiffModule() {}
+
+ virtual FX_LPVOID CreateDecoder(IFX_FileRead* file_ptr) = 0;
+
+
+ virtual void GetFrames(FX_LPVOID ctx, FX_INT32& frames) = 0;
+
+ virtual FX_BOOL LoadFrameInfo(FX_LPVOID ctx, FX_INT32 frame, FX_DWORD& width, FX_DWORD& height, FX_DWORD& comps, FX_DWORD& bpc, CFX_DIBAttribute* pAttribute = NULL) = 0;
+
+
+ virtual FX_BOOL Decode(FX_LPVOID ctx, class CFX_DIBitmap* pDIBitmap) = 0;
+
+ virtual void DestroyDecoder(FX_LPVOID ctx) = 0;
+};
class ICodec_Jbig2Module : public CFX_Object { public: @@ -218,6 +338,34 @@ public: virtual FXCODEC_STATUS ContinueDecode(void* pJbig2Content, IFX_Pause* pPause) = 0; virtual void DestroyJbig2Context(void* pJbig2Content) = 0; }; +class ICodec_ProgressiveDecoder : public CFX_Object
+{
+public:
+
+ virtual ~ICodec_ProgressiveDecoder() {}
+
+ virtual FXCODEC_STATUS LoadImageInfo(IFX_FileRead* pFile, FXCODEC_IMAGE_TYPE imageType = FXCODEC_IMAGE_UNKNOWN, CFX_DIBAttribute* pAttribute = NULL) = 0;
+
+ virtual FXCODEC_IMAGE_TYPE GetType() = 0;
+
+ virtual FX_INT32 GetWidth() = 0;
+
+ virtual FX_INT32 GetHeight() = 0;
+
+ virtual FX_INT32 GetNumComponents() = 0;
+
+ virtual FX_INT32 GetBPC() = 0;
+
+ virtual void SetClipBox(FX_RECT* clip) = 0;
+
+ virtual FXCODEC_STATUS GetFrames(FX_INT32& frames, IFX_Pause* pPause = NULL) = 0;
+
+ virtual FXCODEC_STATUS StartDecode(class CFX_DIBitmap* pDIBitmap,
+ FX_INT32 start_x, FX_INT32 start_y, FX_INT32 size_x, FX_INT32 size_y,
+ FX_INT32 frames = 0, FX_BOOL bInterpol = TRUE) = 0;
+
+ virtual FXCODEC_STATUS ContinueDecode(IFX_Pause* pPause = NULL) = 0;
+};
class ICodec_Jbig2Encoder : public CFX_Object { public: @@ -286,4 +434,38 @@ public: void AdobeCMYK_to_sRGB(FX_FLOAT c, FX_FLOAT m, FX_FLOAT y, FX_FLOAT k, FX_FLOAT& R, FX_FLOAT& G, FX_FLOAT& B); void AdobeCMYK_to_sRGB1(FX_BYTE c, FX_BYTE m, FX_BYTE y, FX_BYTE k, FX_BYTE& R, FX_BYTE& G, FX_BYTE& B); FX_BOOL MD5ComputeID(FX_LPCVOID buf, FX_DWORD dwSize, FX_BYTE ID[16]); +class CFX_DIBAttribute : public CFX_Object
+{
+public:
+ CFX_DIBAttribute();
+ ~CFX_DIBAttribute();
+
+ FX_INT32 m_nXDPI;
+
+ FX_INT32 m_nYDPI;
+
+ FX_FLOAT m_fAspectRatio;
+
+ FX_WORD m_wDPIUnit;
+
+ CFX_ByteString m_strAuthor;
+
+ FX_BYTE m_strTime[20];
+
+ FX_INT32 m_nGifLeft;
+ FX_INT32 m_nGifTop;
+
+ FX_DWORD* m_pGifLocalPalette;
+
+ FX_DWORD m_nGifLocalPalNum;
+
+ FX_INT32 m_nBmpCompressType;
+ class IFX_DIBAttributeExif* m_pExif;
+};
+class IFX_DIBAttributeExif : public CFX_Object
+{
+public:
+ virtual ~IFX_DIBAttributeExif() {};
+ virtual FX_BOOL GetInfo(FX_WORD tag, FX_LPVOID val) = 0;
+};
#endif diff --git a/core/include/fxcodec/fx_codec_def.h b/core/include/fxcodec/fx_codec_def.h index 0d08da699b..7a18f5be09 100644 --- a/core/include/fxcodec/fx_codec_def.h +++ b/core/include/fxcodec/fx_codec_def.h @@ -6,6 +6,15 @@ #ifndef _FX_CODEC_DEF_H_ #define _FX_CODEC_DEF_H_ +enum FXCODEC_IMAGE_TYPE { + FXCODEC_IMAGE_UNKNOWN = 0, + FXCODEC_IMAGE_BMP, + FXCODEC_IMAGE_JPG, + FXCODEC_IMAGE_PNG, + FXCODEC_IMAGE_GIF, + FXCODEC_IMAGE_TIF, + FXCODEC_IMAGE_MAX +}; enum FXCODEC_STATUS { FXCODEC_STATUS_ERROR = -1, FXCODEC_STATUS_FRAME_READY, @@ -58,6 +67,12 @@ enum FXCODEC_STATUS { #define Icc_PARAMTYPE_NONE 0 #define Icc_PARAMTYPE_BUFFER 1 #define Icc_PARAMTYPE_PARAM 2 +enum FXCODEC_RESUNIT { + FXCODEC_RESUNIT_NONE = 0, + FXCODEC_RESUNIT_INCH, + FXCODEC_RESUNIT_CENTIMETER, + FXCODEC_RESUNIT_METER +}; #define EXIFTAG_USHORT_RESUNIT 296 #define EXIFTAG_FLOAT_DPIX 282 #define EXIFTAG_FLOAT_DPIY 283 diff --git a/core/include/fxcodec/fx_codec_provider.h b/core/include/fxcodec/fx_codec_provider.h index a3ef396a27..f26194a14e 100644 --- a/core/include/fxcodec/fx_codec_provider.h +++ b/core/include/fxcodec/fx_codec_provider.h @@ -6,6 +6,7 @@ #ifndef _FX_CODEC_PROVIDER_H_ #define _FX_CODEC_PROVIDER_H_ +class CFX_DIBAttribute; class IFX_JpegProvider { public: @@ -39,8 +40,7 @@ public: virtual void Input(void* pContext, FX_LPCBYTE src_buf, FX_DWORD src_size) = 0; - virtual int ReadHeader(void* pContext, int* width, int* height, int* nComps) = 0; - + virtual int ReadHeader(void* pContext, int* width, int* height, int* nComps, CFX_DIBAttribute* pAttribute = NULL) = 0; virtual int StartScanline(void* pContext, int down_scale) = 0; diff --git a/core/include/fxcrt/fx_arb.h b/core/include/fxcrt/fx_arb.h index 4950f81716..ed0370ff74 100644 --- a/core/include/fxcrt/fx_arb.h +++ b/core/include/fxcrt/fx_arb.h @@ -6,6 +6,54 @@ #ifndef _FX_ARABIC_ #define _FX_ARABIC_ +class IFX_ArabicChar; +class IFX_BidiChar; +#ifdef __cplusplus +extern "C" +{ +#endif +typedef struct _FX_ARBFORMTABLE { + FX_WCHAR wIsolated; + FX_WCHAR wFinal; + FX_WCHAR wInitial; + FX_WCHAR wMedial; +} FX_ARBFORMTABLE, * FX_LPARBFORMTABLE; +typedef FX_ARBFORMTABLE const * FX_LPCARBFORMTABLE; +typedef struct _FX_ARAALEF { + FX_WCHAR wAlef; + FX_WCHAR wIsolated; +} FX_ARAALEF, * FX_LPARAALEF; +typedef FX_ARAALEF const * FX_LPCARAALEF; +typedef struct _FX_ARASHADDA { + FX_WCHAR wShadda; + FX_WCHAR wIsolated; +} FX_ARASHADDA, * FX_LPARASHADDA; +typedef FX_ARASHADDA const * FX_LPCARASHADDA; +FX_LPCARBFORMTABLE FX_GetArabicFormTable(FX_WCHAR unicode); +FX_WCHAR FX_GetArabicFromAlefTable(FX_WCHAR alef); +FX_WCHAR FX_GetArabicFromShaddaTable(FX_WCHAR shadda); +#ifdef __cplusplus +}; +#endif +enum FX_ARBPOSITION { + FX_ARBPOSITION_Isolated = 0, + FX_ARBPOSITION_Final, + FX_ARBPOSITION_Initial, + FX_ARBPOSITION_Medial, +}; +class IFX_ArabicChar +{ +public: + static IFX_ArabicChar* Create(); + virtual void Release() = 0; + virtual FX_BOOL IsArabicChar(FX_WCHAR wch) const = 0; + virtual FX_BOOL IsArabicFormChar(FX_WCHAR wch) const = 0; + virtual FX_WCHAR GetFormChar(FX_WCHAR wch, FX_WCHAR prev = 0, FX_WCHAR next = 0) const = 0; + virtual FX_WCHAR GetFormChar(const CFX_Char *cur, const CFX_Char *prev, const CFX_Char *next) const = 0; +}; +void FX_BidiLine(CFX_WideString &wsText, FX_INT32 iBaseLevel = 0); +void FX_BidiLine(CFX_TxtCharArray &chars, FX_INT32 iCount, FX_INT32 iBaseLevel = 0); +void FX_BidiLine(CFX_RTFCharArray &chars, FX_INT32 iCount, FX_INT32 iBaseLevel = 0); class IFX_BidiChar { public: diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h index 22ba611a77..0c84f540e9 100644 --- a/core/include/fxcrt/fx_basic.h +++ b/core/include/fxcrt/fx_basic.h @@ -1578,6 +1578,13 @@ typedef enum { } FX_ProgressiveStatus; #define ProgressiveStatus FX_ProgressiveStatus #define FX_NAMESPACE_DECLARE(namespace, type) namespace::type +class IFX_Unknown +{ +public: + virtual FX_DWORD Release() = 0; + virtual FX_DWORD AddRef() = 0; +}; +#define FX_IsOdd(a) ((a) & 1) class CFX_Vector_3by1 : public CFX_Object { diff --git a/core/include/fxcrt/fx_ext.h b/core/include/fxcrt/fx_ext.h index 03ec488135..ceba015b59 100644 --- a/core/include/fxcrt/fx_ext.h +++ b/core/include/fxcrt/fx_ext.h @@ -76,6 +76,24 @@ void FX_Random_GenerateCrypto(FX_LPDWORD pBuffer, FX_INT32 iCount); #ifdef __cplusplus } #endif +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct FX_GUID { + FX_DWORD data1; + FX_WORD data2; + FX_WORD data3; + FX_BYTE data4[8]; +} FX_GUID, * FX_LPGUID; +typedef FX_GUID const * FX_LPCGUID; + +void FX_GUID_CreateV4(FX_LPGUID pGUID); + +void FX_GUID_ToString(FX_LPCGUID pGUID, CFX_ByteString &bsStr, FX_BOOL bSeparator = TRUE); +#ifdef __cplusplus +} +#endif template<class baseType> class CFX_SSortTemplate { diff --git a/core/include/fxcrt/fx_stream.h b/core/include/fxcrt/fx_stream.h index 8e298f7727..0a3d1c4609 100644 --- a/core/include/fxcrt/fx_stream.h +++ b/core/include/fxcrt/fx_stream.h @@ -162,6 +162,15 @@ public: }; IFX_FileStream* FX_CreateFileStream(FX_LPCSTR filename, FX_DWORD dwModes); IFX_FileStream* FX_CreateFileStream(FX_LPCWSTR filename, FX_DWORD dwModes); +class IFX_FileAccess +{ +public: + virtual void Release() = 0; + virtual IFX_FileAccess* Retain() = 0; + virtual void GetPath(CFX_WideString& wsPath) = 0; + virtual IFX_FileStream* CreateFileStream(FX_DWORD dwModes) = 0; +}; +IFX_FileAccess* FX_CreateDefaultFileAccess(FX_WSTR wsPath); class IFX_MemoryStream : public IFX_FileStream { public: diff --git a/core/include/fxcrt/fx_ucd.h b/core/include/fxcrt/fx_ucd.h index 9e1862aa80..c87e459aa5 100644 --- a/core/include/fxcrt/fx_ucd.h +++ b/core/include/fxcrt/fx_ucd.h @@ -88,6 +88,20 @@ enum FX_CHARTYPE { FX_CHARTYPE_ArabicForm = (11 << FX_CHARTYPEBITS), FX_CHARTYPE_Arabic = (12 << FX_CHARTYPEBITS), }; +typedef struct _FX_CHARPROPERTIES {
+ union FX_CHARPROPERTIES_UNION{
+ struct FX_CHARPROPERTIES_BIT{
+ FX_DWORD dwBreakType : 6;
+ FX_DWORD dwBidiClass : 5;
+ FX_DWORD dwCharType : 4;
+ FX_DWORD dwRotation : 1;
+ FX_DWORD dwCJKSpecial : 1;
+ FX_DWORD dwVertIndex : 6;
+ FX_DWORD dwBidiIndex : 9;
+ };
+ FX_DWORD dwCharProps;
+ };
+} FX_CHARPROPERTIES;
FX_DWORD FX_GetUnicodeProperties(FX_WCHAR wch); FX_BOOL FX_IsCtrlCode(FX_WCHAR ch); FX_BOOL FX_IsRotationCode(FX_WCHAR ch); @@ -95,4 +109,89 @@ FX_BOOL FX_IsCombinationChar(FX_WCHAR wch); FX_BOOL FX_IsBidiChar(FX_WCHAR wch); FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, FX_BOOL bRTL, FX_BOOL bVertical); FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, FX_DWORD dwProps, FX_BOOL bRTL, FX_BOOL bVertical); +class CFX_Char : public CFX_Object
+{
+public:
+ CFX_Char() : m_wCharCode(0)
+ , m_nBreakType(0)
+ , m_nRotation(0)
+ , m_dwCharProps(0)
+ , m_dwCharStyles(0)
+ , m_iCharWidth(0)
+ , m_iHorizontalScale(100)
+ , m_iVertialScale(100)
+ {
+ }
+ CFX_Char(FX_WORD wCharCode, FX_DWORD dwCharProps)
+ : m_wCharCode(wCharCode)
+ , m_nBreakType(0)
+ , m_nRotation(0)
+ , m_dwCharProps(dwCharProps)
+ , m_dwCharStyles(0)
+ , m_iCharWidth(0)
+ , m_iHorizontalScale(100)
+ , m_iVertialScale(100)
+ {
+ }
+ FX_DWORD GetCharType() const
+ {
+ return m_dwCharProps & FX_CHARTYPEBITSMASK;
+ }
+ FX_WORD m_wCharCode;
+ FX_BYTE m_nBreakType;
+ FX_INT8 m_nRotation;
+ FX_DWORD m_dwCharProps;
+ FX_DWORD m_dwCharStyles;
+ FX_INT32 m_iCharWidth;
+ FX_INT32 m_iHorizontalScale;
+ FX_INT32 m_iVertialScale;
+};
+typedef CFX_ArrayTemplate<CFX_Char> CFX_CharArray;
+class CFX_TxtChar : public CFX_Char
+{
+public:
+ CFX_TxtChar() : CFX_Char()
+ , m_dwStatus(0)
+ , m_iBidiClass(0)
+ , m_iBidiLevel(0)
+ , m_iBidiPos(0)
+ , m_iBidiOrder(0)
+ , m_pUserData(NULL)
+ {
+ }
+ FX_DWORD m_dwStatus;
+ FX_INT16 m_iBidiClass;
+ FX_INT16 m_iBidiLevel;
+ FX_INT16 m_iBidiPos;
+ FX_INT16 m_iBidiOrder;
+ FX_LPVOID m_pUserData;
+};
+typedef CFX_ArrayTemplate<CFX_TxtChar> CFX_TxtCharArray;
+class CFX_RTFChar : public CFX_Char
+{
+public:
+ CFX_RTFChar() : CFX_Char()
+ , m_dwStatus(0)
+ , m_iFontSize(0)
+ , m_iFontHeight(0)
+ , m_iBidiClass(0)
+ , m_iBidiLevel(0)
+ , m_iBidiPos(0)
+ , m_dwLayoutStyles(0)
+ , m_dwIdentity(0)
+ , m_pUserData(NULL)
+ {
+ }
+ FX_DWORD m_dwStatus;
+ FX_INT32 m_iFontSize;
+ FX_INT32 m_iFontHeight;
+ FX_INT16 m_iBidiClass;
+ FX_INT16 m_iBidiLevel;
+ FX_INT16 m_iBidiPos;
+ FX_INT16 m_iBidiOrder;
+ FX_DWORD m_dwLayoutStyles;
+ FX_DWORD m_dwIdentity;
+ IFX_Unknown *m_pUserData;
+};
+typedef CFX_ArrayTemplate<CFX_RTFChar> CFX_RTFCharArray;
#endif diff --git a/core/include/fxge/fx_font.h b/core/include/fxge/fx_font.h index 52f8f30d8d..8744919cf8 100644 --- a/core/include/fxge/fx_font.h +++ b/core/include/fxge/fx_font.h @@ -29,6 +29,7 @@ class CFontFileFaceInfo; #define FXFONT_ITALIC 0x40 #define FXFONT_BOLD 0x40000 #define FXFONT_USEEXTERNATTR 0x80000 +#define FXFONT_EXACTMATCH 0x80000000
#define FXFONT_CIDFONT 0x100000 #define FXFONT_ANSI_CHARSET 0 #define FXFONT_DEFAULT_CHARSET 1 @@ -61,7 +62,10 @@ public: FX_BOOL LoadEmbedded(FX_LPCBYTE data, FX_DWORD size); - FX_BOOL LoadFile(IFX_FileRead* pFile); + FX_BOOL LoadFile(IFX_FileRead* pFile, int nFaceIndex = 0, int* pFaceCount = NULL);
+
+ FX_BOOL LoadClone(const CFX_Font* pFont);
+
FXFT_Face GetFace() const { @@ -141,6 +145,7 @@ protected: FX_BOOL m_bEmbedded; FX_BOOL m_bVertical; + FX_BOOL m_bLogic;
void* m_pOwnedStream; }; #define ENCODING_INTERNAL 0 @@ -157,6 +162,32 @@ public: virtual FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const = 0; }; IFX_FontEncoding* FXGE_CreateUnicodeEncoding(CFX_Font* pFont); +#define FXFM_ENC_TAG(a, b, c, d) (((FX_DWORD)(a) << 24) | ((FX_DWORD)(b) << 16) | ((FX_DWORD)(c) << 8) | (FX_DWORD)(d))
+#define FXFM_ENCODING_NONE FXFM_ENC_TAG(0, 0, 0, 0)
+#define FXFM_ENCODING_MS_SYMBOL FXFM_ENC_TAG('s', 'y', 'm', 'b')
+#define FXFM_ENCODING_UNICODE FXFM_ENC_TAG('u', 'n', 'i', 'c')
+#define FXFM_ENCODING_MS_SJIS FXFM_ENC_TAG('s', 'j', 'i', 's')
+#define FXFM_ENCODING_MS_GB2312 FXFM_ENC_TAG('g', 'b', ' ', ' ')
+#define FXFM_ENCODING_MS_BIG5 FXFM_ENC_TAG('b', 'i', 'g', '5')
+#define FXFM_ENCODING_MS_WANSUNG FXFM_ENC_TAG('w', 'a', 'n', 's')
+#define FXFM_ENCODING_MS_JOHAB FXFM_ENC_TAG('j', 'o', 'h', 'a')
+#define FXFM_ENCODING_ADOBE_STANDARD FXFM_ENC_TAG('A', 'D', 'O', 'B')
+#define FXFM_ENCODING_ADOBE_EXPERT FXFM_ENC_TAG('A', 'D', 'B', 'E')
+#define FXFM_ENCODING_ADOBE_CUSTOM FXFM_ENC_TAG('A', 'D', 'B', 'C')
+#define FXFM_ENCODING_ADOBE_LATIN_1 FXFM_ENC_TAG('l', 'a', 't', '1')
+#define FXFM_ENCODING_OLD_LATIN_2 FXFM_ENC_TAG('l', 'a', 't', '2')
+#define FXFM_ENCODING_APPLE_ROMAN FXFM_ENC_TAG('a', 'r', 'm', 'n')
+class IFX_FontEncodingEx : public IFX_FontEncoding
+{
+public:
+
+ virtual FX_DWORD GlyphIndexFromName(FX_LPCSTR pStrName) = 0;
+
+ virtual CFX_ByteString NameFromGlyphIndex(FX_DWORD dwGlyphIndex) = 0;
+
+ virtual FX_DWORD CharCodeFromGlyphIndex(FX_DWORD dwGlyphIndex) = 0;
+};
+IFX_FontEncodingEx* FX_CreateFontEncodingEx(CFX_Font* pFont, FX_DWORD nEncodingID = FXFM_ENCODING_NONE);
#define FXFONT_SUBST_MM 0x01 #define FXFONT_SUBST_GLYPHPATH 0x04 #define FXFONT_SUBST_CLEARTYPE 0x08 @@ -277,6 +308,7 @@ public: } virtual FXFT_Face FindSubstFont(const CFX_ByteString& face_name, FX_BOOL bTrueType, FX_DWORD flags, int weight, int italic_angle, int CharsetCP, CFX_SubstFont* pSubstFont); + FXFT_Face FindSubstFontByUnicode(FX_DWORD dwUnicode, FX_DWORD flags, int weight, int italic_angle);
private: CFX_ByteString GetPSNameFromTT(void* hFont); CFX_ByteString MatchInstalledFonts(const CFX_ByteString& norm_name); @@ -298,6 +330,10 @@ public: virtual void Release() = 0; virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper) = 0; virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR face, FX_BOOL& bExact) = 0; + virtual void* MapFontByUnicode(FX_DWORD dwUnicode, int weight, FX_BOOL bItalic, int pitch_family)
+ {
+ return NULL;
+ }
virtual void* GetFont(FX_LPCSTR face) = 0; virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, FX_LPBYTE buffer, FX_DWORD size) = 0; virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name) = 0; @@ -321,6 +357,7 @@ public: virtual void Release(); virtual FX_BOOL EnumFontList(CFX_FontMapper* pMapper); virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR face, FX_BOOL& bExact); + virtual void* MapFontByUnicode(FX_DWORD dwUnicode, int weight, FX_BOOL bItalic, int pitch_family);
virtual void* GetFont(FX_LPCSTR face); virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, FX_LPBYTE buffer, FX_DWORD size); virtual void DeleteFont(void* hFont); |