Re: How do fonts work when you have no font packages installed?

2014-07-06 Thread Jon TURNEY

On 04/07/2014 08:16, Michael DePaulo wrote:

I just installed cygwin64 with only the base packages, xorg-server,
and its dependencies installed.

The FAQ (2014-04-29) states:
3.5. My favourite font has gone! The font Emacs uses is just boxes
Only minimal fonts will be installed after the upgrade.

However, on my system, /usr/share/fonts/ is empty.


The X server has a version of 6x13 fixed font built-in, to allow it and 
(some) apps which use core fonts, to operate in this situation.


If some local X clients were installed, this would (hopefully) cause any 
X core fonts they require to be installed.



Yet I am able to XDMCP into a GNOME2 CentOS 6.5 machine and all the
fonts show up fine with the handful of apps I tested.

Can someone explain how text is being rendered? Is Cygwin Xwin using
fonts from the Windows OS?


While this is technically possible by adding the Windows font directory 
to the X server font path, that is not done.


(Although those fonts are made available to local clients by telling 
fontconfig to look in the Windows font directory, although this is not 
technically perfect as there isn't any mechanism to tell fontconfig to 
update it's cache when Windows fonts are added or removed)


 Are the fonts being rendered client-side via XRender?

Yes, if the apps you tested are modern, client-side fonts are almost 
certainly being used.  [1] explains this fairly well:


The first X11 clients used the core X11 protocol to draw text, as that 
was the only choice. [...] Because GTK+ and Qt, the toolkits behind 
several applications including all GNOME and KDE applications, switched 
to Xft, many programs on most desktops [...] now use Xft.


Core fonts are a legacy feature.

If you want to use an older remote application which requires a 
particular core font, you will have to install it.


[1] http://en.wikibooks.org/wiki/Guide_to_X11/Fonts

--
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: How do fonts work when you have no font packages installed?

2014-07-06 Thread Michael DePaulo
On Sun, Jul 6, 2014 at 11:08 AM, Jon TURNEY jon.tur...@dronecode.org.uk wrote:
 On 04/07/2014 08:16, Michael DePaulo wrote:

 I just installed cygwin64 with only the base packages, xorg-server,
 and its dependencies installed.

 The FAQ (2014-04-29) states:
 3.5. My favourite font has gone! The font Emacs uses is just boxes
 Only minimal fonts will be installed after the upgrade.

 However, on my system, /usr/share/fonts/ is empty.


 The X server has a version of 6x13 fixed font built-in, to allow it and
 (some) apps which use core fonts, to operate in this situation.

 If some local X clients were installed, this would (hopefully) cause any X
 core fonts they require to be installed.


 Yet I am able to XDMCP into a GNOME2 CentOS 6.5 machine and all the
 fonts show up fine with the handful of apps I tested.

 Can someone explain how text is being rendered? Is Cygwin Xwin using
 fonts from the Windows OS?


 While this is technically possible by adding the Windows font directory to
 the X server font path, that is not done.

 (Although those fonts are made available to local clients by telling
 fontconfig to look in the Windows font directory, although this is not
 technically perfect as there isn't any mechanism to tell fontconfig to
 update it's cache when Windows fonts are added or removed)


 Are the fonts being rendered client-side via XRender?

 Yes, if the apps you tested are modern, client-side fonts are almost
 certainly being used.  [1] explains this fairly well:

 The first X11 clients used the core X11 protocol to draw text, as that was
 the only choice. [...] Because GTK+ and Qt, the toolkits behind several
 applications including all GNOME and KDE applications, switched to Xft, many
 programs on most desktops [...] now use Xft.

Thank you very much, this is a very good answer. I was not aware of Xft.

 Core fonts are a legacy feature.

 If you want to use an older remote application which requires a particular
 core font, you will have to install it.

Yes, I've observed this too. At work we run an old (but actively
maintained) commercial Linux application written in Motif, and it
requires core fonts to be installed on the Windows machines running
Cygwin X11 or VcXsrv.


 [1] http://en.wikibooks.org/wiki/Guide_to_X11/Fonts

 --
 Jon TURNEY
 Volunteer Cygwin/X X Server maintainer

Thanks again,
-Mike DePaulo

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: Wine creating windows offscreen when multiwindow is used?

2014-07-06 Thread Jon TURNEY

On 03/07/2014 23:46, Matt D. wrote:

I have a monitor configuration with three 1920x1080 monitors aligned
side-by-side horizontally with a fourth above the center. The primary
monitor is the center one at the bottom. xinit generates a single screen
5760x2160 to cover the area. The root window is hidden and all windows
in the buffer are drawn with native Windows decorations.

When an X window is created at 0,0, it is visible on the primary
monitor, despite 0,0 in the buffer being offscreen. This is great.
However, when Wine creates a window at 0,0, it is aligned to 0,0 in the
buffer (-1920x-1080 screen coordinates on Windows) and is not visible.

Is there a solution for this? This is a discrepancy between what regular
X windows do and where Wine positions its windows.

I also noticed that when creating a window with XCreateSimpleWindow, the
x and y coordinates are ignored. For example, I would expect a window
created at 0,0 in the X buffer to be visible at 0,0 screen coordinates;
but instead it's just somewhere offset slightly from the top left of the
primary monitor. Any x/y coordinates specified do not seem to affect
where it goes.


Normally, an X window manager ignores the x,y position specified for the 
window when it's created, and places the window according to some 
heuristic (for example, try to ensure that windows don't completely overlap)


The -multiwindow mode window manager defers to Windows native window 
placement (which appears to be something like placing the ith window 
created at x=y=30+26*(i%9))


But, if the PPosition or USPosition flags in WM_NORMAL_HINTS are set, 
the -multiwindow mode window manager places the window as requested.


(Most toolkits will set USPosition if you explicitly specify a window 
position e.g. using a -geometry option)


I guess that Wine is setting one of these flags so it can emulate 
Windows window placement.



The behavior I would expect is for 0,0 in the buffer to be mapped to 0,0
in screen coordinates, 1920x, 1080y in my configuration.


Unfortunately, X window coordinates are defined to be positive, with 0,0 
being the top-left of the desktop.


So, while you could do this with the -screen option (e.g -screen 0 @1), 
to move the origin to your primary monitor, windows which are moved to 
the left or above of that probably won't render correctly.


If you can't turn off the placement behaviour in Wine, perhaps the best 
compromise might be to use something like '-screen 0 5760x1080+0+1080' 
so you have an X desktop which covers the bottom 3 screens, and avoid 
moving X windows into the 4th screen?



To clarify my use of Wine, I connected to a remote CentOS 6.5 machine
via ssh with x forwarding for testing.

Can anyone provide some insight on this?


There is some code in XWin which attempts to ensure that the window is 
placed somewhere visible, but that assumes that the Window virtual 
desktop is a rectangle of size GetSystemMetrics(SM_CXVIRTUALSCREEN) x 
GetSystemMetrics(SM_CYVIRTUALSCREEN).


I think it should be pretty straightforward to change this, perhaps to 
use MonitorFromPoint() to determine if the window will be visible on a 
non-rectangular virtual desktop.


--
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/