Add is_expandable_space to PangoLogAttr.
authorBehdad Esfahbod <behdad@gnome.org>
Wed, 2 May 2007 07:49:38 +0000 (07:49 +0000)
committerBehdad Esfahbod <behdad@src.gnome.org>
Wed, 2 May 2007 07:49:38 +0000 (07:49 +0000)
2007-05-02  Behdad Esfahbod  <behdad@gnome.org>

        * docs/tmpl/main.sgml:
        * pango/break.c (pango_default_break):
        * pango/pango-break.h:
        Add is_expandable_space to PangoLogAttr.

svn path=/trunk/; revision=2250

ChangeLog
docs/tmpl/main.sgml
pango/break.c
pango/pango-break.h

index 48dd675..763f95e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-05-02  Behdad Esfahbod  <behdad@gnome.org>
+
+       * docs/tmpl/main.sgml:
+       * pango/break.c (pango_default_break):
+       * pango/pango-break.h:
+       Add is_expandable_space to PangoLogAttr.
+
 2007-05-02  Mathias Hasselmann  <mathias.hasselmann@gmx.de>
 
        * pango-view/viewer-render.c (make_layout), (parse_options):
index 865229f..9a3a9f3 100644 (file)
@@ -471,6 +471,8 @@ about the attributes of a single character.
                               bit is set on all grapheme boundaries except
                               those following Latin, Cyrillic or Greek base
                               characters.
+@is_expandable_space: is a whitespace character that can possiblye be
+                      expanded for justification purposes. (Since: 1.18)
 
 <!-- ##### FUNCTION pango_shape ##### -->
 <para>
index e159b02..091d254 100644 (file)
@@ -627,6 +627,9 @@ pango_default_break (const gchar   *text,
        */
       attrs[i].is_white = g_unichar_isspace (wc);
 
+      /* Just few spaces have variable width. So explicitly mark them.
+       */
+      attrs[i].is_expandable_space = (0x0020 == wc || 0x00A0 == wc);
 
       /* ---- Cursor position breaks (Grapheme breaks) ---- */
 
index 9711166..fe22ace 100644 (file)
@@ -40,14 +40,14 @@ struct _PangoLogAttr
 
   guint is_white : 1;           /* Whitespace character */
 
-  /* cursor can appear in front of character (i.e. this is a grapheme
-   * boundary, or the first character in the text)
+  /* Cursor can appear in front of character (i.e. this is a grapheme
+   * boundary, or the first character in the text).
    */
   guint is_cursor_position : 1;
 
   /* Note that in degenerate cases, you could have both start/end set on
    * some text, most likely for sentences (e.g. no space after a period, so
-   * the next sentence starts right away)
+   * the next sentence starts right away).
    */
 
   guint is_word_start : 1;      /* first character in a word */
@@ -65,10 +65,15 @@ struct _PangoLogAttr
   guint is_sentence_start : 1;  /* first character in a sentence */
   guint is_sentence_end : 1;    /* first non-sentence char after a sentence */
 
-  /* if set, backspace deletes one character rather than
-   * the entire grapheme cluster
+  /* If set, backspace deletes one character rather than
+   * the entire grapheme cluster.
    */
   guint backspace_deletes_character : 1;
+
+  /* Only few space variants (U+0020 and U+00A0) have variable
+   * width during justification.
+   */
+  guint is_expandable_space : 1;
 };
 
 /* Determine information about cluster/word/line breaks in a string