Author: toshok
Date: 2007-10-03 23:22:41 -0400 (Wed, 03 Oct 2007)
New Revision: 86842
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/text.cpp
Log:
2007-10-03 Chris Toshok <[EMAIL PROTECTED]>
* text.cpp: make Glyphs usable even when text=pango. "usable"
means "don't crash" :)
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-10-04 00:04:45 UTC (rev 86841)
+++ trunk/moon/src/ChangeLog 2007-10-04 03:22:41 UTC (rev 86842)
@@ -1,5 +1,10 @@
2007-10-03 Chris Toshok <[EMAIL PROTECTED]>
+ * text.cpp: make Glyphs usable even when text=pango. "usable"
+ means "don't crash" :)
+
+2007-10-03 Chris Toshok <[EMAIL PROTECTED]>
+
* uielement.h: rename UseAA() to EnableAntiAlias(). it's
arguably a better name, and more importantly it's the name that
media.cpp/h changed it too, which broke the AA hack used in
Modified: trunk/moon/src/text.cpp
===================================================================
--- trunk/moon/src/text.cpp 2007-10-04 00:04:45 UTC (rev 86841)
+++ trunk/moon/src/text.cpp 2007-10-04 03:22:41 UTC (rev 86842)
@@ -1249,8 +1249,6 @@
Glyphs::Glyphs ()
{
- desc = new TextFontDescription ();
- desc->SetSize (0.0);
downloader = NULL;
font = NULL;
@@ -1269,6 +1267,14 @@
invalid = false;
dirty = false;
+
+ if (RENDER_USING_PANGO) {
+ desc = NULL;
+ return;
+ }
+
+ desc = new TextFontDescription ();
+ desc->SetSize (0.0);
}
Glyphs::~Glyphs ()
@@ -1292,12 +1298,16 @@
g_free (text);
- delete desc;
+ if (desc)
+ delete desc;
}
void
Glyphs::Layout ()
{
+ if (RENDER_USING_PANGO)
+ return;
+
double x, y, w, h;
GlyphInfo *glyph;
GlyphAttr *attr;
@@ -1416,6 +1426,9 @@
void
Glyphs::Render (cairo_t *cr, int x, int y, int width, int height)
{
+ if (RENDER_USING_PANGO)
+ return;
+
GlyphInfo *glyph;
GlyphAttr *attr;
double x0, y0;
@@ -1516,6 +1529,9 @@
void
Glyphs::ComputeBounds ()
{
+ if (RENDER_USING_PANGO)
+ return;
+
if (dirty)
Layout ();
@@ -1580,8 +1596,10 @@
delete uri;
}
- desc->SetFilename (filename);
- desc->SetIndex (id);
+ if (desc) {
+ desc->SetFilename (filename);
+ desc->SetIndex (id);
+ }
g_free (filename);
dirty = true;
@@ -1743,9 +1761,11 @@
SetIndices (str);
dirty = true;
} else if (prop == Glyphs::FontRenderingEmSizeProperty) {
- double size = glyphs_get_font_rendering_em_size (this);
- desc->SetSize (size);
- dirty = true;
+ if (desc) {
+ double size = glyphs_get_font_rendering_em_size (this);
+ desc->SetSize (size);
+ dirty = true;
+ }
} else if (prop == Glyphs::OriginXProperty) {
origin_x = glyphs_get_origin_x (this);
dirty = true;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches