Re: [vtwm-hackers] TWM: truetype support (now for VTWM -- finished!)

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

 



Eeri Kask wrote:
> Hello vtwm users,
> 
> This is the latest patchset, 0-8:
> 
>     http://web.inf.tu-dresden.de/~ek1/vtwm-5.4.7-diff0-8.tar
>     http://web.inf.tu-dresden.de/~ek1/VTWM-Tweaked.sh

Hello,

Hereby I believe I am done with Xft and SloppyFocus work for vtwm, the
recent patchset is attached or can be downloaded from the site above.

Callum, may I kindly give this pack into your hands to overlook and sort
out what out of all this is maybe generally useful and then can be
included into official vtwm.  :-)

(I am very interested in continuingly searching for bugs et cetera in
these patches should there some appear, so please everyone don't
hesitate in reporting.)

In recent time I couldn't find any SloppyFocus-related bugs which aren't
actually iconmanager or other issues, so I did only a minor polish and
now let it be so.

Attached is also a RandomNotes file I yesterday past midnight
sporadically quickly wrote off the top of the head including what I have
effectively done regarding vtwm so far all in all.

Remaining is the man page to be updated according to what is new (and
survives peer review), but I need few days timeout for being lazy first.

As usual, apply these patches against vanilla vtwm-5.4.7.tar.gz or run
VTWM-Tweaked.sh as here attached (rplay-sound support gets disabled!).

Have fun,

    Eeri Kask


> P.S. There is dot.vtwmrc included which I use in everyday work.  Window
> transparency can be toggled using the "transset" program from
> FreeDesktop.org.
> 
> P.P.S. Now there are new .vtwmrc keywords
> 
>     SloppyFocus
>     MenuOpacity    240
>     IconOpacity    200
>     DefaultFont    "mono-10"
> 
> in all (plus "f.sloppyfocus" function keyword).

Attachment: vtwm-5.4.7-diff0-8.tar
Description: Unix tar archive

Attachment: VTWM-Tweaked.sh
Description: application/shellscript

(0) NO_I18N_SUPPORT
===================

This configuration parameter is eliminated.

X11R4 support is retained if X11R4 supports following X11 C-functions:

(a) twm.c:  XSupportsLocale()


(b) util.c:

XCreateFontSet()

XmbTextExtents()
XmbDrawImageString()
XmbDrawString()

XGetWMName()
XmbTextPropertyToTextList()
XGetWMIconName()
XmbTextPropertyToTextList()

Corrected suspected memory leak in I18N_FetchName(), I18N_GetIconName() in util.c.



(1) MyFont_ChangeGC
===================

Eliminates this function, functionality shifted into MyFont_DrawImageString()
and MyFont_DrawString() in util.c.



(2) TWM_USE_XFT (Enabled by -DTWM_USE_XFT)
==========================================

'use_fontset' global C variable indicates if Xft functions for UTF8 encoding
are to be used instead of iso8859-1.
This is set in twm.c according to evaluating setlocale() and XSupportsLocale().

Introduced interface macros DRAW_WIN, DRAW_COL in util.h to compile-time
determine Xft and corefont rendering interfaces.

Affected functions GetFont(), MyFont_TextWidth(), MyFont_DrawImageString(),
MyFont_DrawString() in util.c.

Corrected suspected bug in HandleDestroyNotify() regarding destroying a
nonexistent 'tmp_win->VirtualDesktopDisplayWindow' in events.c.


Xft font specification sample in .vtwmrc -- to be documented (man page):

    "Bitstream Vera Sans:medium:roman:size=12:antialias=true"

Weight is 'light', 'medium', 'demibold', 'bold', 'black'.
Slant is 'roman', 'italic', 'oblique'.
Size is 'size', 'pixelsize'.

Generic faces e.g. at size 10 points:  mono-10, sans-10, serif-10.

Further reading:

    Keith Packard: "The Xft font library: architecture and users guide"



(3) Spacing (Enabled by -DTWM_USE_SPACING)
==========================================

Menu vertical lineskip determined by MenuFont.height and not by
MAX(MenuFont.height, MenuTitleFont.height), so is menu title area height.
Therefore menu title font should not be significantly bigger than ordinary
menu font.

