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 Ink


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 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

  • No comments: