Entries Tagged as 'polytonic'

How to easily modify a program in Ubuntu (updated)?

Some time ago we talked about how to modify easily a program in Ubuntu. We gave as an example the modification of gucharmap; we got the deb source package, made the change, compiled, created new .deb files and installed them.

We go the same (well, similar) route here, by modifying the gtk+ library (!!!). The purpose of the modification is to allow us to type, by default, all sort of interesting Unicode characters, including ⓣⓗⓘⓢ , ᾅᾷ, ṩ, and many more.

The result of this exercise is to create replacement .deb packages for the gtk+ library that we are going to install in place of the system libraries. Because these new libraries will not be original Ubuntu packages, the update manager will be pestering us to rollback to the official gtk+ packages. This is actually good in case you want to switch back; you will have the enhanced functionality for as long as you postpone that update.

There is a chance we might screw up our system, so please make backups, or have a few drinks first and come back. I take no responsibility if something bad happens on your system. If you are having any second thoughts, do not follow the next steps; use the safer alternative procedure. You may try however this guide just for the kicks; up to the dpkg command below, no changes are being made to your system.

We use Ubuntu 7.10 here. This should work in other versions, though your mileage may vary.

The compilation procedure takes time (about 30 minutes) and space. Make sure you use a partition with >2GB of free space. We are not going to use up 2GB (a bit less than 1GB), but it’s nice not to fill up partitions.

We are going to use the generic instructions on how to recompile a debian package by ducea.

First of all, install the development packages,

sudo apt-get install devscripts build-essential

Next, we use the apt-get source command to get the source code of the GTK+ 2 library,

cd /home/ubuntu/bigpartition_over2GB/
apt-get source libgtk2.0-0

We then pull in any dependencies that GTK+ may require. They are normally about a dozen packages, but we do not have to worry for the details.

apt-get build-dep libgtk2.0-0

At this stage we need to touch up the source code of GTK+ before we go into the compilation phase. Visit the bug report #321896 – Synch gdkkeysyms.h/gtkimcontextsimple.c with X.org 6.9/7.0 and download the patch (look under the Attachment section). You should get a file named gtk-compose-update.patch. If you have a look at the patch, you will notice that it expects to find the source of gtk+ in a directory called gtk+. Making a link solves the problem,

ln -s libgtk2.0-0 gtk+

We then attempt to apply the patch (perform a dry run), just in case.

patch -p0 --dry-run < /tmp/gtk-compose-update.patch

If this does not show an error message, you can the command again without the –dry-run.

patch -p0 < /tmp/gtk-compose-update.patch

Finally, we are ready to build our fresh GTK+ library.

cd libgtk2.0-0
debuild -us -uc

This will take time to complete, so go and do some healthy cooking.

At the end of the compilation, if all went OK, you should have about a dozen .deb files created. These are one directory higher (do a “cd ..“). To install, use dpkg,

dpkg -i *.deb

If you have any other deb files in this directory, it’s good to move them away before running the command. If all went ok, the .deb files should install without a hitch.

The final step is to restart your system. To test the new support, see the last section at this post. Use Firefox and OpenOffice.org to type those Unicode characters.

If you managed to wade through all these steps, I would appreciate it if you could post a comment.

Good luck!

StixFonts, finally available (beta)!

The STIX Fonts project (website) has been developing for over 10 years a font suitable to be used in academic publications. It boasts support from Elsevier, IEEE and other academic publishers or associations.

A few days ago, they published a beta version of the font in an effort to get public feedback. The beta period runs until the 15th December.

STIX Fonts Beta showing Greek (Regular), from STIX Fonts Beta

STIX Fonts Beta currently support modern Greek. An effort to get support for Greek Polytonic did not work out well a few years back.

STIX Fonts Beta showing Greek (Italic), from STIX Fonts Beta

The main benefit of STIX Fonts is the support for mathematical and other technical symbols. This helps when writing academic publications and other technical documents.

STIX Fonts Beta showing Greek (Bold), from STIX Fonts Beta

STIX Fonts have extensive support of mathematical symbols, symbols that exist in Unicode Plane-1.

STIX Fonts Beta showing Greek (Bold Italic), from STIX Fonts Beta

If there is any modification that we would like to have in STIX fonts, we should do now. Once they are released, they will be widely distributed. Currently, Fedora has packaged STIX Fonts and made them available already.

Cannot write Greek Polytonic in Linux

Update 3rd May 2008: If you have Ubuntu 8.04 (probably applies to other recent Linux distributions as well), you simply need to add GTK_IM_MODULE=xim to /etc/environment. Start a Terminal (Applications/Accessories/Terminal) and type the commands (the first command makes a backup copy of the configuration file, and the second opens the configuration file with administrative priviliges, so that you can edit and save):

$ gksudo cp /etc/environment /etc/environment.ORIGINAL
$ gksudo gedit /etc/environment

then append

GTK_IM_MODULE=xim

save, and restart your computer. It should work now. Try to test with the standard Text editor, found in Accessories.

In Ubuntu 8.10 (autumn 2008), it should work out of the box, just by enabling the Greek Polytonic layout.

Update 20th June 2008: If still some accents/breathings/aspirations do not work, then this is probably related to your system locale (whether it is Greek or not). It works better when it is Greek. If you are affected and you do not use the Greek locale, there is one more thing to do.

$ gksudo cp /usr/share/X11/locale/en_US.UTF-8/Compose /usr/share/X11/locale/en_US.UTF-8/Compose.ORIGINAL
$ gksudo cp /usr/share/X11/locale/el_GR.UTF-8/Compose /usr/share/X11/locale/en_US.UTF-8/Compose

The first command makes a backup copy of your original en_US Compose file (assuming you run an English locale; if in doubt, read /usr/share/X11/locale/locale.dir). The second command copies the Greek compose file over the English one. You then logout and login again.

End of updates

To write Greek Polytonic in Linux, a special file is used, which is called the compose file. There is a bit of complication here in the sense that the compose file depends on the current system locale.

To find out which compose file is active on your system, have a look at

/usr/share/X11/locale/compose.dir

Let’s assume your system locale is en_US.UTF-8 (Start Applications/Accessories/Terminal and type locale).

In the compose.dir file it says

en_US.UTF-8/Compose: en_US.UTF-8

Note that the locale is the second field. If you have a different system locale, match on the second field. Many people make a mistake here. Actually, I think be faster for the system to locate the entry if the compose.dir file was sorted by locale.

Therefore, the compose file is

/usr/share/X11/locale/en_US.UTF-8/Compose

So, what’s the problem then?

Well, for the Greek locale (el_GR.UTF-8) we have a different compose file, a compose file in which Greek Polytonic actually works ;-).

Therefore, there are numerous workarounds here to get Greek Polytonic working.

For example,

  • If you speak modern Greek, you can install the Greek locale.
  • You can edit /usr/share/X11/locale/compose.dir so that for your locale, the compose file is the Greek one, /usr/share/X11/locale/el_GR.UTF-8/Compose.
  • You can edit the Greek compose file, take the Greek Polytonic section and update the Greek Polytonic section of en_US.UTF-8/Compose.
  • You can copy the Greek compose file in your home directory under the name .XCompose. I did not try this one, and also you may be affected by this bug. (not tested)

Of course the proper solution is to update en_US.UTF-8/Compose with the updated Greek Polytonic compose sequences. There is a tendency to add the compose sequences of all languages to en_US.UTF-8/Compose, and this actually is happening now. In this respect, it would make sense to rename en_US.UTF-8/Compose into something like general/Compose.

Can you read Coptic?

