to _convertToFormatBitsPerSample::::::::. Fixes display of colored
mouse cursor images.
(standardcursor::): cleanup in Xlib cursors handling. Additional
cursor types were added: GSClosedHandCursor, GSOpenHandCursor.
Removed GSDisappearingItemCursor type handling - it loads in NSCursor
from image.
and setups observer for defaults changes.
(mouseOptionsChanged:): new method. Read mouse properties from user defaults.
(processEvent:): respect mouse options on ButtonPress and ButtonRelease events.
* Source/x11/XGServer.m (dealloc): remove notification observer.
There's no good reason not to enable subpixel rendering and hinting.
Leaving it off makes GNUstep apps look worse than everything else, in
exchange for having -advancementForGlyph: be totally consistent, which
may not even be necessary.
So, yeah, let's just turn this stuff on. I reused the subpixel default
from back-art to preserve configs, and added a GSFontHinting default to
control text hinting.
Use 0 for whatever Cairo defaults to, 1 for off, 2 for slight hinting,
3 for medium hinting, or 4 for full hinting.
Some simple code for getting access to the main SFNT tables used for
drawing the right glyphs in the right ways. It's hidden with an "#if 0" for
future use.
Implement a method for accessing named glyphs and character codings from
Cairo.
This is a necessary first step for complex glyph substitution, and even
simple things like standard ligatures.
Rather than sorting fonts by the integer value of "traits", let's sort by
the traits we are looking for specifically. Again, like many other things,
totally correct handling of this stuff will have to wait for a good method
of inspecting and correctly processing SFNT tables.
Fontconfig's font weights are almost but not entirely defined by the
constants found in its source code. Things like FC_WEIGHT_LIGHT are not,
as we had presumed, a list of definitive weights. As such, it seems there
are a goodly number of fonts that have weights not appearing in the list.
For example, say there's a font that is heavier than Medium (weight 100 for
fontconfig, and 6 for us) but not as heavy as Demibold (FC: 180, GS: 7),
then it might tell Fontconfig it has a weight of 130.
When this happens, we _could_ assign its NSWeight to be 6 or 7, but it's
possible that there will be another face in that font that ALSO fits there,
which might throw off the sorting. Instead, what I suggest is to do what
I have done...assign an NSWeight with a weight class that represents the
numeric distance _between_ the two defined values.
So the GS weight for this font face becomes something like:
NSWeight = 6 + ((FCWeight - Medium) * (1.0 / (Demibold - Medium)))
or, in numeric terms, 6 + 0.375
In service of this change, I have switched the actual Weight value within
the font dictionary from int to float. This is an attempt to translate this
situation into a sortable form we can work with, compressing an approximate
range of possible FC font weights into our 0-15 system.
There may well be a better way to go about this, such as figuring out where
fontconfig gets this info in the first place and converting from the source
directly, but accessing the SFNT tables (which will almost certainly be
required) is something for a later day.
Can't use fullname ALL the time, because some (mostly Adobe) fonts store
a duplicate of their PostScript name in the fullname field (and for that
case, we can just do what we already did), but it works well for just about
everything else.
GNUstep's font architecture makes it extremely difficult and annoying to
have a properly sorted font panel (or even one that makes any sense at all).
This might not be the best place to implement font sorting, but I'll be
damned if I can find a better one. The font enumerator knows where to look,
and has all the information needed to do it.
So, once we've enumerated all the fonts, sort them with a function that's
only slightly more clever than alphabetizing them. We sort by these
criteria, in order of importance:
1. font weight
2. traits (numeric ordering)
3. style name, with special cases so "Regular"/"Normal"/"Roman" sort
earlier than other stuff (caption, titling, etc.)
This sorting function seems to work about as well as can be expected,
producing the obvious "Regular"/"Italic"/"Bold"/"Bold Italic" for
undemanding families, while getting more advanced ones (like, say, the 168
font faces of Kepler Std) pretty close.
GNUstep has been bending over backwards to deal with fontconfig's baffling
lack of support for PostScript-style font names, just as it bent over
backwards to deal with XLFD's lack of same. Luckily, the fontconfig guys
have done us (and let's be honest, ghostscript and every pdf reader in
creation) a solid, and now that it's here it would be downright criminal
to not use it.
Implement it. :)
* Source/opal/OpalContext.m (-GSSetDevice:::): Get height form
surface if no y value is given.
* Source/opal/OpalSurface.m: Rewrite to handle the case where
device is not set.
In Quartz, the "graphics port" bound to an NSGraphicsContext (subclassed
by OpalContext) is a CGContext. We currently initialize one in
OpalSurface if it does not exist, however we do not allow the client to
initialize a graphics context with a custom graphics port, which should
be allowed. This commit enables this feature.
* Source/x11/XGServerWindow.m: Clean up code.
* Source/x11/XGServerWindow.m (-setwindowlevel::): Try to set
better level for tool tip windows.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@40295 72102866-910b-0410-8b05-ffd578937521
frame offsets when using WindowMaker. This fixes the issue that the
first GNUstep application started under WindowMaker did not get a
proper application menu.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@39171 72102866-910b-0410-8b05-ffd578937521
detection from process_key_event() to here to enable filtering
out keyUp events as Cocoa does.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@39078 72102866-910b-0410-8b05-ffd578937521
Fix bug that caused F11 keypresses to become F12.
Patch by Adam Fox <adam.fox@testplant.com>
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@38881 72102866-910b-0410-8b05-ffd578937521
abs -> fabs
* Source/x11/XGGLContext.m
format string fix
* Headers/x11/XGOpenGL.h
glxminorversion is int, not long int
Looks good, Ivan Vucica
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@38554 72102866-910b-0410-8b05-ffd578937521
for patternPhase.
Patch by Josh Freeman <gnustep_lists@twilightedge.com>
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@38527 72102866-910b-0410-8b05-ffd578937521
Richard's frontend based expose code.
* Source/x11/XGServerWindow.m (-window::::, -_checkStyle:):
Don't use CWBackPixel, as the window background may be different.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@38419 72102866-910b-0410-8b05-ffd578937521
* Source/x11/XGServerWindow.m: Correct name for atom
net_wm_state_modal_atom. Use this atom to try to set the sate
for dialog windows to modal.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@38417 72102866-910b-0410-8b05-ffd578937521
Switch monitor logging to Debug level.
Patch by Jonathan Gillaspie <jonathan.gillaspie@testplant.com>
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37640 72102866-910b-0410-8b05-ffd578937521
identifier used by the backend's windowing system instead of
just the GNUstep-internal window number. On X11, the identifier
is useful, among other things, to implement the D-Bus menu
protocol.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37533 72102866-910b-0410-8b05-ffd578937521
* Source/cairo/CairoFaceInfo.m (-drawGlyphs:...): Use scaled
font directly.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37523 72102866-910b-0410-8b05-ffd578937521
-setWindowdevice:forContext:): Move code from last patch around a bit.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37475 72102866-910b-0410-8b05-ffd578937521
memory leak noticed by Riccardo with the cairo backend,
by #ifdef-ing out this method when using cairo.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37471 72102866-910b-0410-8b05-ffd578937521
to a separate method. Implement -glyphIsEncoded:, -advancementForGlyph:,
-glyphForCharacter:, -glyphWithName:.
For -boundingRectForGlyph:, and -widthOfString:, return fake, fixed
values.
* Source/opal/OpalContext.m: Fix -isDrawingToScreen implementation;
it now returns YES. This has the unfortunate side effect of breaking
image drawing... but, on the positive side, causes NSLayoutManager
to make calls to GSShowGlyphsWithAdvances in batches of up to
16 glyphs, instead of one at a time...!
* Source/opal/OpalGState.m: Implement -GSSetFont:, and make
-GSShowGlyphsWithAdvances: call CGContextShowGlyphsWithAdvances
Overall state is glyphs are drawn.. they appear upside down,
and the glyph runs only seem to draw at (0, 0).
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@37087 72102866-910b-0410-8b05-ffd578937521