Commit 9b3aa20f authored by Behdad Esfahbod's avatar Behdad Esfahbod Committed by Behdad Esfahbod
Browse files

Bug 404416 – pango_layout_get_baseline or something

2008-04-21  Behdad Esfahbod  <behdad@gnome.org>

        Bug 404416 – pango_layout_get_baseline or something

        * docs/pango-sections.txt:
        * pango/pango-layout.c (pango_layout_get_baseline):
        * pango/pango-layout.h:
        * pango/pango.def:
        New public API:

                pango_layout_get_baseline()


svn path=/trunk/; revision=2605
parent 35699a66
2008-04-21 Behdad Esfahbod <behdad@gnome.org>
Bug 404416 – pango_layout_get_baseline or something
* docs/pango-sections.txt:
* pango/pango-layout.c (pango_layout_get_baseline):
* pango/pango-layout.h:
* pango/pango.def:
New public API:
pango_layout_get_baseline()
2008-04-21 Behdad Esfahbod <behdad@gnome.org>
Bug 474706 – cairo hexbox looks ugly
......
......@@ -491,6 +491,7 @@ pango_layout_get_extents
pango_layout_get_pixel_extents
pango_layout_get_size
pango_layout_get_pixel_size
pango_layout_get_baseline
pango_layout_get_line_count
pango_layout_get_line
pango_layout_get_line_readonly
......
......@@ -2669,6 +2669,29 @@ pango_layout_get_pixel_size (PangoLayout *layout,
*height = logical_rect.height;
}
/**
* pango_layout_get_baseline:
* @layout: a #PangoLayout
*
* Gets the Y position of baseline of the first line in @layout.
*
* Return value: baseline of first line, from top of @layout.
*
* Since: 1.22
**/
int
pango_layout_get_baseline (PangoLayout *layout)
{
int baseline;
/* XXX this is so inefficient */
PangoLayoutIter *iter = pango_layout_get_iter (layout);
baseline = pango_layout_iter_get_baseline (iter);
pango_layout_iter_free (iter);
return baseline;
}
static void
pango_layout_clear_lines (PangoLayout *layout)
{
......
......@@ -202,6 +202,7 @@ void pango_layout_get_size (PangoLayout *layout,
void pango_layout_get_pixel_size (PangoLayout *layout,
int *width,
int *height);
int pango_layout_get_baseline (PangoLayout *layout);
int pango_layout_get_line_count (PangoLayout *layout);
PangoLayoutLine *pango_layout_get_line (PangoLayout *layout,
......
......@@ -217,6 +217,7 @@ EXPORTS
pango_layout_get_alignment
pango_layout_get_attributes
pango_layout_get_auto_dir
pango_layout_get_baseline
pango_layout_get_context
pango_layout_get_cursor_pos
pango_layout_get_ellipsize
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment