Commit graph

938 commits

Author SHA1 Message Date
fredkiefer
36283735ab * Source/cairo/CairoFontInfo.m,
* Source/fontconfig/FCFontEnumerator.m: Small cleanup of last pull
request.
2019-05-19 22:56:48 +02:00
Fred Kiefer
8691c48537
Merge pull request #5 from Deek/deek
Font system revamp
2019-05-19 18:06:46 +02:00
Fred Kiefer
d2d0e6650a
Merge pull request #11 from trunkmaster/master
Mouse cursor images handling fix and cleanup
2019-05-01 14:15:14 +02:00
Gregory John Casamento
d5f2097261 Add changes to address 16 bit support in Xlib. Need to test 2019-04-20 11:17:57 -04:00
Sergii Stoian
00a1180684 * Source/x11/XGServerWindow.m (standardcursor::): Getting of
XC_fleur as GSCloseHandCursor was removed because it loads in
NSCursor as image.
2019-04-20 02:01:40 +03:00
Sergii Stoian
39e2e16bec * Source/x11/XGServerWindow.m (standardcursor::): revert resizing
cursor names to the old values upon request of project owner.
2019-04-18 01:22:57 +03:00
Sergii Stoian
d4a4888b9d * Source/x11/XGServerWindow.m (getStandardBitmap): send bitmapFormat
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.
2019-04-17 18:06:19 +03:00
Sergii Stoian
b5003272a7 * Source/x11/XGServerEvent.m (mouseOptionsChanged:): change double-click
minimum value to 200 and default to 300.
2019-04-12 15:45:39 +03:00
Sergii Stoian
59b1f51e5f * Source/x11/XGServerEvent.m (processEvent:): do not send event if
disabled menu mouse button was released.
2019-04-11 13:15:09 +03:00
Sergii Stoian
7981c3e41c * Source/x11/XGServerEvent.m (initializeMouse): new method. Calls -mouseOptionsChanged:
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.
2019-04-11 01:50:30 +03:00
Sergii Stoian
2f4c96f9d1 hidewindow method was renamed to hideApplication. 2019-04-06 22:32:29 +03:00
Sergii Stoian
b492ac87cd Added support for WindowMaker's WMFHideApplication action. 2019-04-05 14:46:05 +03:00
Sergii Stoian
f9958176db Do not send NSEvent only for single-click on appicon and minindow in WindowMaker environment. 2019-04-04 12:10:47 +03:00
Sergii Stoian
21f38f8060 Send double-click on appicon to the WindowMaker. Old code sent to WM only single-click. 2019-04-04 01:22:25 +03:00
Sergii Stoian
233c129a5c WM_IGNORE_FOCUS_EVENTS atom was added. Use new atom in orderwindow::: code added in last commit. 2019-04-03 19:13:30 +03:00
Sergii Stoian
a6595e320d Map application icon window without focus switch for applications executed with argument -autolaunch YES in WindowMaker environment. 2019-04-02 19:38:44 +03:00
Sergii Stoian
0374820172 Set Utility window type for NSFloatingWindowLevel. 2019-03-26 17:12:55 +02:00
Jeff Teunissen
f87842d08a Turn on hinting and subpixel rendering for Cairo.
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.
2019-03-26 03:58:18 -04:00
Jeff Teunissen
d519e8542b Stub code for SFNT access
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.
2019-03-26 03:58:18 -04:00
Jeff Teunissen
8f19df1949 Support named glyphs, encodings in Cairo
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.
2019-03-26 03:58:18 -04:00
Jeff Teunissen
1b23bfe1fd Better sorting of fonts
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.
2019-03-26 03:58:18 -04:00
Jeff Teunissen
d0a9f5b943 Handle "strange" font weights
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.
2019-03-26 03:58:18 -04:00
Jeff Teunissen
5737e249f5 fix 'italic' detection
Don't check for italic, check for slant greater than roman. That way, we
catch oblique (which is more slanted than 'italic') too.
2019-03-26 03:58:18 -04:00
Jeff Teunissen
8df5bb1064 More postscriptname support
Support reading the PS name from a pattern.
2019-03-26 03:58:18 -04:00
Jeff Teunissen
325c927814 fontconfig: use fullname for displayName (most of the time)
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.
2019-03-26 03:58:18 -04:00
Jeff Teunissen
ecba94053d sort font faces
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.
2019-03-26 03:58:18 -04:00
Jeff Teunissen
233e44dc4c Support fontconfig 2.11's new 'postscriptname' attribute.
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. :)
2019-03-26 03:58:18 -04:00
Jeff Teunissen
016f5eda25 Cairo: Reduce the hilarity of the font panel
Use many more weights and widths when generating the (still extremely
stupid) synthetic PostScript font names.
2019-03-26 03:58:18 -04:00
Jeff Teunissen
390f82f064 make displayName work 2019-03-26 03:58:18 -04:00
fredkiefer
fd84d377f2 * Source/opal/OpalGState.m: Add colour handling for all the different
colour spaces.
2019-01-03 23:06:51 +01:00
Pavel Shlyak
3b7f8f0e84
Fix memory leaks in convert.c 2018-12-31 23:42:17 +04:00
fredkiefer
d9bc28c4ca * Source/gsc/GSGState.m (-setColor:state:): Don't copy values onto themselves. 2018-12-02 12:36:28 +01:00
fredkiefer
442eb2515e * Source/opal/OpalContext.m (-initWithGraphicsPort:flipped:): Implement.
* 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.
2018-09-16 17:27:48 +02:00
fredkiefer
7ee9b40793 * Source/x11/XGServerWindow.m (_setupRootWindow): Make sure the
root name variable is null terminated.
2018-07-16 08:39:55 +02:00
fredkiefer
6e797c9e6d * Source/x11/XGServerWindow.m: Check for bytes_after_ret in
PropGetCheckProperty. Attempt to improve the window border detection.
Based on idea by Tom MacSween <Tom.MacSween@crins-sinrc.ca>
2018-06-20 07:49:36 +02:00
fredkiefer
b9e9f461ab Restructure Atom handling to get all atoms at once.
Add new method on XGServer to get the name of the window manager.
2018-05-01 23:08:35 +02:00
fredkiefer
969b77a6c1 * Source/x11/XGServer.m (_initXContext): Call XInitThreads to
enable drawing in secondary threads.
2018-02-09 21:56:01 +01:00
fredkiefer
1a15d0393e Replace xlib specific font enumerator with the shared one for fontconfig.
Add glyph cache for GSXftFontInfo.
2018-02-05 20:50:48 +01:00
fredkiefer
97011b4952 Merge branch 'master' into opal-bridge 2017-08-07 14:10:42 +02:00
fredkiefer
c379156931 Get DPSshow: to work on scaled windows. 2017-07-31 23:33:34 +02:00
Daniel Ferreira
5f62df88d3 opal/bridge: implement bridge between GUI and Opal types
Implement a bridge between NSColor and CGColorRef and a stub for a
bridge between NSImage and CGImageRef. This improves compatibility with
Quartz.
2017-07-25 11:59:52 +10:00
Daniel Ferreira
720a56dcf3 opal/context: allow the client to supply a graphics port
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.
2017-07-25 11:59:52 +10:00
Fred Kiefer
3adb72d6e2 Fix some clang static analyser warnings reported by
Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@40485 72102866-910b-0410-8b05-ffd578937521
2017-04-16 11:57:05 +00:00
Fred Kiefer
9f84d3e7fc * Headers/x11/XGGeneric.h: Remove obsolte atom.
* 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
2017-01-17 22:01:52 +00:00
Fred Kiefer
168e6f1347 * Source/x11/XGServerWindow.m (-_checkStyle:): Ignore invalid
border information.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@40286 72102866-910b-0410-8b05-ffd578937521
2017-01-08 21:01:01 +00:00
Riccardo Mottola
84db7e1e78 include -> import
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@40169 72102866-910b-0410-8b05-ffd578937521
2016-10-23 20:51:20 +00:00
Fred Kiefer
7befdbcf6b Small opal changes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@40047 72102866-910b-0410-8b05-ffd578937521
2016-08-02 20:48:01 +00:00
Riccardo Mottola
41804841f2 add missing header to fix warning
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@40032 72102866-910b-0410-8b05-ffd578937521
2016-07-26 07:28:27 +00:00
Fred Kiefer
879abf5d3b Output the Postscript font name.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@39999 72102866-910b-0410-8b05-ffd578937521
2016-07-15 17:10:21 +00:00
Ivan Vučica
162534acd1 Add return type 'id' to -[GSGState copyWithZone:] method definition.
Cherrypicking gnustep_testplant_branch r39614.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@39636 72102866-910b-0410-8b05-ffd578937521
2016-04-06 20:43:32 +00:00