Tuesday, January 29, 2008

RegexKit 0.6.0

This release upgrades PCRE to version 7.6, which includes an important security related bugfix. All users are encouraged to upgrade. Other changes include preliminary support for internationalization, returning NSError objects, and the ability to evaluate multiple regular expressions in a collection concurrently on multiple threads, one per CPU.

GNUstep 2.0 (FHS) Binary Packages for openSUSE 10.2 on i586

Announcement and Web Page.

Monday, January 28, 2008

Ink, a GNUstep text editor, and Services

Ink is originally written as an example for GNUstep text view and has many latest features. You can get it from svn by execute this:

svn co http://svn.gna.org/svn/gnustep/tests/examples/trunk/gui/Ink Ink

Ink-1

It can read plain or rich text file. Fonts and colours can be easily changed. To change colours, make a selection of text and drag a colour onto the selection. There is no 'set' button on colour panel. You can have rulers and change positions of tabs. The tab stops seems to only support left alignment for now. To remove a tab stop, click and hold on it, then move it away off the ruler. Your mouse cursor may not follow, but the tab stop will disappear. Undo is working good and supports multiple undoings. Image can be inserted by using menu "Document > Insert File..." or pasted from other applications. Paragraphs can be aligned to left, center or right. You can have spell checking if you set it up correctly. You can also print your document or save it as PostScript file. The results may depend on the backend you use. Cairo backend is supposed to work better in this case. Ink mostly uses standard GNUstep components. So many of these functionalities are also available to other applications using GNUstep text view by default.

There are other choices of text editors, like TextEdit or Typewriter. They all work more or less the same. I would suggest to stick with Ink for now. For developers, Bean may be a good candidate to port to GNUstep, but you may need to improve GNUstep text system first.

Ink is also a good example of using Services in GNUstep. This Cocoa document from Apple explains the concept of services. You can download some examples of services by doing this:

svn co http://svn.gna.org/svn/gnustep/tests/examples/trunk/gui/ExampleService ExamplesService

After installation, execute `make_services` to update your system services. Now, use Ink to open a document and make a selection. Choose menu Services and you will see all available services. For example, you can change case of selected text. These services are context-sensitive and are only enabled when they can handle the selection of text or images. Services allow you to easily access functions from other applications without switching applications. Many GNUstep applications provide services. We will mention them later. As long as you can make a selection in GNUstep applications, you probably can use services. To conclude this article, LaTeX Service may be worth to take a look. It allows you to type a LaTeX text in any text view and use services to render them as embedded image. Pretty nice.



