зеркало из https://github.com/mozilla/pjs.git
checking in the previous changes again, this time with 3 more bugs fixed
This commit is contained in:
Родитель
9304d48c94
Коммит
e5e0bae699
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -33,27 +33,26 @@
|
|||
#include "nsCRT.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsRenderingContextGTK.h"
|
||||
#include "nsICharRepresentable.h"
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include <gdk/gdkx.h>
|
||||
|
||||
#ifdef ADD_GLYPH
|
||||
#undef ADD_GLYPH
|
||||
#endif
|
||||
#define ADD_GLYPH(map, g) (map)[(g) >> 3] |= (1 << ((g) & 7))
|
||||
|
||||
#ifdef FONT_HAS_GLYPH
|
||||
#undef FONT_HAS_GLYPH
|
||||
#endif
|
||||
#define FONT_HAS_GLYPH(map, g) (((map)[(g) >> 3] >> ((g) & 7)) & 1)
|
||||
#define FONT_HAS_GLYPH(map, char) IS_REPRESENTABLE(map, char)
|
||||
|
||||
typedef struct nsFontCharSetInfo nsFontCharSetInfo;
|
||||
|
||||
typedef gint (*nsFontCharSetConverter)(nsFontCharSetInfo* aSelf,
|
||||
const PRUnichar* aSrcBuf, PRInt32 aSrcLen, char* aDestBuf,
|
||||
PRInt32 aDestLen);
|
||||
XFontStruct* aFont, const PRUnichar* aSrcBuf, PRInt32 aSrcLen,
|
||||
char* aDestBuf, PRInt32 aDestLen);
|
||||
|
||||
struct nsFontCharSet;
|
||||
struct nsFontFamily;
|
||||
struct nsFontNode;
|
||||
struct nsFontStretch;
|
||||
|
||||
class nsFontGTKUserDefined;
|
||||
class nsFontMetricsGTK;
|
||||
|
||||
class nsFontGTK
|
||||
|
@ -63,7 +62,11 @@ public:
|
|||
virtual ~nsFontGTK();
|
||||
NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
|
||||
|
||||
void LoadFont(nsFontCharSet* aCharSet, nsFontMetricsGTK* aMetrics);
|
||||
void LoadFont(void);
|
||||
|
||||
inline int SupportsChar(PRUnichar aChar)
|
||||
{ return mFont && FONT_HAS_GLYPH(mMap, aChar); };
|
||||
|
||||
virtual gint GetWidth(const PRUnichar* aString, PRUint32 aLength) = 0;
|
||||
virtual gint DrawString(nsRenderingContextGTK* aContext,
|
||||
nsDrawingSurfaceGTK* aSurface, nscoord aX,
|
||||
|
@ -83,15 +86,11 @@ public:
|
|||
PRUint32* mMap;
|
||||
nsFontCharSetInfo* mCharSetInfo;
|
||||
char* mName;
|
||||
nsFontGTKUserDefined* mUserDefinedFont;
|
||||
PRUint16 mSize;
|
||||
PRUint16 mActualSize;
|
||||
PRInt16 mBaselineAdjust;
|
||||
};
|
||||
|
||||
struct nsFontStretch;
|
||||
struct nsFontFamily;
|
||||
typedef struct nsFontSearch nsFontSearch;
|
||||
|
||||
class nsFontMetricsGTK : public nsIFontMetrics
|
||||
{
|
||||
public:
|
||||
|
@ -129,32 +128,41 @@ public:
|
|||
virtual nsresult GetSpaceWidth(nscoord &aSpaceWidth);
|
||||
|
||||
nsFontGTK* FindFont(PRUnichar aChar);
|
||||
void FindGenericFont(nsFontSearch* aSearch);
|
||||
void FindSubstituteFont(nsFontSearch* aSearch);
|
||||
static void InitFonts(void);
|
||||
nsFontGTK* FindUserDefinedFont(PRUnichar aChar);
|
||||
nsFontGTK* FindLocalFont(PRUnichar aChar);
|
||||
nsFontGTK* FindGenericFont(PRUnichar aChar);
|
||||
nsFontGTK* FindGlobalFont(PRUnichar aChar);
|
||||
nsFontGTK* FindSubstituteFont(PRUnichar aChar);
|
||||
|
||||
nsFontGTK* SearchNode(nsFontNode* aNode, PRUnichar aChar);
|
||||
nsFontGTK* TryAliases(nsCString* aName, PRUnichar aChar);
|
||||
nsFontGTK* TryFamily(nsCString* aName, PRUnichar aChar);
|
||||
nsFontGTK* TryNode(nsCString* aName, PRUnichar aChar);
|
||||
|
||||
nsFontGTK* PickASizeAndLoad(nsFontStretch* aStretch,
|
||||
nsFontCharSetInfo* aCharSet, PRUnichar aChar);
|
||||
|
||||
static nsresult FamilyExists(const nsString& aFontName);
|
||||
|
||||
friend void PickASizeAndLoad(nsFontSearch* aSearch, nsFontStretch* aStretch,
|
||||
nsFontCharSet* aCharSet);
|
||||
friend void TryCharSet(nsFontSearch* aSearch, nsFontCharSet* aCharSet);
|
||||
friend void TryFamily(nsFontSearch* aSearch, nsFontFamily* aFamily);
|
||||
friend struct nsFontGTK;
|
||||
//friend struct nsFontGTK;
|
||||
|
||||
nsFontGTK **mLoadedFonts;
|
||||
PRUint16 mLoadedFontsAlloc;
|
||||
PRUint16 mLoadedFontsCount;
|
||||
|
||||
int mInFindSubstituteFont;
|
||||
nsFontGTK *mSubstituteFont;
|
||||
|
||||
nsString *mFonts;
|
||||
PRUint16 mFontsAlloc;
|
||||
PRUint16 mFontsCount;
|
||||
PRUint16 mFontsIndex;
|
||||
nsCStringArray mFonts;
|
||||
PRUint16 mFontsIndex;
|
||||
nsVoidArray mFontIsGeneric;
|
||||
|
||||
nsString *mGeneric;
|
||||
int mTriedAllGenerics;
|
||||
nsCAutoString mDefaultFont;
|
||||
nsCString *mGeneric;
|
||||
nsCOMPtr<nsIAtom> mLangGroup;
|
||||
nsCAutoString mUserDefined;
|
||||
|
||||
PRUint8 mTriedAllGenerics;
|
||||
PRUint8 mIsUserDefined;
|
||||
|
||||
protected:
|
||||
void RealizeFont();
|
||||
|
|
Загрузка…
Ссылка в новой задаче