NOT PART OF BUILD - PHOTON ONLY

Simple for the Photon font name


git-svn-id: svn://10.0.0.236/trunk@72773 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
Jerry.Kirk%Nexwarecorp.com
2000-06-21 14:26:25 +00:00
parent 05541b0c69
commit 109c165e9a
4 changed files with 15 additions and 14 deletions

View File

@@ -436,7 +436,7 @@ NS_IMETHODIMP nsDeviceContextPh :: CheckFontExistence(const nsString& aFontName)
if( fontName )
{
int MAX_FONTDETAIL = 30;
int MAX_FONTDETAIL = 90;
FontDetails fDetails[MAX_FONTDETAIL];
int fontcount;

View File

@@ -141,7 +141,7 @@ nsFontMetricsPh :: Init ( const nsFont& aFont, nsIAtom* aLangGroup,
char NSFontName[64]; /* Local buffer to keep the fontname in */
char NSFontSuffix[5];
char NSFullFontName[64];
char NSFullFontName[MAX_FONT_TAG];
NSFontSuffix[0] = nsnull;
@@ -181,7 +181,8 @@ nsFontMetricsPh :: Init ( const nsFont& aFont, nsIAtom* aLangGroup,
float f;
mDeviceContext->GetDevUnitsToAppUnits(f);
PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsFontMetricsPh::Init with nsFont: Internal Name <%s> f=<%f>\n",fontInfo.font, f));
mFontHandle = nsString( (const PRUnichar *) NSFullFontName, strlen(NSFullFontName));
//mFontHandle = nsString( (const PRUnichar *) NSFullFontName, strlen(NSFullFontName));
mFontHandle = strdup(NSFullFontName); /* memory leak */
/* These are in pixels and need to be converted! */
float height;
@@ -317,6 +318,7 @@ NS_IMETHODIMP
nsFontMetricsPh ::GetNormalLineHeight(nscoord &aHeight)
{
aHeight = mEmHeight + mLeading;
PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsFontMetricsPh::GetNormalLineHeight aHeight=<%d>\n", aHeight));
return NS_OK;
}
@@ -379,7 +381,7 @@ nsFontMetricsPh :: GetMaxAdvance(nscoord &aAdvance)
NS_IMETHODIMP
nsFontMetricsPh :: GetFont(const nsFont *&aFont)
{
// PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsFontMetricsPh::GetFont\n"));
PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsFontMetricsPh::GetFont\n"));
aFont = mFont;
return NS_OK;
}
@@ -401,9 +403,8 @@ NS_IMETHODIMP nsFontMetricsPh::GetLangGroup(nsIAtom** aLangGroup)
NS_IMETHODIMP
nsFontMetricsPh::GetFontHandle(nsFontHandle &aHandle)
{
// PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsFontMetricsPh::GetFontHandle\n"));
aHandle = (nsFontHandle) &mFontHandle;
PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsFontMetricsPh::GetFontHandle mFontHandle=<%s>\n", mFontHandle));
aHandle = (nsFontHandle) mFontHandle;
return NS_OK;
}

View File

@@ -77,7 +77,7 @@ protected:
nsDeviceContextPh *mDeviceContext;
nsFont *mFont;
nsString mFontHandle; /* Photon Fonts are just a string */
char *mFontHandle; /* Photon Fonts are just a string */
nscoord mHeight;
nscoord mAscent;
nscoord mDescent;

View File

@@ -782,7 +782,7 @@ NS_IMETHODIMP nsRenderingContextPh :: SetFont(nsIFontMetrics *aFontMetrics)
//PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsRenderingContextPh::SetFont with nsIFontMetrics mFontMetrics=<%p> aFontMetrics=<%p>\n", mFontMetrics, aFontMetrics));
nsFontHandle fontHandle; /* really a nsString */
nsString *pFontHandle;
char *pFontHandle;
NS_IF_RELEASE(mFontMetrics);
mFontMetrics = aFontMetrics;
@@ -792,20 +792,20 @@ NS_IMETHODIMP nsRenderingContextPh :: SetFont(nsIFontMetrics *aFontMetrics)
return NS_OK;
mFontMetrics->GetFontHandle(fontHandle);
pFontHandle = (nsString *) fontHandle;
pFontHandle = (char *) fontHandle;
if (pFontHandle)
{
if( mPhotonFontName )
delete [] mPhotonFontName;
free(mPhotonFontName);
mPhotonFontName = pFontHandle->ToNewCString();
mPhotonFontName = strdup(pFontHandle);
if (mPhotonFontName)
{
{
/* Cache the Font metrics locally, costs ~1400 bytes per font */
PfLoadMetrics( mPhotonFontName );
PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsRenderingContextPh::SetFont with nsIFontMetrics Photon Font Name is <%s>\n", mPhotonFontName));
PR_LOG(PhGfxLog, PR_LOG_DEBUG, ("nsRenderingContextPh::SetFont with nsIFontMetrics Photon Font Name is <%s> <%s>\n", mPhotonFontName, pFontHandle));
PgSetFont( mPhotonFontName );
}