summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2004-12-13 19:55:57 +0000
committerOwen Taylor <otaylor@src.gnome.org>2004-12-13 19:55:57 +0000
commit2fc2d85e7adc829d890cdd98caeb868f419f0cca (patch)
tree05b1c7c79c8c550559076707019917030da8d452
parentf84e23d20b29d406ab1f183f22ab4b9ca42b46fb (diff)
downloadpango-2fc2d85e7adc829d890cdd98caeb868f419f0cca.tar.gz
Add. (#153548, Morten Welinder)
Mon Dec 13 14:44:40 2004 Owen Taylor <otaylor@redhat.com> * pango/pango-layout.[ch] pango/pango.def docs/pango-sections.txt: Add. (#153548, Morten Welinder) * pango/pango-layout.c (pango_layout_set_font_description): Guard against the same description being set back.
-rw-r--r--ChangeLog8
-rw-r--r--ChangeLog.pre-1-108
-rw-r--r--ChangeLog.pre-1-88
-rw-r--r--docs/pango-sections.txt1
-rw-r--r--pango/pango-layout.c40
-rw-r--r--pango/pango-layout.h3
-rw-r--r--pango/pango.def1
7 files changed, 60 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 68b8b6fc..c4954f2b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Mon Dec 13 14:44:40 2004 Owen Taylor <otaylor@redhat.com>
+
+ * pango/pango-layout.[ch] pango/pango.def docs/pango-sections.txt:
+ Add. (#153548, Morten Welinder)
+
+ * pango/pango-layout.c (pango_layout_set_font_description):
+ Guard against the same description being set back.
+
2004-12-12 Tor Lillqvist <tml@iki.fi>
* pango/modules.c (read_modules)
diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10
index 68b8b6fc..c4954f2b 100644
--- a/ChangeLog.pre-1-10
+++ b/ChangeLog.pre-1-10
@@ -1,3 +1,11 @@
+Mon Dec 13 14:44:40 2004 Owen Taylor <otaylor@redhat.com>
+
+ * pango/pango-layout.[ch] pango/pango.def docs/pango-sections.txt:
+ Add. (#153548, Morten Welinder)
+
+ * pango/pango-layout.c (pango_layout_set_font_description):
+ Guard against the same description being set back.
+
2004-12-12 Tor Lillqvist <tml@iki.fi>
* pango/modules.c (read_modules)
diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8
index 68b8b6fc..c4954f2b 100644
--- a/ChangeLog.pre-1-8
+++ b/ChangeLog.pre-1-8
@@ -1,3 +1,11 @@
+Mon Dec 13 14:44:40 2004 Owen Taylor <otaylor@redhat.com>
+
+ * pango/pango-layout.[ch] pango/pango.def docs/pango-sections.txt:
+ Add. (#153548, Morten Welinder)
+
+ * pango/pango-layout.c (pango_layout_set_font_description):
+ Guard against the same description being set back.
+
2004-12-12 Tor Lillqvist <tml@iki.fi>
* pango/modules.c (read_modules)
diff --git a/docs/pango-sections.txt b/docs/pango-sections.txt
index 10600e3c..79c5c579 100644
--- a/docs/pango-sections.txt
+++ b/docs/pango-sections.txt
@@ -403,6 +403,7 @@ pango_layout_set_markup_with_accel
pango_layout_set_attributes
pango_layout_get_attributes
pango_layout_set_font_description
+pango_layout_get_font_description
pango_layout_set_width
pango_layout_get_width
pango_layout_set_wrap
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 97649f40..47318e24 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -484,16 +484,38 @@ pango_layout_set_font_description (PangoLayout *layout,
{
g_return_if_fail (layout != NULL);
- if (layout->font_desc)
- pango_font_description_free (layout->font_desc);
-
- if (desc)
- layout->font_desc = pango_font_description_copy (desc);
- else
- layout->font_desc = NULL;
+ if (desc != layout->font_desc)
+ {
+ if (layout->font_desc)
+ pango_font_description_free (layout->font_desc);
+
+ if (desc)
+ layout->font_desc = pango_font_description_copy (desc);
+ else
+ layout->font_desc = NULL;
+
+ pango_layout_clear_lines (layout);
+ layout->tab_width = -1;
+ }
+}
- pango_layout_clear_lines (layout);
- layout->tab_width = -1;
+/**
+ * pango_layout_get_font_description:
+ * @layout: a #PangoLayout
+ *
+ * Gets the font description for the layout, if any.
+ *
+ * Return value: a pointer to the layout's font description,
+ * or %NULL if the font description from the layout's
+ * context is inherited. This value is owned by the layout
+ * and must not be modified or freed.
+ **/
+G_CONST_RETURN PangoFontDescription *
+pango_layout_get_font_description (PangoLayout *layout)
+{
+ g_return_val_if_fail (PANGO_IS_LAYOUT (layout), NULL);
+
+ return layout->font_desc;
}
/**
diff --git a/pango/pango-layout.h b/pango/pango-layout.h
index ac501fe1..d52b8b1c 100644
--- a/pango/pango-layout.h
+++ b/pango/pango-layout.h
@@ -116,6 +116,9 @@ void pango_layout_set_markup_with_accel (PangoLayout *layout,
void pango_layout_set_font_description (PangoLayout *layout,
const PangoFontDescription *desc);
+
+G_CONST_RETURN PangoFontDescription *pango_layout_get_font_description (PangoLayout *layout);
+
void pango_layout_set_width (PangoLayout *layout,
int width);
int pango_layout_get_width (PangoLayout *layout);
diff --git a/pango/pango.def b/pango/pango.def
index 5b9f2e1a..0e6b00a6 100644
--- a/pango/pango.def
+++ b/pango/pango.def
@@ -190,6 +190,7 @@ EXPORTS
pango_layout_get_cursor_pos
pango_layout_get_ellipsize
pango_layout_get_extents
+ pango_layout_get_font_description
pango_layout_get_indent
pango_layout_get_iter
pango_layout_get_justify