[pango] tailing whitespace problem when wrap is applied



Dear all,

 

When wrap is applied, successive tailing whitespace causes some problem.

Successive tailing whitespace gets out layout’s width range despite of character wrap.

 

When I investigate it, below code cause above situation.

(pango/pango/break.c : pango_default_break() 1013 lines)

Pango original source

Pango modified source

switch (break_type)

{

           case G_UNICODE_BREAK_MANDATORY:

           case G_UNICODE_BREAK_LINE_FEED:

           case G_UNICODE_BREAK_CARRIAGE_RETURN:

           case G_UNICODE_BREAK_NEXT_LINE:

           case G_UNICODE_BREAK_SPACE:

           /* These types all "pile up" at the end of lines and

            * get elided.

            */

           break_op = BREAK_PROHIBITED;

           break;

 

           case G_UNICODE_BREAK_CONTINGENT:

           /* break before 0xFFFC by default, eventually

           * make this configurable?

           */

           break_op = BREAK_ALLOWED;

           break;

switch (break_type)

{

           case G_UNICODE_BREAK_MANDATORY:

           case G_UNICODE_BREAK_LINE_FEED:

           case G_UNICODE_BREAK_CARRIAGE_RETURN:

           case G_UNICODE_BREAK_NEXT_LINE:

           //case G_UNICODE_BREAK_SPACE:

           /* These types all "pile up" at the end of lines and

            * get elided.

            */

           break_op = BREAK_PROHIBITED;

           break;

 

           case G_UNICODE_BREAK_CONTINGENT:

case G_UNICODE_BREAK_SPACE:

           /* break before 0xFFFC by default, eventually

           * make this configurable?

           */

           break_op = BREAK_ALLOWED;

           break;

 

My question is

1.     What’s the reason of above code? (why break is prohibited when break_type is G_UNICODE_BREAK_SPACE?)

2.     Do you know good solution? (fore reference, I used pango 1.26.1 version)

 

Best Regards,

Deokjin kim



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]