Corrected a bug in RedoIconName() in events.c in calculating icon width,
icon pixmap und label offsets.



(4) TWM_USE_OPACITY (Enabled by -DTWM_USE_OPACITY)
==================================================

Prerequisite: xcompmgr (freedesktop.org) is running for transparency drawing.

Introduces keywords 'MenuOpacity', 'IconOpacity' taking integer value
0...255 (transparent...opaque) -- to be documented (man page).

IconOpacity sets opacity for icons and for the icon manager, MenuOpacity sets
opacity for VTWM menus, size/infowindows, virtual desktop, doors.

MenuOpacity source code can be used as example how to introduce opacity
keywords, e.g. for virtual desktop or doors.

As implementation note, opacity is effected by setting the
"_NET_WM_WINDOW_OPACITY" atom for respective windows.  Client windows setting
this atom are intercepted in HandlePropertyNotify() in events.c and this value
is propagated then to vtwm-created frame windows.



(5) Fixes
=========

(a) If MenuTitleFont was .vtwmrc-specified or not was tested by checking if
Scr->MenuTitleFont.name is NULL, most notably in menus.c.
To avoid these runtime tests MenuTitleFont.name is set to MenuFont.name in
CreateFonts() in twm.c prior to loading, if not already set in .vtwmrc
(otherwise GetFont() was called with NULL name and caused Xft crash).

(b) Don't warp mouse to another screen if executing some functions under
XGrabPointer().  Window move, resize operations (maybe others?)
need forced staying on the screen of function execution though.
(See ExecuteFunction() in menus.c)

(c) Don't unhighlight iconmanager client label if entering another screen
in HandleEnterNotify() in events.c, it is already unhighlighted and only
causes an X11-protocol error while drawing with a GC of a wrong screen.

(d) SetFocus() in util.c lacks 'Scr' null-pointer test in TRACE-enclosed code
(affected are notably f.quit, f.restart).



(6) SloppyFocus (Enabled by -DTWM_USE_SLOPPYFOCUS)
==================================================

[To be documented (man page)]

Moved f.focus/F_FOCUS functionality in ExecuteFunction() into FocusOnWindow()
in menus.c and used in HandleEnterNotify() in events.c for SloppyFocus.

SloppyFocus is implemented as a global C variable having initial value FALSE
(.vtwmrc variable 'SloppyFocus' sets initial value to TRUE).
During runtime f.focus/f.unfocus set SloppyFocus to FALSE, f.sloppyfocus sets
SloppyFocus to TRUE.

SloppyFocus assigns focus to some client window if one is entered.
If iconmanager is entered, the corresponding client, if mapped, is assigned
focus; if the client is not mapped (iconified, unmapped) then the
'PointerRoot' X11-focus mode is restored (no window is explicitly assigned
X11 focus).



(7) Improvements
================

[To be documented (man page)]

(a) WarpToTransients has effect only if the corresponding client already has focus.
(add_window.c)

(b) Warp cursor into a newly appearing client if either WarpCursor is set or
it is listed in the WarpCursor-list.
(Until now WarpCursor only warps while deiconifying.)
(add_window.c)



(8) Appearance
==============

(a) SizeWindow, InfoWindow, menu border width tied to 'BorderWidth'.

(b) Draw menu title separator only if menu has borders or bevels.

(c) Add icon name to f.identify while presented in InfoWindow.

(d) Restored twm's original siconify_bits[] Bitmap logo in DrawXLogoImage()
in util.c if logo size not greater than this original bitmap.
Otherwise XmuDrawLogo() is used (which is probably stale code as of now).

(e) 'DefaultFont' keyword introduced -- to be documented (man page).

DefaultFont is used if TWM_USE_XFT is not defined and 'use_fontset' is 'false'
(no locale set?).

(Current Xft implementation seemingly never fails while loading TTF fonts,
so the 'fallback' branch in util.c is never reached and therefore DefaultFont
is not used if TWM_USE_XFT is defined.)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [X Forum]     [XFree86]     [XFree86 Newbie]     [X.Org]     [IETF Annouce]     [Security]     [Fontconfig]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux