Subject: recent work (breaks window shading)

From: Dominik Vogt <[email-masked]>
Date: Sat, 9 Mar 2002 20:50:38 +0100

Some notes on my last commit:

 1) Don't overwrite your working executable with current CVS!

 2) It completely breaks window shading.  I'm currently reworking
    the code and had to check something in after days of hard
    work.  Only un-animated shading with windowtitles at the top
    works.  Please don't send bug reports about window shading.

 3) To implement TitleAtLeft and TitleAtRight, I had to touch tons
    of code.  Specifically, I had to change large parts of the
    Flocale library.  All locale specific code is now in
    Flocale.[ch] and Fft.[ch].  I'd like to remove the configure
    options for multibyte and compund text completely now.

 4) TitleAtLeft/Right should work completely, but I didn't do much
    testing.  I'm almost convinced that the FANCY_TITLE_BAR code
    does not work (you have to use rotated pixmaps to make it work
    at all).  Any testing results are welcome.

Olivier, there is some unfinished work in Flocale.* and Fft.*.
Specifically, I added a new member to the FlocaleFont structure:
min_char_offset.  This should be the x offset at which characters
are printed for vertical titles.  I didn't know how to calculate
that for Xft (I don't have any documentation).  Can you please
take a look at that?  I've marked all unfinished places with
"FIXME".  Also, Fft.c calls a function XftTextExtentsUtf8 and
a similar version of XDrawString.  My system doesn't have these
and configure does not detect that situation.  In other words: I
can't compile the code.  I've ifdef'ed them out for now.

Furthermore, I restructured and reformatted Flocal.* and Fft.*.
I hope you're not angry with me about that.  It was in the best
interest of future development.  All the FOOBAR_CODE() macros are
gone now and all code is compiled even when the libraries are not
present (I provided dummy interfaces if something is missing).
This way the compiler always checks the syntax of the code even if
the optimizer does not generate any code because of the
if-conditions like

  if (FlocaleMultibyteSupport)
    ...

with FlocaleMultibyteSupport #defined to 0 or 1.

Also, I vaguely remember some discussion about a library that
prints strings vertically.  This is needed to get left/right
titles working correctly.  I'm not sure how to handle this with
the flood of XDrawString variants we now have.

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Olivier Chapuis <[email-masked]>
Date: Sun, 10 Mar 2002 08:33:08 +0100

> the flood of XDrawString variants we now have.

Unfortunately, I've no time just now to complete the code and
to answer your questions in the good way. I will work on this
on monday and tuesday. The library which rotate font is still
on my machine but it is just for FontStruct. I can try to
implement vertical font rendering but I may need some times
(as one week if I do not fall on particular difficulty).

Olivier

---

From: Dominik Vogt <[email-masked]>
Date: Sun, 10 Mar 2002 10:37:53 +0100

> (as one week if I do not fall on particular difficulty).

The matter isn't pressing.  THere are two possible ways for
vertical titles:

 - Print them horizontally in a pixmap, rotate the pixmap by 90
   degress and copy it into the title.  Works without any
   libraries and is easy to do.
 - Print one letter atop each other.  Either use a library or
   do-it-yourself.  If I'd know how how to find out the length of
   a single character in bytes it could be done easily without a
   library.

BTW, I'm not convinced titles with one letter atop the other look
better than rotated titles.

Bye

Dominik ^_^  ^_^

---

From: Olivier Chapuis <[email-masked]>
Date: Mon, 11 Mar 2002 08:42:24 +0100

On Sun, Mar 10, 2002 at 10:37:53AM +0100, Dominik Vogt wrote:
> > > take a look at that?

Hum I do not know too.
 
> > >I've marked all unfinished places with

I hope that I have fixed this. The main problem with Xft is the following
note in the Xft man page:

       Xft  will  probably  change  radically in the future; weak
       attempts will be made to retain some level of  source-file
       compatibility. 

It is why I've marked this support totally experimental.

> > > with FlocaleMultibyteSupport #defined to 0 or 1.

All these is not a problem for me.
 
> better than rotated titles.

Maybe this should be a style? RotateVerticalTitle / AtopVerticalTitle.

<Some others remarks without real importance in comparison from the
wonderfull fact that fvwm has now vertical title!!>

Also, it is not clear for me in which "direction" we should rotate
the title. It is clear that the default is to perform a -90° rotation,
as French guys (and maybe pepeole from other countries) would like
a +90° rotation (this concerns also buttons position: left buttons
should be on top?).
An other problem is title background and buttons _background_. IMHO,
it should also be rotated (e.g., a Vertical gradient title style should
gives an Horizontal gradient for vertical background).
And what about buttons position flags? If we have line as:
	AddButtonStyle 6 Inactive   foo -- Right
Maybe this should be transformed to
        AddButtonStyle 6 Inactive   foo -- Bottom [or Top]
for a vertical title?

Olivier

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 11 Mar 2002 11:01:46 +0100

> > > > that for Xft (I don't have any documentation).  Can you please

Isn't there some documentation about the "extents" structure of
the Xft fonts?

> It is why I've marked this support totally experimental.

Wouldn't be much of a problem if we could at least supply some
prototypes for the functions we use so that the code at least
compiles (without ifdefs).

[snip]
> wonderfull fact that fvwm has now vertical title!!>

It's probably not important enough to write code for *both* ways.

> a +90° rotation

+90° is "top to bottom" and -90° is "bottom to top"?  The most
natural way seems to be text from bottom to top on the left side
and top to bottom on the right side.  When you turn your head
before the screen it tends to lean a bit to the side:

  |  <- the neck in neutral position
  /  <- when looking right
  \  <- when looking left

Thus, the angle between the lines between the eyes and the title
is reduced a bit (85° instead of 90° for example).  Of course you
can have the left side of a window to the right of your head, but
it's less likely to happen.

> (this concerns also buttons position: left buttons should be on
> top?).

Buttons 13579 are always left or on top, 24680 right or at the
bottom.  Otherwise you'd have to place the "left" buttons at the
right side of a bottom title too.

> gives an Horizontal gradient for vertical background).

Right now, I'm completely ignore that issue.  It becomes even more
complex with the "fancy titlebars patch".  At the moment, it's up
to the user to provide the proper rotated pixmaps and gradient
specifications.  Anyway, this has to wait until I'm done with the
GFLAWSR ("Great Frame Layout And Window Shading Rewrite") I began
a week ago ;-)

