[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : phil
Repository : xara
Revision   : 750
Date       : Fri Mar 31 13:53:14 BST 2006

Changed paths:
   M /Trunk/XaraLX/Kernel/fontcomp.cpp
   M /Trunk/XaraLX/Kernel/main.cpp
   M /Trunk/XaraLX/Kernel/main3.cpp
   M /Trunk/XaraLX/Kernel/nodetext.cpp
   M /Trunk/XaraLX/Kernel/nodetxtl.cpp
   M /Trunk/XaraLX/Kernel/nodetxtl.h
   M /Trunk/XaraLX/Kernel/nodetxts.cpp
   M /Trunk/XaraLX/Kernel/rndrgn.cpp
   M /Trunk/XaraLX/wxOil/fontbase.cpp

Martin W's patches 10 and 12 for font rendering.


Diff:
Index: Trunk/XaraLX/Kernel/fontcomp.cpp
===================================================================
--- Trunk/XaraLX/Kernel/fontcomp.cpp	(revision 749)
+++ Trunk/XaraLX/Kernel/fontcomp.cpp	(revision 750)
@@ -1061,8 +1061,8 @@
 
 	if (ok) ok = pRec->ReadCCPanose( &(pItem->mPanoseNumber) );
 
-	PORTNOTETRACE("text","FontComponent::ReadFontTrueType - removed ImportCacheFont call");
-#ifndef EXCLUDE_FROM_XARALX
+	PORTNOTE("text","FontComponent::ReadFontTrueType - removed ImportCacheFont call");
+#ifndef DISABLE_TEXT_RENDERING
 	if (ok) ok = ImportCacheFont(pItem);	// do all our clever matching
 
 	if (ok) pFontList->AddTail(pItem);
@@ -1094,8 +1094,8 @@
 
 	if (ok) ok = pRec->ReadCCPanose( &(pItem->mPanoseNumber) );
 
-	PORTNOTETRACE("text","FontComponent::ReadFontATM - removed ImportCacheFont call");
-#ifndef EXCLUDE_FROM_XARALX
+	PORTNOTE("text","FontComponent::ReadFontATM - removed ImportCacheFont call");
+#ifndef DISABLE_TEXT_RENDERING
 	if (ok) ok = ImportCacheFont(pItem);	// do all our clever matching
 
 	if (ok) pFontList->AddTail(pItem);
@@ -1499,8 +1499,8 @@
 		// the font has been deinstalled during this session of Camelot. So
 		// we find a replacement font now...
 
-		PORTNOTETRACE("text","FontComponent::ImportCacheFont - Removed FindClosestFont usage");
-#ifndef EXCLUDE_FROM_XARALX
+		PORTNOTE("text","FontComponent::ImportCacheFont - Removed FindClosestFont usage");
+#ifndef DISABLE_TEXT_RENDERING
 		CachedFontItem *pCachedFontItem = pFontManager->GetFont(FontHandle);
 
 		WORD BestFontHandle = pFontManager->FindClosestFont(pItem->mPanoseNumber);
@@ -1516,8 +1516,8 @@
 
 	if (FontHandle==ILLEGALFHANDLE)
 	{
-#ifndef EXCLUDE_FROM_XARALX
-		PORTNOTETRACE("text","FontComponent::ImportCacheFont - Removed FindClosestFont usage");
+		PORTNOTE("text","FontComponent::ImportCacheFont - Removed FindClosestFont usage");
+#ifndef DISABLE_TEXT_RENDERING
 
 			// Failed again, so we try to find the closest font using PANOSE font matching.
 		WORD BestFontHandle = pFontManager->FindClosestFont(pItem->mPanoseNumber);
@@ -1537,7 +1537,7 @@
 	
 	if (FontHandle==ILLEGALFHANDLE)
 	{
-		// something has gone wrong. camplain, and fix the error
+		// something has gone wrong. complain, and fix the error
 		ERROR2(FALSE, "Unable to find a font!.");
 		FontHandle = DEFAULTHANDLE;
 	}
Index: Trunk/XaraLX/Kernel/nodetxtl.cpp
===================================================================
--- Trunk/XaraLX/Kernel/nodetxtl.cpp	(revision 749)
+++ Trunk/XaraLX/Kernel/nodetxtl.cpp	(revision 750)
@@ -708,12 +708,9 @@
 
 BOOL TextLine::ReCacheMetrics(FormatRegion* pFormatRegion)
 {
-	PORTNOTETRACE("text","TextLine::ReCacheMetrics - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
 	SetJustification( pFormatRegion->GetJustification());
 	SetLineSpacing(   pFormatRegion->GetLineSpacing());
 	SetLineSpaceRatio(pFormatRegion->GetLineSpaceRatio());
-#endif
 	return TRUE;
 }
 
@@ -1705,8 +1702,6 @@
 /////////////////////////////////////////////////////////////////////////////////////////////
 // FormatRegion
 
-PORTNOTE("text","Removed FormatRegion impl.")
-#ifndef EXCLUDE_FROM_XARALX
 
 /********************************************************************************************
 >	FormatRegion::FormatRegion()
@@ -1776,7 +1771,7 @@
 	StartRender();
 
 	// Get the attributes
-	if (FirstNode==NULL)
+	if (pFirstNode==NULL)
 		return TRUE;
 
 	CCAttrMap		   *pAttribMap = new CCAttrMap(30);
@@ -1866,5 +1861,3 @@
 
 	return kern;
 }
-
-#endif
Index: Trunk/XaraLX/Kernel/rndrgn.cpp
===================================================================
--- Trunk/XaraLX/Kernel/rndrgn.cpp	(revision 749)
+++ Trunk/XaraLX/Kernel/rndrgn.cpp	(revision 750)
@@ -5905,8 +5905,6 @@
 
 BOOL RenderRegion::GetAttrdCharBounds(DocRect* pBounds, WCHAR ch)
 {
-	PORTNOTETRACE("text","RenderRegion::GetAttrdCharBounds - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
 	ERROR2IF(pBounds==NULL,FALSE,"RenderRegion::GetAttrdCharBounds() - pBounds==NULL");
 
 	// get defualt bounds from cache
@@ -5924,9 +5922,6 @@
 		pBounds->MakeEmpty();
 
 	return ok;
-#else
-	return FALSE;
-#endif
 }
 
 
@@ -5945,8 +5940,6 @@
 
 Path* RenderRegion::CreateCharPath(WCHAR ch, Matrix* pMatrix)
 {
-	PORTNOTETRACE("text","RenderRegion::CreateCharPath - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
 	// get overall matrix - attribute matrix concatenated with given matrix if supplied
 	Matrix matrix;
 	if (GetCharAttributeMatrix(&matrix)==FALSE)
@@ -5974,9 +5967,6 @@
 	}
 
 	return pPath;
-#else
-	return NULL;
-#endif
 }
 
 
@@ -6688,7 +6678,7 @@
 										   256, *Palette, Fill->GetProfile());
 		return;
 	}
-
+PORTNOTE("other", "RenderRegion: no colour correction for paletted bitmaps");
 #if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
 	// --- If it's a paletted bitmap, then we just colour-correct the palette
 	if (Info->bmiHeader.biBitCount <= 8)
Index: Trunk/XaraLX/Kernel/nodetxts.cpp
===================================================================
--- Trunk/XaraLX/Kernel/nodetxts.cpp	(revision 749)
+++ Trunk/XaraLX/Kernel/nodetxts.cpp	(revision 750)
@@ -286,8 +286,8 @@
 
 BOOL BaseTextClass::ReCacheNodeAndDescendantsMetrics(FormatRegion* pFormatRegion)
 {
-	PORTNOTETRACE("text","BaseTextClass::ReCacheNodeAndDescendantsMetrics - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
+       PORTNOTE("text","BaseTextClass::ReCacheNodeAndDescendantsMetrics - do nothing");
+#ifndef DISABLE_TEXT_RENDERING
 	BOOL ok=TRUE;
 	if (NodeOrDescendantModifiedByOp())
 	{
@@ -313,7 +313,7 @@
 
 	return ok;
 #else
-	return false;
+	return FALSE;
 #endif
 }
 
@@ -1986,7 +1986,7 @@
 
 void TextStory::RenderObjectBlobs(RenderRegion* pRenderRegion)
 {
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
 	if (pRenderRegion != NULL)
 	{
    		pRenderRegion->SetLineColour(COLOUR_NONE);
@@ -2011,7 +2011,7 @@
 
 void TextStory::RenderTinyBlobs(RenderRegion* pRenderRegion)
 {
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
 	if (pRenderRegion != NULL)
 	{
    		pRenderRegion->SetLineColour(COLOUR_NONE);
@@ -2057,7 +2057,7 @@
 
 DocCoord TextStory::GetBlobPosAndSize(INT32* pSize)
 {
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
 	// Get the bounds of the text story
 	DocRect StoryBounds=GetBoundingRect();
 
@@ -2687,8 +2687,8 @@
 
 BOOL TextStory::FormatAndChildren(UndoableOperation* pUndoOp, BOOL UseNodeFlags, BOOL WordWrap)
 {
-	PORTNOTETRACE("text","TextStory::FormatAndChildren - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
+       PORTNOTE("text","TextStory::FormatAndChildren - do nothing");
+#ifndef DISABLE_TEXT_RENDERING
 	// if whole story is affected, just flag all children as 'ModifiedByOp'
 	if (UseNodeFlags==FALSE)
 		FlagNodeAndDescendantsModifiedByOpAndParentsHaveDescendantModifiedByOp();
Index: Trunk/XaraLX/Kernel/main3.cpp
===================================================================
--- Trunk/XaraLX/Kernel/main3.cpp	(revision 749)
+++ Trunk/XaraLX/Kernel/main3.cpp	(revision 750)
@@ -287,8 +287,12 @@
 
 			AttrFillGeometry::Init() &&			// Initialise the fill editing operations
 			EPSFilter::InitPrefs() &&			// Initialise default font mappings and
-												// EPS export prefs		
+												// EPS export prefs
+#endif
+#ifndef DISABLE_TEXT_RENDERING
 			FontCache::Init() &&
+#endif
+#ifndef EXCLUDE_FROM_XARALX
 			TunedMemory::Init()	&&				// declare prefs for the memory manager
 
 			OILRuler::Init() &&					// set the ruler widths depending on .ini font settings
Index: Trunk/XaraLX/Kernel/nodetext.cpp
===================================================================
--- Trunk/XaraLX/Kernel/nodetext.cpp	(revision 749)
+++ Trunk/XaraLX/Kernel/nodetext.cpp	(revision 750)
@@ -1561,7 +1561,7 @@
 
 void AbstractTextChar::RenderObjectBlobs(RenderRegion* pRenderRegion)
 {
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
 	Path* pPath=CreateMetricsRectPath();
 	if (pPath!=NULL && pRenderRegion!=NULL)
 	{
@@ -1587,7 +1587,7 @@
 
 void AbstractTextChar::RenderTinyBlobs(RenderRegion* pRenderRegion)
 {
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
 	Path* pPath=CreateMetricsRectPath();
 	if (pPath!=NULL && pRenderRegion!=NULL)
 	{
@@ -1744,8 +1744,8 @@
 
 BOOL AbstractTextChar::ReCacheMetrics(FormatRegion* pFormatRegion)
 {
-	PORTNOTETRACE("text","AbstractTextChar::ReCacheMetrics - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
+	PORTNOTE("text","AbstractTextChar::ReCacheMetrics - do nothing");
+#ifndef DISABLE_TEXT_RENDERING
 	// get metrics for this char with current attribute stack
 	CharMetrics metrics;
 	if (pFormatRegion->GetCharMetrics(&metrics,GetUnicodeValue())==FALSE)
@@ -2004,10 +2004,11 @@
 
 BOOL TextChar::RenderCore(RenderRegion* pRenderRegion)
 {
-	PORTNOTETRACE("text","TextChar::RenderCore - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
+	PORTNOTE("text","TextChar::RenderCore - do nothing");
+#ifndef DISABLE_TEXT_RENDERING
 	ERROR2IF(pRenderRegion == NULL, FALSE, "TextChar::RenderCore() - pRenderRegion == NULL");
 
+	// TRACEUSER("wuerthne", _T("TextChar::RenderCore %04x"), GetUnicodeValue());
 	// If the render region is being used for hit detection then render bounds
 	// BODGE TEXT - should be in the render region RenderChar function
 	if (pRenderRegion->IsHitDetect() &&
@@ -2028,6 +2029,9 @@
 	if (GetStoryAndCharMatrix(&matrix) == FALSE) return FALSE;
 
 	// render the character through the matrix with current attributes in RenderRegion
+
+PORTNOTE("other", "printing and AI export deactivated")
+#ifndef EXCLUDE_FROM_XARALX
 	// If the render region is a printing region then maybe print as shapes.
 	if (pRenderRegion->IsPrinting())
 	{
@@ -2060,6 +2064,7 @@
 			}
 		}
 	}
+#endif
 
 	// Render into the given region region as characters
 	BOOL Result =  pRenderRegion->RenderChar(GetUnicodeValue(), &matrix);
@@ -2087,8 +2092,9 @@
 #endif	// EXPORT_TEXT
 
 	return Result;
+#else
+	return FALSE;
 #endif
-	return false;
 }
 
 
@@ -2103,6 +2109,7 @@
 
 void TextChar::RenderEorDrag(RenderRegion* pRenderRegion)
 {
+PORTNOTE("text", "so far, enabling this crashes when a text object is moved and an EOR display is attempted")
 #if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
 	// Before rendering the character we need to render it's applied *TEXT* attributes
 	// into the render region as EOR drag render regions dosen't maintain an attribute stack
@@ -2132,7 +2139,7 @@
 		pRenderRegion->RestoreContext();
 	}
 
-	delete pAttribMap;
+	if (pAttribMap!=NULL) delete pAttribMap;
 #endif
 }
 
@@ -2196,8 +2203,8 @@
 
 BOOL TextChar::CreateNodePath(NodePath** ppNodePath, FormatRegion* pFormatRegion)
 {
-	PORTNOTETRACE("text","TextChar::CreateNodePath - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
+	PORTNOTE("text","TextChar::CreateNodePath - do nothing");
+#ifndef DISABLE_TEXT_RENDERING
 	ERROR2IF(pFormatRegion==NULL,FALSE,"TextChar::CreateNodePath() - pFormatRegion==NULL");
 	ERROR2IF(   ppNodePath==NULL,FALSE,"TextChar::CreateNodePath() - ppNodePath==NULL");
 
@@ -2256,7 +2263,7 @@
 	BOOL Snapped = FALSE;
 
 	PORTNOTETRACE("text","TextChar::Snap - do nothing");
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
 	MILLIPOINT SnapDist    = CSnap::GetSnapDist();
 	MILLIPOINT SqrSnapDist = SnapDist*SnapDist;
 
@@ -2422,8 +2429,6 @@
 ********************************************************************************************/
 MILLIPOINT TextChar::GetAutoKernSize(FormatRegion* pFormatRegion)
 {
-	PORTNOTETRACE("text","TextChar::GetAutoKernSize - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
 	TextChar* pNextTC = FindNextTextCharInStory();
 
 	if (pNextTC)
@@ -2514,9 +2519,6 @@
 	}
 	else
 		return 0; // No kern
-#else
-	return 0;
-#endif
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////////
@@ -3400,7 +3402,7 @@
 
 void EOLNode::RenderTinyBlobs(RenderRegion* pRenderRegion)
 {
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
 	RenderObjectBlobs(pRenderRegion);
 #endif
 }
@@ -3418,7 +3420,7 @@
 
 BOOL EOLNode::GetBlobPath(Path* pPath)
 {
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
 	ERROR2IF(pPath==NULL, FALSE, "Path pointer was NULL");
 	TextLine* pParentLine = this->FindParentLine();
 	ERROR2IF(pParentLine==NULL, FALSE, "EOLNode didn't have a parent TextLine");
Index: Trunk/XaraLX/Kernel/nodetxtl.h
===================================================================
--- Trunk/XaraLX/Kernel/nodetxtl.h	(revision 749)
+++ Trunk/XaraLX/Kernel/nodetxtl.h	(revision 750)
@@ -129,8 +129,6 @@
 {
 	CC_DECLARE_DYNAMIC(FormatRegion)
 
-PORTNOTE("text","FormatRegion stripped")
-#ifndef EXCLUDE_FROM_XARALX
 	FormatRegion();
 	~FormatRegion();										   
 
@@ -181,7 +179,6 @@
 
 private:
 	std::auto_ptr<wxDC>	m_pFormatDC;
-#endif
 };
 
 
Index: Trunk/XaraLX/Kernel/main.cpp
===================================================================
--- Trunk/XaraLX/Kernel/main.cpp	(revision 749)
+++ Trunk/XaraLX/Kernel/main.cpp	(revision 750)
@@ -352,8 +352,7 @@
 #if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
 	HotKey::Deinit(); 
 #endif
-PORTNOTE("text","Removed FontCache usage")
-#ifndef EXCLUDE_FROM_XARALX
+#ifndef DISABLE_TEXT_RENDERING
 	FontCache::DeInit();
 #endif
 #ifndef EXCLUDE_GALS
Index: Trunk/XaraLX/wxOil/fontbase.cpp
===================================================================
--- Trunk/XaraLX/wxOil/fontbase.cpp	(revision 749)
+++ Trunk/XaraLX/wxOil/fontbase.cpp	(revision 750)
@@ -220,6 +220,8 @@
 			return FALSE;
 #endif
 			break;
+		default:
+			break;
 	}
 	ERROR3("Unknown font class passed to OILFontMan::IsOkToCall()");
 	return FALSE;
@@ -480,6 +482,8 @@
 			return NULL;
 #endif
 			break;
+		default:
+			break;
 	}
 	ERROR3("OILFontMan::CreateNewFont() - Unknown font class");
 	return NULL;
@@ -527,6 +531,8 @@
 			return NULL;
 #endif
 			break;
+		default:
+			break;
 	}
 	ERROR3("OILFontMan::CreateNewFont() - Unknown font class");
 	return NULL;
@@ -827,7 +833,8 @@
 #endif
 			ERROR1IF(Success==FALSE, FALSE, _R(IDE_FONTMAN_NOFTOUTLINE));
 			break;
-
+		default:
+			break;
 	}
 	ERROR3IF(Success==FALSE,"Unknown font class in OILFontMan::GetCharPath");
 	return Success;


Xara