Previous articles in this series:

  • Gomoku and Localization in GNUstep
  • Font Manager and GNUstep Backend
  • System Preferences and Theme

  • Wednesday, January 23, 2008

    VolumeManager

    VolumeManager is basically a GNustep daemon/tool that uses HAL and DBUS to detect newly attached / removed / mounted / unmounted volumes. What does it do further? Well, a GNUstep application can register itself as DO client at VolumeManager and will get notified about such changes and may also use DO to mount/unmount volumes. Moreover, VolumeManager can be configured such that is automatically mounts new data volumes or that it automatically plays audio CDs or DVDs using GNustep services. In addition to the daemon the package contains a plugin to SystemPreferences to configure VolumeManager and it does contain a menulet for Étoilé's menu server that displays mounted volumes and allows to unmount them.

    CDPlayer 0.5

    It is quite a while since last update.

    Monday, January 21, 2008

    System Preferences and Theme

    If you are not a command-line person to use defaults, there is a System Preferences to help you on some of the settings, but not all.

    SystemPreferences-1

    Some people complain that GNUstep color scheme is too dark. The root of problem is because most monitors are not properly calibrated. Color Scheme allows you to change the scheme as a whole or on individual color. There are three default color schemes to choose.

    SystemPreferences-2

    Date & Time is for time zone. Find your city and click on it. It is equivalent to

    defaults write NSGlobalDomain NSTimeZone 'MyPlace'.

    SystemPreferences-3

    You can find the valid name for time zone in GNUstep/System/Library/Libraries/gnustep-base/Versions/1.15/Resources/NSTimeZones/zones. It is quite obvious that System Preferences is easier to use in this case.

    SystemPreferemces-5

    Fonts is the same as what we mentioned in previous article about NSFont and others. A good thing of using System Preferences is that you don't need to guess the font name any more. It does not support NSPreferredFonts, but it is good enough.

    SystemPreferences-4

    Defaults list all possible settings for GNUstep. You can see the GSBackend as we introduced before. It is quite convenient to know what GNUstep supports and what are the valid values for these settings. User Defaults Summary also explains some of the settings and possible values.

    SysmtePreferences-6

    Modifier Keys map your physical keyboard to modifier key, like Ctrl, Alt and Option. You should read Keyboard Setup to know what Control, Command and Alternative mean. Then how do you know your physical right "Shift" maps to Right Hyper, Right Super or any other choice ? You can start a program xev and try each of your modifier key. You should be able to see something like this:

    KeyRelease event, serial 30, synthetic NO, window 0x3200001,
    root 0x3f, subw 0x0, time 1896953680, (375,276), root:(380,325),
    state 0x40, keycode 115 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

    This is what it prints when I release the left Apple command key. You can tell it is called Super_L in X window. Then it is what System Prerences calls Left Super. You can also use defaults directly. Super_L is the value to used. You can always use this command to see what is in the user defaults:

    defaults read NSGlobalDomain

    Other preferences are mostly used by GWorkspace, which will be talked about some time later.

    It is possible to have different theme of GNUstep. The solution is to install a user bundle to override the default GNUstep drawing. User bundles will be loaded automatically in any GNUstep application. It is specified in user defaults NSAppKitUserBundles. One side effect of this approach is that the user bundle has to be in sync with GNUstep. And bugs in user bundles may affect all of your GNUstep applications. Camaelon is the first one to support theme on GNUstep. You can download it from Étoilé project:

    svn co http://svn.gna.org/svn/etoile/trunk/Etoile/Bundles/Camaelon Camaelon

    Once installed, it will be under your GNUstep/System/Library/Bundles/Camaelon.themeEngine.

    Then add the full path of Camaelon bundle in user defaults:

    defaults write NSGlobalDomain NSAppKitUserBundles '( "/usr/local/GNUstep/System/Library/Bundles/Camaelon.themeEngine" )'

    Next time you start any GNUstep application, it may look like this:

    Camaelon-2

    And this is the default GNUstep theme:

    Camaelon-1

    GNUstep is still under development and Camaelon is not actively developed recently. So your milage may vary. Another theme engine is Narcissus. After installed, add its full path into user defaults:

    defaults write NSGlobalDomain GSAppKitUserBundles '("/usr/local/GNUstep/Local/Library/Bundles/Narcissus.themeEngine")'

    Note that Narcissus is installed in Local by default. And this is a screenshot of it:

    Narcissus-1

    Narcissus is written more recently and its source codes may be more cleaner than Camaelon, but it is still in early stage and is less tested. Camaelon starts as an experiment to support theme on GNUstep and some of these methods are incorporated in GNUstep later. With recent changes in GNUstep, it may need some updates. Again, any change in GNUstep may affect these theme engines. If your GNUstep application has weird behaviors, you can remove the theme in user defaults by

    defaults delete NSGlobalDomain NSAppKitUserBundles

    It will fall back to default GNUstep theme.



    Previous articles in this series:

  • Gomoku and Localization in GNUstep
  • Font Manager and GNUstep Backend

  • Saturday, January 19, 2008

    SimpleAgenda 0.36

    See announcement for details:
    * Calendar UI changes : to reduce calendar size, use different visual hints. Today has a yellow background (unchanged), the selected day cell is bezeled/pushed (was a bold font) and busy days use a bold font (instead of a tick mark). Always show six weeks with black text for the chosen month and white text for the previous and next ones. Use a defined font size so that it all fits whatever the user choose as a default size.
    * Day view : circle through appointments with TAB and edit the selected one with enter
    * Day view : no more appointments overlapping. The algorithm is not 100% correct, we might want to change that in the future
    * Change license for future GNUstep GPLv3 release compatibility Thanks to Yavor Doganov for pointing out the issue.
    * Use ETags to prevent overwriting distant modifications
    * Add a menu item to force agendas to reload their data
    * Bug fixes and various improvements
    * Experimental GroupDAV support : some things work but use with care. Feedback appreciated

    Thursday, January 17, 2008

    Font Manager and GNUstep Backend

    Since a few font-related things were brought up in the previous article, there is a GNUstep application, Font Manager, to view installed fonts in the system. To download it from svn, execute this:

    svn co http://svn.gna.org/svn/etoile/trunk/Etoile/Services/User/FontManager FontManager



    You can see a list of fonts in the system and preview text with different fonts, sizes and colours. Different styles of the same font is grouped together. It is quite convenient to see them all and pick the good ones to use. Then where is the font name to be used in user defaults of NSFont and NSPreferredFonts as in previous article ? To know the answer, you need to know which GNUstep backend you are using.

    GNUstep provides different backends to draw text and graphics. The default one is art backend and the alternative one is cairo backend. If you install GNUstep without knowing anything about backend, you probably have art backend. By default, you will see only one font in Font Manager, Helvetica, unless you install extra ones as in previous article. Art backend use nfont package as discussed here. If you look into nfont package, you will find a file FontInfo.plist. For each style (face) of font, there is a corresponding PostScriptName. This PostScriptName is the name you will use in NSFont and NSPreferredFonts.

    Cairo backend use fontconfig instead of nfont package. In this way, it shares fonts with X window. The font name to use in user defaults is less obvious. You can try the name listed under Fonts in Font Manager or the name in the preview panel on the most right. The rule of thumb is that if you want to use normal font, do not add Roman in font name. If you do want bold or italic font, you should use the name on the preview panel containing Bold, Italic, or others.

    To show the difference, this is the screenshot from art backend:

    FontManager-1

    And this is from cairo backend:

    FontManager-2

    While cairo backend handles graphics better, art backend does supports ligature nicely.

    For advanced users, you can switch between backends easily. As mentioned in INSTALL of gnustep-back, you can install art backend and cairo backend side-by-side:

    ./configure --enable-graphics=art --with-name=art; make; sudo make install

    ./configure --enable-graphics=cairo --with-name=cairo; make; sudo make install

    Then you can select backend with

    defaults write NSGlobalDomain GSBackend libgnustep-cairo

    or

    defaults write NSGlobalDomain GSBackend libgnustep-art

    If you specify fonts for NSFont or NSPreferredFonts, remember that these two backends may use different font name. Therefore, you may get warnings about missing font when you switch from one backend to another.

    Font Manager works on both Mac OS X (Cocoa) and GNUstep. It plans to support font enable and disable. It may be challenging because Cocoa, art backend and cairo backend all use different mechanism to manage fonts.



    Previous articles in this series:

  • Gomoku and Localization in GNUstep


  • Wednesday, January 16, 2008

    Sunday, January 13, 2008

    Gomoku and Localization in GNUstep

    This is the first post of a series of articles about GNUstep applications. The purpose is to introduce useful GNUstep applications to regular users and provides some tips. These applications can be used on daily basis, though it doesn't mean they are perfect or bug-free. Any problem should be reported to the original authors or in GNUstep maillist.

    Gomoku is an extended TicTacToe game for GNUstep. It is small and fun to play. You first click on the board to put a white piece, then try to have 5 white pieces adjacent to each other horizontally, vertically or diagonally like this:

    Gomoku-1

    If you think it is too easy, you can increase the difficulty under Info menu:

    Gomoku-2

    Now, computer seems very smart:

    Gomoku-3

    You can also increase the size of board by executing it with the size of board like this:

    openapp ./Gomoku.app 10

    The size must be bigger than 8.

    Gomoku is a good example to test internationalization (i18n) and localization (i10n) in GNUstep because it is small and simple to do so. It is already localized in 9 languages and you should have no problem using it with your native language. In some cases, depending on your system, you may have some difficulties to see your native language. This article summarizes the steps to take for art backend. Here shows another example in cairo backend. The steps are mostly identical.

    GNUstep is smart enough to guess your language, Execute `echo $LANG` or `echo $LC_CTYPE` to know your locale. In my case, it is en_US.UTF8. So my system is in UTF8 encoding and uses English. If I decide to use German in Gomoku, I have to specify the language in user defaults by executing

    defaults write NSGlobalDomain NSLanguages "(German, English)"

    It tells GNUstep to find the German localization first, then English. Unfortunately, it is not enough for me. The German localization is in different encoding than mine (UTF8). I guess it is in ISO 8859-1 encoding. So I set an environment variable GNUSTEP_STRING_ENCODING like this:

    export GNUSTEP_STRING_ENCODING=NSISOLatin1StringEncoding

    Now, the menu is in German:

    Gomoku-4

    Note both NSLanguages and GNUSTEP_STRING_ENCODING affect all GNUstep applications.

    If I want to go further to use Traditional Chinese, the default font of GNUstep may not have Chinese characters in it. So I need to specify the default font by doing this:

    defaults write NSGlobalDomain NSFont "AR PL ShanHeiSun Uni"

    And select the language and encoding:

    defaults write NSGlobalDomain NSLanguages "(TraditionalChinese, English)"

    export GNUSTEP_STRING_ENCODING=NSBIG5StringEncoding

    Now, it shows Chinese:

    Gomoku-5

    If you work on many languages and specifying a single font for NSFont doesn't suit you, you can try NSPreferredFonts, but it only works on art backend. First, you can download pre-packed fonts from Étoilé Project. Look for etoile-default-fonts.tar.gz. Unpack and move the nfont package (.nfont) into your ~/GNUstep/Library/Fonts/ or in the system GNUstep/System/Library/Fonts/. Then specify the preferred fonts:

    defaults delete NSGlobalDomain NSFont

    defaults write NSGlobalDomain NSPreferredFonts '("ShanHeiSun-Uni")'

    In this way, GNUstep will try to use the preferred fonts if it cannot find the glyphs in the default font. Again, it only works for art backend for now. If you do not specify NSPreferredFonts, GNUstep will go through all of your fonts to find the glyphs, It may pick up the font you don't like. So it is better to specify the NSPreferredFonts.

    For developers who wants to support NSPreferredFonts in cairo backend, try to implement -coveredCharacterSet and -numberOfGlyphs in back/Source/cairo/CairoFontInfo.m. You can use back/Source/art/ftfont.m as a reference.

    Monday, January 07, 2008

    Thursday, January 03, 2008

    GNUstep Packages for Slackware 12.0

    There are packages for both stable and unstable releases of GNUstep.