Re: TWM: truetype support

Marc Aurele La France <[email protected]> Wed, 26 Sep 2007 10:44:30 -0600 (Mountain Daylight Time)
Newsgroups gmane.comp.xfree86.devel
Message-ID <[email protected]>
On Wed, 26 Sep 2007, Eeri Kask wrote:

> Marc Aurele La France wrote:
>> On Tue, 18 Sep 2007, Eeri Kask wrote:
>> [....]
>>> So compile with  -DTWM_USE_XFT  -I/usr/include/freetype2  -lXft
>>
>>> Then insert
>>
>>> TitleFont    "sans-9"
>>> MenuFont    "sans-9"
>>> IconFont    "sans-9:bold"
>>> IconManagerFont    "sans-9"
>>> ResizeFont    "sans-10:bold"
>>
>>> If you are a twm user, please test it; what do you think? :-)
>>
>> I have refit this to our current source.  However, I don't think the
>> default fonts `twm` uses should be changed as doing so will surprise
>> many users.  It appears that restoring the previous defaults would only
>> require additional changes to InitVariables() in twm.c and GetFont() in
>> util.c.
>>
>> Comments?
>>
>> Marc.
>
>
> Wait, please, don't commit yet!  :-)
>
> In the meanwile I have done some minor cosmetic improvements to the Xft
> inclusion and now I am in two days ready to release these (I renamed two
> macros, as being no english native speaker these looked stupid in the
> first "iteration").  That is, I am in fact right now ready to release
> these improvements, but additionally I have done some one-liner
> corrections to text spacing everywhere in rendering as well, so that all
> menu items, icon captions, iconmanager window label texts and so on look
> considerably better spaced.  In the sense, that vertical spacing now
> goes proportionally to the font height and not by a fixed amount like
> "font height plus 4 pixels" etc. (but 1.2 times font height, and the
> like).  It really goes hand in hand with using scalable fonts: one also
> has to have scalable spacing as well!  :-)
>
> These improvements are indeed finished too.
>
>
> Two days I want to spend on completeing a small focus tweak: if and only
> if some client window has focus and this client opens a transient window
> (like thunderbird password prompt, or some file-open dialogue), then the
> mouse should be warped into that window.  I am thinking how to do this
> best using as much existing twm code and functionality as possible; and
> it also remains to decide if it makes sense to invent a new keyword like
> "WarpToTransients" as in vtwm to that purpose, to retain old behaviour
> if the user so wishes.
>
> Then I also found a serious bug and fixed a multicolumn iconmanager
> geometry problem (in Xorg 1.0.3 twm release):  if mapped and one moves
> that iconmanager window then its width gets corrupted during next
> "packing".  It was a small thinking error in PackIconManager() in
> iconmgr.c while computing "wwidth", it should/could be something like
>
> wwidth = (ip->first ? (ip->first->width > 0 ? ip->first->width :
> ip->width/ip->columns) : 150);
>
>
> These above improvements are unrelated to xft-support in twm though.
>
>
> So actually I didn't quite understand you what do you mean by preserving
> default fonts twm uses?  Currently twm uses "fixed" and "variable" in
> twm.c as default fonts if no fonts are specified in .twmrc.   Next, if
> some font failed to load, then "fixed" is (unrelated to InitVariables()
> in twm.c) tried in util.c as a fallback.  So by the way, the DefaultFont
> as initialised in twm.c is actually never used as a fallback, this font
> is used only to render infowindow text!  (It should be called InfoFont
> instead, but let it be DefaultFont as it is; we have DefaultForeground
> and DefaultBackground as colours as well and nobody actually knows for
> what purpose: to draw size- and infowindows.)  Much more important is
> that one can specify DefaultFont in .twmrc which needs to be fixed (and
> already is :-).
>
> I am afraid we need to change "fixed" and "variable" in twm.c if Xft is
> included because xft-subsystem crashes (at least mine) if one uses these
> in XftFontOpenXlfd(), probably because these names are not
> XLFD-compliant. (xft should not crash because of that, but it is xft's
> problem, not ours.)  So as long as default font names (or user-specified
> font names in .twmrc) are xlfd-conform one can use these as usual, in
> that regard nothing has changed.  If I am correct the choice of "fixed"
> as a default font is always justified by the fact that this font is
> guaranteed present in every X11 installation and so it is a very
> reasonable decision.  Concerning xft I believe having read Keith Packard
> "sans", "serif" and "mono" should be expected included in every xft
> installation, so I chose "sans-10" and "mono-10" as a replacement for
> "variable" and "fixed" in twm.c.
> This is the story to that decision. :-)
>
> Greetings,
>
>    Eeri Kask
>
>

+----------------------------------+----------------------------------+
|  Marc Aurele La France           |  work:   1-780-492-9310          |
|  Academic Information and        |  fax:    1-780-492-1729          |
|    Communications Technologies   |  email:  [email protected]         |
|  352 General Services Building   +----------------------------------+
|  University of Alberta           |                                  |
|  Edmonton, Alberta               |    Standard disclaimers apply    |
|  T6G 2H1                         |                                  |
|  CANADA                          |                                  |
+----------------------------------+----------------------------------+
XFree86 developer and VP.  ATI driver and X server internals.