>         AddButtonStyle 6 Inactive   foo -- Bottom [or Top]

Currently, "Left" is interpreted as "Top" and "Right" as "Bottom"
for vetrical titles.  THere are no "Top" and "Bottom" bits, any
I'm reluctant to add new features to the BlaBlaStyle commands.
Should be interpreted as "beginning of the text aligned to the
title window" or "end of the text aligned ...".

Bye

Dominik ^_^  ^_^

-- 
Dominik Vogt, email: [email-masked]
LifeBits Aktiengesellschaft, Albrechtstr. 9, D-72072 Tuebingen
fon: ++49 (0) 7071/7965-0, fax: ++49 (0) 7071/7965-20
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Olivier Chapuis <[email-masked]>
Date: Mon, 11 Mar 2002 17:03:19 +0100

> Isn't there some documentation about the "extents" structure of

The only doc I now on Xft is a very poor man page, the headers files
and the source code.
 
> It's probably not important enough to write code for *both* ways.

Yes, but I make some test with "Atop". This is ugly and castrophic
with certain string. I think we should rotate.
 
> it's less likely to happen.

Interesting. I thought about books in a library: for example,
American book title are top to bottom as French book title are
bottom to top. Maybe, these traditions are important as the users
may have their brain already formed for a given direction?

Olivier

---

From: Mikhael Goikhman <[email-masked]>
Date: Mon, 11 Mar 2002 17:49:07 +0000

> with certain string. I think we should rotate.

These are my thoughs too. Both monitors and fonts are not designed at all
for the Japanese like direction. Displays are wide, fonts are thin with
the constant height and different widths, this makes it nice to write it
left-to-right or right-to-left, but not top-to-bottom (even if centered).

> may have their brain already formed for a given direction?

I need to turn my head to the left for books in 2 my languages, like with
French. I think you are right about a brain already formed to turn a head
to the left, even for right titles. An option would be good (3 values:
SideTextRotateRight, SideTextRotateLeft, SideTextRotateAsTitle).

> right side of a bottom title too.

Ideally, it should be configured, OddButtonsAtLeftTop or ButtonsRotated.
This would affect a bottom title too of course.

Though this is not critical at all.

Regards,
Mikhael.

---

From: Olivier Chapuis <[email-masked]>
Date: Tue, 12 Mar 2002 11:48:38 +0100

> SideTextRotateRight, SideTextRotateLeft, SideTextRotateAsTitle).

It is already possible to test "rotate right" with xft font:

Style * Font "xft:a_familly:matrix=0 1 -1 0"

Olivier

---

From: Olivier Chapuis <[email-masked]>
Date: Wed, 13 Mar 2002 16:38:58 +0100

> SideTextRotateRight, SideTextRotateLeft, SideTextRotateAsTitle).

Ok, So SideTextRotateAsTitle is Dominik suggestion: top to bottom
text for right title and bottom to top for left title?
This seems reasonable for me as the default.
Olivier