Coptic is the most recent phase of ancient Egyptian. It is the direct descendant of the ancient language written in Egyptian hieroglyphic, hieratic, and demotic scripts. The Coptic alphabet is a slightly modified form of the Greek alphabet, with some letters (which vary from dialect to dialect) deriving from demotic. As a living language of daily conversation, Coptic flourished from ca. 200 to 1100. The last record of its being spoken was during the 17th century. Coptic survives today as the liturgical language of the Coptic Orthodox Church. Egyptian Arabic is the spoken and national language of Egypt today.

Source: Wikipedia on Coptic Language

Coptic, as used today, has signs of influence from the Greek language. If you speak Greek, you should be able to recognise every entry in the screenshot (it comes from the dictionary that is available from http://copticlang.bizhat.com/).

There is a Coptic Unicode block and there are at least three Unicode fonts available with Coptic glyphs.

I am not aware of a keyboard definition to write Unicode Coptic; Coptic uses several combining diacritical marks (accents) and appears to surpass even Ancient Greek/Polytonic in this respect. An easy way to create (easy to write with?) method would be to start from the Greek keyboard layout and replace the codepoints with the Coptic ones. For the 9 combining diacritical marks, three keys should be dedicated, accessible through 1) pressing as is, 2) pressing with shift, 3) pressing with Alt. To avoid using dead keys, there would be a requirement to type first the letter and then the diacritical mark.

In modern Greek we use the “;:” key (on the right of L) to produce the acute and the diaeresis (with Shift) accents. The second suitable key could be the ‘ ” key while the third the “/?” (debateable).

There are several efforts to convert non-Unicode fonts distributed by the Coptic Church. website. Moheb added the Coptic glyphs to the Freefonts. There is more work required to get them added by default to Linux distros. There is a discussion forum on Coptic.

Therefore, the most important task is to create a keyboard layout so that one can write in Unicode Coptic.

Then, existing (non-Unicode) text should be converted to Unicode Coptic so that there is material available. Moheb created support for this in iconv (glibc). There should be a bug report at http://sources.redhat.com/bugzilla/ under product glibc, component libc.

Source: Wikipedia (Coptic script)

There exist free Unicode fonts already to have the text displayed. The conversion of the Coptic Church fonts to Unicode would be beneficial as well. To have them included in Linux distros, the distribution license should be set to one of the FLOSS licenses. An option could be to add to the DejaVu fonts (allowed by the license) so that there is a general purpose open font that is easy to work with.

I, for one, would love to write Greek using a Coptic keyboard layout and a Coptic Unicode font. :)

Update: Screenshot that demonstrates how well Unicode Coptic fonts behave when combining marks are used.

Update #2: You can test the above on your system by opening this OpenDocument file using OpenOffice.org or any other OpenDocument-compatible application. OpenOffice.org was verified that it can show combining marks. Your mileage may vary, your comments will be appreciated.

Get Unicode fonts with Coptic coverage.

Greek Polytonic HOWTO

Dimitri Marinakis has written a HOWTO on Hellenic (Greek) Polytonic in free and open-source software, licensed by the GNU Free Documentation License.
It gives a background in Ancient Greek and describes how to use Greek Polytonic (read and write) in your Linux system.

Bug 167940: Add Greek Polytonic precomposed chars to gtk+/gtk/gtkimcontextsimple.c

