Please fill out the GtkLabel questionnaire



Hey,

So this came up while discussing
https://bugzilla.gnome.org/show_bug.cgi?id=647284 and we weren't sure
what the proper answers for all those questions were. So we were
wondering.
We are thinking about GtkLabel size reuqests, in particular about the
width. For ease of discussion, we assume that the font is monospaced,
so we can forget about pixels and only think about characters. The
text set on the label is "12345 1234" (10 characters in 2 words). And
the question is: Given the properties on the left what width should
the label request? Please fill out the table.

label properties                                     number of
characters label should request
wrap        ellipsize   width_chars max_width_chars  minimum   natural
false       false       -1          -1               ?         ?
true        false       -1          -1               ?         ?
false       true        -1          -1               ?         ?
true        true        -1          -1               ?         ?
false       false        4          -1               ?         ?
true        false        4          -1               ?         ?
false       true         4          -1               ?         ?
true        true         4          -1               ?         ?
false       false        8          -1               ?         ?
true        false        8          -1               ?         ?
false       true         8          -1               ?         ?
true        true         8          -1               ?         ?
false       false       12          -1               ?         ?
true        false       12          -1               ?         ?
false       true        12          -1               ?         ?
true        true        12          -1               ?         ?
false       false       -1           4               ?         ?
true        false       -1           4               ?         ?
false       true        -1           4               ?         ?
true        true        -1           4               ?         ?
false       false        4           4               ?         ?
true        false        4           4               ?         ?
false       true         4           4               ?         ?
true        true         4           4               ?         ?
false       false        8           4               ?         ?
true        false        8           4               ?         ?
false       true         8           4               ?         ?
true        true         8           4               ?         ?
false       false       12           4               ?         ?
true        false       12           4               ?         ?
false       true        12           4               ?         ?
true        true        12           4               ?         ?
false       false       -1           8               ?         ?
true        false       -1           8               ?         ?
false       true        -1           8               ?         ?
true        true        -1           8               ?         ?
false       false        4           8               ?         ?
true        false        4           8               ?         ?
false       true         4           8               ?         ?
true        true         4           8               ?         ?
false       false        8           8               ?         ?
true        false        8           8               ?         ?
false       true         8           8               ?         ?
true        true         8           8               ?         ?
false       false       12           8               ?         ?
true        false       12           8               ?         ?
false       true        12           8               ?         ?
true        true        12           8               ?         ?
false       false       -1          12               ?         ?
true        false       -1          12               ?         ?
false       true        -1          12               ?         ?
true        true        -1          12               ?         ?
false       false        4          12               ?         ?
true        false        4          12               ?         ?
false       true         4          12               ?         ?
true        true         4          12               ?         ?
false       false        8          12               ?         ?
true        false        8          12               ?         ?
false       true         8          12               ?         ?
true        true         8          12               ?         ?
false       false       12          12               ?         ?
true        false       12          12               ?         ?
false       true        12          12               ?         ?
true        true        12          12               ?         ?


Alternatively, you can describe an algorithm to compute the label and
I will fill out the table for you. But I'm pretty sure you'll get the
algorithm wrong and do something entirely stupid for some weird corner
case.

Enjoy,
Benjamin


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