< ] [ GCL Home ] [ CGI Tutorial ] [ Home ]

The Graphic Counter Language, Page 6

Creating Vertical Counters

Certain languages are written vertically rather than horizontally. It may also make for an interesting design when using Roman alphabet (a purist might say the digits used by Roman alphabet are actually Arabic, but Arabic is written right-to-left, and I do not want to confuse you).

It is a matter of entering the vertical keyword somewhere in your GCL source file. Your counter is instantly transferred into a vertical image.

Some of the keywords we have learned so far will, however, be ignored as they do not apply to vertical counters. I am talking about the align keyword as we have used it in a previous example.

The counter we will develop here does not require any kind of alignment. All of its digits are in graphics of the same size, so it is irrelevant how they are aligned.

Nevertheless, you can align vertical graphics by using the align left, align center, and align right keywords. Again, you can follow each of these command by a plus or a minus and a number. For example, adding + 15 will move a digit, comma, head, or tail, fifteen pixels to the right.

I have chosen Chinese pictographs for this example. These graphics come from the same artist who designed the abacus graphics we used on page 5 (Ashley Chang). He named his design Kai-Shu, so I saved the gifs in Kai0Shu.gif - Kai9Shu.gif.

The source code for KaiShu.gcl is quite straightforward, and should be, by now, self-explanatory. Here it is, along with the resultant counter:

#!/usr/bin/gcl
#0 "/usr/pix/Kai0Shu.gif" gif
#1 "/usr/pix/Kai1Shu.gif" gif
#2 "/usr/pix/Kai2Shu.gif" gif
#3 "/usr/pix/Kai3Shu.gif" gif
#4 "/usr/pix/Kai4Shu.gif" gif
#5 "/usr/pix/Kai5Shu.gif" gif
#6 "/usr/pix/Kai6Shu.gif" gif
#7 "/usr/pix/Kai7Shu.gif" gif
#8 "/usr/pix/Kai8Shu.gif" gif
#9 "/usr/pix/Kai9Shu.gif" gif
vertical

Copyright © 1999 G. Adam Stanislav
All rights reserved

That's it for our introductory tutorial. Click on the counter to return to the GCL home page, or choose from the menu below.

< ] [ GCL Home ] [ CGI Tutorial ] [ Home ]