Re: Question about gtk_label_set_justify()



David Nečas (Yeti) wrote:
On Wed, Jul 26, 2006 at 07:09:40AM +0200, Richard Boaz wrote:
so far, all discussion of this problem has related to whether or not a
solution resides wholly withing gtk/pango/cairo/whatever.

it would seem to me that the fact that gtk/pango/cairo/whatever does not
provide a built-in solution for chinese style justification only means
that the solution must be found elsewhere.

namely, before rendering the label string, provide your own function that
creates the string exactly as you would want it to be displayed, simply
using spaces to fill out the string accordingly, and then provide this new
string to render the label.

whynot?

How do you achieve an exact width just by adding spaces?

If the program is Chinese-only and gives up the possibility
to be ever internationalized right away, well, one can
create a Pango layout, measure all the glyphs in the label,
calculate the space to put between them and then render the
glyphs one by one to the calculated positions -- this all
encapsulated in a new widget, something like MyChineseSpreadLabel.
Of course this assumes there is an easy way to tell how
a string is broken to glyphs for Chinese.

Pango does full justification already in PangoLayouts, therefore it would seem logical to figure out what needs to be done to make it work for Chinese.
--
---------------------------------------------------------------------------
Mark Leisher
Computing Research Lab             Nowadays, the common wisdom is to
New Mexico State University        celebrate diversity - as long as you
Box 30001, MSC 3CRL                don't point out that people are
Las Cruces, NM  88003              different.    -- Colin Quinn



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