Re: gdtk_draw_text deprecated , what use instead of it ?
- From: Olexiy Avramchenko <olexiy irtech cn ua>
- To: Paul Pogonyshev <pogonyshev gmx net>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: gdtk_draw_text deprecated , what use instead of it ?
- Date: Tue, 30 Dec 2003 19:59:47 +0200
Paul Pogonyshev wrote:
Tom Liu wrote:
You should use pango, read the FAQ came with GTK document,there is an
example over there.
I once raised this issue but got no answer. Consider a chess board:
a b c d e f g h
8 8
7 7
6 6
5 5
4 4
3 3
2 2
1 1
a b c d e f g h
To draw the labels with Pango one would need 32 layout structures, unless
i miss something. Ok, moving further. I'm writing a program that is an
interface for the game of go. Standard go board (goban) is 19x19 and so
i would have to use 76 Pango layouts, which is simply ridiculous.
Hmm, why not to use pango_layout_set_text() and exactly one layout ?
Have 76 layouts around looks weird, of course...
I think deprecating gdk_draw_text() was a hastily decision. I can see
absolutely no point in creating a layout for drawing a single letter (or
even two, like "15") at a certain position. I understand that Pango
provides better support for unicode, can break lines and so on. But if
i simply don't need any of its features?
If you dont need pango - use raw X lib functions. gdk_draw_text() has no
significant advantages over XDraw[Image]String[16].
It seems to me it was better to _recommend_ using Pango layouts for most
purposes, rather than deprecating gdk_draw_text() completely. You cannot
say that any characters drawn need to be text. And Pango layouts are
there to handle exactly text, not single characters.
Performance issues mentioned here are also a good reason to resurrect
gdk_draw_text().If no one can point me to a nice and simple way of drawing 76+ labels
scattered on a widget using Pango layouts, i think i'll have to use
gdk_draw_text(). And i can't say i like it this way, because i
currently compile my program with *_DISABLE_DEPRECATED flags defined.
What CPU usage 'top' shows when you run your program ? If its a
user-driver program that outputs some lines of text after key pressed or
mouse moved you can still use pango with ease - system will not suffer.
The main benefits (as for me) from pango - scalable fonts support and
i18n support.
Olexiy
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]