Re: Problems with window position, virtual desktops and fonts
- From: Jan-Marek Glogowski <glogow stud fbi fh-darmstadt de>
- To: John Cupitt <john cupitt ng-london org uk>
- Cc: <gtk-list gnome org>
- Subject: Re: Problems with window position, virtual desktops and fonts
- Date: Mon, 2 Jul 2001 14:47:35 +0200 (CEST)
Hi John
> > 1. Positioning of windows
>
> I use gdk_window_get_root_origin() and gtk_widget_set_uposition().
Works
>
> > 2. Show / Hide a window on the same virtual desktop
>
> Good question, but I can't help :-(
I started to connect nearly every signal to a funtion to gain knowledge
about the order the signals are procecced.
Useing something like gtk_signal_emit_stop_by_name() to prevent more
signal emissionns...
> > 3. Quick way to find the best font to fill an area
>
> I believe when you load a scaleable font, X prerenders all the glyphs in
> the font to bitmaps, ready to send to the display ... this is pretty
> slow (and used to lock the X server while it did it, though I think this
> has been fixed).
>
> Maybe you could keep a cache: every time you load a font, measure the
> width of all the characters you will be using, and keep the information
> around in a big hash. When you test a string, add up the widths of the
> characters, and compare to your limit.
>
> I think X does not do kerning in XDrawString(), so for latin charsets at
> least you'll be OK. I guess you've not tried this with pango :-)
I think pango just works with gtk 1.3.x - am I right?
I thought of a new way to load the fonts.
My program is already multi threaded. So I will start a thread, which will
load all the possible fonts. Normally the user wouldn't often change the
font. So I keep them loaded and size lookup would be quick.
That's the theory but how much mem takes a loaded font (if it's really a
bitmap)?
I will have to test it...
>
> HTH, John
>
Thanks
Jan-Marek
BTW - what does HTH stand for?
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]