backing out the changes since there were problems

This commit is contained in:
erik%netscape.com 2000-05-16 00:12:42 +00:00
parent b94f989867
commit fe2c719733
2 changed files with 1201 additions and 1508 deletions

File diff suppressed because it is too large Load Diff

View File

@ -33,26 +33,27 @@
#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
#define FONT_HAS_GLYPH(map, char) IS_REPRESENTABLE(map, char)
#endif
#define FONT_HAS_GLYPH(map, g) (((map)[(g) >> 3] >> ((g) & 7)) & 1)
typedef struct nsFontCharSetInfo nsFontCharSetInfo;
typedef gint (*nsFontCharSetConverter)(nsFontCharSetInfo* aSelf,
XFontStruct* aFont, const PRUnichar* aSrcBuf, PRInt32 aSrcLen,
char* aDestBuf, PRInt32 aDestLen);
const PRUnichar* aSrcBuf, PRInt32 aSrcLen, char* aDestBuf,
PRInt32 aDestLen);
struct nsFontCharSet;
struct nsFontFamily;
struct nsFontNode;
struct nsFontStretch;
class nsFontGTKUserDefined;
class nsFontMetricsGTK;
class nsFontGTK
@ -62,11 +63,7 @@ public:
virtual ~nsFontGTK();
NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
void LoadFont(void);
inline int SupportsChar(PRUnichar aChar)
{ return mFont && FONT_HAS_GLYPH(mMap, aChar); };
void LoadFont(nsFontCharSet* aCharSet, nsFontMetricsGTK* aMetrics);
virtual gint GetWidth(const PRUnichar* aString, PRUint32 aLength) = 0;
virtual gint DrawString(nsRenderingContextGTK* aContext,
nsDrawingSurfaceGTK* aSurface, nscoord aX,
@ -86,11 +83,15 @@ 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:
@ -128,41 +129,32 @@ public:
virtual nsresult GetSpaceWidth(nscoord &aSpaceWidth);
nsFontGTK* FindFont(PRUnichar aChar);
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);
void FindGenericFont(nsFontSearch* aSearch);
void FindSubstituteFont(nsFontSearch* aSearch);
static void InitFonts(void);
static nsresult FamilyExists(const nsString& aFontName);
//friend struct nsFontGTK;
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;
nsFontGTK **mLoadedFonts;
PRUint16 mLoadedFontsAlloc;
PRUint16 mLoadedFontsCount;
int mInFindSubstituteFont;
nsFontGTK *mSubstituteFont;
nsCStringArray mFonts;
PRUint16 mFontsIndex;
nsVoidArray mFontIsGeneric;
nsString *mFonts;
PRUint16 mFontsAlloc;
PRUint16 mFontsCount;
PRUint16 mFontsIndex;
nsCAutoString mDefaultFont;
nsCString *mGeneric;
nsString *mGeneric;
int mTriedAllGenerics;
nsCOMPtr<nsIAtom> mLangGroup;
nsCAutoString mUserDefined;
PRUint8 mTriedAllGenerics;
PRUint8 mIsUserDefined;
protected:
void RealizeFont();