Re: Question about gtk_label_set_justify()



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.

Yeti


--
Anonyms eat their boogers.



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