After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 135843 - Getting the resolved direction out of a PangoLayout
Getting the resolved direction out of a PangoLayout
Status: RESOLVED OBSOLETE
Product: pango
Classification: Platform
Component: general
1.4.x
Other Linux
: Normal enhancement
: Small API
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2004-03-01 17:03 UTC by Owen Taylor
Modified: 2018-05-22 12:05 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Owen Taylor 2004-03-01 17:03:39 UTC
Had to write:

static PangoDirection
get_cursor_direction (GtkLabel *label)
{
  PangoDirection last_direction;
  GSList *lines;
                                                                          
                                          
  g_assert (label->select_info);
                                                                          
                                          
  gtk_label_ensure_layout (label);
                                                                          
                                          
  for (l = pango_layout_get_lines (label->layout);; l; l = l->next)
    {
      PangoLayoutLine *line = l->data;
                                                                          
                                          
      /* If label->select_info->selection_end is at the very end of
       * the line, we don't know if the cursor is on this line or
       * the next without looking ahead at the next line. (End
       * of paragraph is different from line break.) But it's
       * definitely in this paragraph, which is good enough
       * to figure out the resolved direction.
       */
       if (line->start_index + line->length >=
label->select_info->selection_end)
        return line->resolved_dir;
    }
                                                                          
                                          
  return PANGO_DIRECTION_LTR;
}

Should be in Pango.
Comment 1 Behdad Esfahbod 2006-01-29 01:57:24 UTC

*** This bug has been marked as a duplicate of 326693 ***
Comment 2 Behdad Esfahbod 2007-01-16 13:24:59 UTC
So, the api for this should probably text an index into the text and return the par dir for that position.
Comment 3 Behdad Esfahbod 2008-04-21 22:25:18 UTC
Anyone willing to cook a patch? :)
Comment 4 GNOME Infrastructure Team 2018-05-22 12:05:08 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pango/issues/14.