Mi blog lah! Το ιστολόγιό μου

22Nov/082

Help make «DocBook XML to PDF» work for Greek

<?xml version=”1.0″ encoding=”utf-8″?>
<!DOCTYPE article PUBLIC “-//OASIS//DTD DocBook XML V4.2//EN”
“http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd”>
<article lang=”en”>
<section><title>Title</title>
<para>ëãáâṩẫëĝéõōåőȩçą</para>
<para>ЁЂыњѨѬѺѸѶѦщЖЊЌЍШЩзф</para>
<para>ᾶᾳὰέᾁᾂδϕϟϸϡϸϸαϷϕϲδϕϛ€ϕ©ϖϐͻ©ϖϐ</para>
</section>
</article>

This is an issue that I would appreciate if someone could help in solving.

The above document (mytestfile.xml) is a DocBook XML document with text in many scripts (latin, cyrillic and greek). Normally it was difficult to convert to PDF, until recently.

Now, one can run

dblatex --backend=xetex --verbose mytestfile.xml

(requires to install the dblatex package and any dependencies) and it creates mytestfile.pdf. If you have a fresh installation of Ubuntu 8.10 and you go through the process of installing these packages, please make a list of them, to use as advice for new users.

Generated PDF document with lang=en

Generated PDF document with lang=en

Since we use XeTeX as a backend, we can work with Unicode text directly, which is the proper thing to do. Above you can see that all characters are shown (except a few obscure ones that are not found in DejaVu Sans and are shown as boxes). You can see Latin (+Extended), Cyrillic (+Extended), Greek (+Extended) in the same document.

Generated PDF document with lang=el

Generated PDF document with lang=el

The issue arises when we change the lang modifier in the document above, from en to el. Here you see Τιτλε, which in fact is Title but with the characters replaced with their Greek equivalent. This is a sign for non-Unicode, 8-bit encoding conversion issue. In addition, some of the rest of the characters are shown, and apparently a strange conversion took place.

What we need to do is figure out is how to fix xetex when ‘lang=el’. There is some work to get Greek XeTeX support upstream, and there are instructions on how to add local Greek XeTeX support in your distribution.

What we need is instructions on how to fix the Greek XeTeX support in Ubuntu 8.10, and test that dblatex can generate documents correctly when lang=el.

For your testing, here are the files mytestfile-en.pdf, mytestfile-el.pdf, mytestfile-en.xml, mytestfile-el.xml.

16Jul/070

GUADEC Day #1

I am writing this in the morning of the second day (posted at the end of the second day). Just had breakfast and there is a bit of time before making it to the conference venue.

Yesterday Sunday, was the first of the two days of warm-up for the GUADEC conference. At 11am the registration started. I was in front of the queue and got my badge quickly, then picked up the bag with the goodies; three cool t-shirts, a copy of Ubuntu 7.04, Fedora 7 Live, Linux stickers, two Linux pens, a mini Google Code notebook (no, that’s an actual notebook (not that type of notebook, it was just the paper-based thing)).

During registration I met up with Dimitrios Glezos (of Greek Fedora fame) and a bit later with Dimitrios Typaldos. It was the first time I met both of them in person.

Between a choice of two sessions I went to the one on X.org developments (XDamage, xrender, etc extensions and how to use them). Ryan Lortie gave the presentation.

Next was lunch time, and Dimitrios T. recommended a pub for traditional English food and drink. Sayamindu came along.

The next session I went to was the Hildon desktop, which is what we used to call Maemo; GNOME for internet tables such as the Nokia 770 and Nokia 800. There are special technical issues to solve. Lucas Rocha mentioned refactoring issues with the source code. In addition, as far as I understood, there is an issue with the internationalisation support for the platform.

Next, Don Scorgie talked about the GNOME documentation project. Several things can be improved and one of them is the introduction of a simplified XML schema for the needs of GNOME documentation. When compared to DocBook XML, the new GNOME documentation schema has only 6 elements (or do they call them tags?). In addition to this, there is a documentation editor with a special rich-edit widget for this schema. Mallard is a type of duck(?).

I also attended the last 10 minutes of the presentation on project Jackfield (sadly no special significance between Jackfield and what the project is about). Jackfield is apparently a way to run Javascript scripts on the desktop. OS/X is supposed to have it, and there are already scripts available. With Jackfield, you can run those scripts unmodified on Linux. The demos where really impressive.

The final session for the day was a presentation by Richard Rothwell on free software for the socially excluded. No, you do not have to go to Africa for this. His work relates to families in Nottingham, UK. It reminds me the situation and effort in Farkadona, Greece, that was described by Kostas Boukouvalas. I think it would have been helpful if Kostas Boukouvalas could have attended this. Richard is running a 3-year project that provides a number of PCs (in the hundreds?) with Linux to socially excluded families. Even in the UK, funding is hard to come by.

2Sep/04Off

DocBook XML και ελληνικά, περισσότερα

Στο Docbook XML και ελληνικά (ενημέρωση) έγινε αναφορά για τη δημιουργία αρχείου PDF με ελληνικά. Εδώ η μηχανή XSLT xsltproc μετατρέπει το αρχείο DocBook XML μέσω της μηχανής FO PassiveTex σε μορφή PDF, με όσους περιορισμούς έχει το LaTeX.

Για την παραγωγή των ελληνικών χαρακτήρων μέσω PassiveTex, γίνεται χρήση του περιβάλλοντος μαθηματικών του LaTeX (π.χ. \ensuremath{\alpha} για “α”) με αποτέλεσμα να είναι μεν η τελική γραμματοσειρά κανονική (όχι η Symbol), να μην είναι όμως το αποτέλεσμα σωστή στοιχειοθεσία.

Η μηχανή FO xmlroff (περιλαμβάνει XSLT) παράγει ελληνικό (και πολυτονικό) κείμενο, το παραγόμενο .PDF είναι πολύ μεγάλο λόγω της ενσωμάτωσης γραμματοσειρών(;). Ωστόσο, χάρις στη βιβλιοθήκη pango μπορεί να απεικονίσει μεγάλη ποικιλία γλωσσών. Στο παράδειγμα απεικονίζονται ελληνικά/πολυτονικό, ρωσικά, αραβικά και ταμίλ.

Η μηχανές XSLT Xalan και FO FOP παράγουν καλό αποτέλεσμα, γρήγορα και το παραγόμενο PDF είναι αρκετά μικρό. Μπορεί εύκολα να καθορίσει γραμματοσειρά. Δείτε το κείμενο της αποκάλυψης με τη γραμματοσειρά Palatίno Lίnotype Unicode.

Γενικά, για να δοκιμάσετε την τύχη σας με τη διαδικασία δημιουργίας αρχείων PDF από XML ή FO, ξεκινήστε με μια μηχανή XSLT και μετά με μια μηχανή FO από τις λίστες XSL publishing tools.

25Aug/04Off

Docbook XML και ελληνικά (ενημέρωση)

Μέχρι πριν από λίγα χρόνια, η κατάσταση παραγωγής αρχείων .PDF από DocBook SGML και DocBook XML δεν ήταν καλή.

Η κατάσταση με το DocBook SGML συνεχίζει να είναι προβληματική λόγω jadetex/openjade που δεν μπορεί να καταλάβει Unicode.

Όμως, η κατάσταση με το DocBook XML είναι αρκετά καλύτερη. Θέλει λίγη αγάπη για να λυθούν τα μικροπροβλήματα που έχουν απομείνει.

Για παράδειγμα, είναι δυνατόν με έναν καθορισμό της μορφής “lang=el” να εμφανιστούν ελληνικά για “Πίνακας περιεχομένων”, “Κεφάλαιο”, κτλ. Τα σχετικά αλφαριθμητικά έχουν μεταφραστεί από το 1998/9 (από εθέλοντη που ξεχνώ το όνομά του και εμένα), στην κωδικοποίηση iso-8859-7. Η “αυτόματη” μετατροπή, που έγινε κάποια στιγμή, προς Unicode δεν ήταν καλή με αποτέλεσμα το σχετικό el.xml αρχείο να περιλαμβάνει λατινικούς εκτεταμένους χαρακτήρες αντί ελληνικών.

Για να φτιάξετε το πρώτο σας ελληνικό κείμενο σε DocBook XML, ακολουθήστε τις οδηγίες που περιγράφονται στη σελίδα DocBook bits για την εγκατάσταση του απαραίτητου λογισμικού και αρχίστε με το δεύτερο δείγμα της σελίδας, Selfdocbook (XML edition).

Έφτιαξα το αρχείο selfdocbookx.pdf σε Fedora Core 2 και πρέπει να έχετε παρόμοια αποτελέσματα σε άλλες διανομές.

Αν κάποιος θέλει να διορθώσει τα προβληματάκια, ας επικοινωνήσει μαζί μου.

   

Switch to our mobile site