Ακόμα δε μπορούμε να γράψουμε πολυτονικά ως έχει στο gtk+ :(

Γράψιμο ελληνικών μέσα από GNOME

Δείτε Cannot write Greek Polytonic in Linux για την περιγραφή ενός προβλήματος στη γραφή πολυτονικού και τη διαδικασία επίλυσης.

Υπάρχουν διάφοροι τρόποι να γράψει κανείς ελληνικά στο X.org. Εδώ θα δούμε τον τρόπο μέσα από το γραφικό περιβάλλον GNOME. Οι δοκιμές έγιναν σε Fefora Core 2.
Θεωρούμε ότι έχουμε καθορίσει το ελληνικό locale, δηλαδή:

$ locale
LANG=el_GR.UTF-8
LC_CTYPE=”el_GR.UTF-8″
LC_NUMERIC=”el_GR.UTF-8″
LC_TIME=”el_GR.UTF-8″
LC_COLLATE=”el_GR.UTF-8″
LC_MONETARY=”el_GR.UTF-8″
LC_MESSAGES=”el_GR.UTF-8″
LC_PAPER=”el_GR.UTF-8″
LC_NAME=”el_GR.UTF-8″
LC_ADDRESS=”el_GR.UTF-8″
LC_TELEPHONE=”el_GR.UTF-8″
LC_MEASUREMENT=”el_GR.UTF-8″
LC_IDENTIFICATION=”el_GR.UTF-8″
LC_ALL=

Όχι, el_GR δεν είναι ίδιο με el_GR.UTF-8. Είναι σημαντικό να εμφανίζεται el_GR.UTF-8. Δείτε την τεκμηρίωση της διανομής σας για να αλλάξετε το locale. Ακόμα, η χρήση του προγράμματος setxkbmap επηρεάζει αυτό που δοκιμάζουμε εδώ, οπότε μην το εκτελέσετε.


Κάνουμε δεξί κλικ στο ταμπλώ της επιφάνειας εργασίας.


Επιλέγουμε Ενδείκτη Πληκτρολογίου.


Στο ταμπλώ θα εμφανιστεί η προεπιλεγμένη γλώσσα, Αγγλικά Πληκτρολογίου USA.


Κάνουμε δεξί κλικ στο εφαρμογίδιο του Ενδείκτη Πληκτρολογίου (πάνω στο USA) και επιλέγουμε Άνοιγμα Προτιμήσεων Πληκτρολογίου.


Εμφανίζεται ο διάλογος των προτιμήσεων.


Κάνουμε κλικ στις διατάξεις. Προεπιλεγμένη είναι η διάταξη Αγγλικά Αμερικανικού Πληκτρολογίου. Τα ονόματα των διατάξεων έχουν πλέον μεταφραστεί και θα εμφανιστούν στα ελληνικά σε επόμενη έκδοση της διανομής σας.


Προσθέτουμε ελληνικά στις διατάξεις και μεταβαίνουμε στις Επιλογές Διάταξης.


Εδώ επιλέγουμε τον συνδιασμό πλήκτρων για την μεταφορά μεταξύ της αγγλικής και ελληνικής κατάστασης πληκτρολογίου. Λόγω ενός σφάλματος που διερευνούμε, δε λειτουργούν σωστά οι συνδιασμοί Alt-Shift, Ctrl-Shift κτλ. Ο συνδιασμός Left-Shift+Right-Shift λειτουργεί κανονικά και τον επιλέγουμε. Έπειτα πατάμε Κλείσιμο.


Ανοίγουμε τον επεξεργαστή κειμένου του GNOME και δοκιμάζουμε να γράψουμε κάτι στα ελληνικά.


Προσθέτουμε την διάταξη Greek Polytonic για να δοκιμάσουμε τη γραφή πολυτονικού.

Θα παρατηρήσουμε ότι υπάρχει πρόβλημα στη γραφή πολυτονικού και συγκεκριμένα με τα ποικίλα τονικά σημάδια.


Κάνουμε δεξί κλικ πάνω στο παράθυρο του επεξεργαστή κειμένου του GNOME και ελέγχουμε την Μέθοδο Εισαγωγής. Είναι Προεπιλογή.


Το αλλάζουμε σε Μέθοδο Εισαγωγής Χ.


Τώρα γράφουμε πολυτονικά.


Το πρόγραμμα αλλαγής πληκτρολογίου που χρησιμοποιήσαμε το έγραψε ο Sergey Oudaltsov.


Η μετάφραση έγινε από τα εικονιζόμενα άτομα.