Skip to content

Instantly share code, notes, and snippets.

@sixtyfive
Last active August 29, 2015 14:13
Show Gist options
  • Save sixtyfive/f2f7afd0ca048b09115f to your computer and use it in GitHub Desktop.
Save sixtyfive/f2f7afd0ca048b09115f to your computer and use it in GitHub Desktop.
Arabic poem typeset for playing around with ConTeXt font handling
%---------------------------------------------------------------------------
% Lovely without vowelisation: diwanibent (decorated), diwaniletter (fancy),
% scheherazade (conservative), oldanticdecorative, irannastaliq, bfantezy,
% bdavat, barabicstyle (like omani handwriting), arial (plain; readable),
% andalus (kufi script), amiri (conservative; nice ligatures), tholoth
%
% Working well with vowelisation: rabat, arabictypesetting
%
% Not displaying correctly (i.e. broken): traditionalarabic
%
% Not displaying at all: timur, oibeyrutnormala, kacstonebold, helvan
%---------------------------------------------------------------------------
% Necessary to make Arabic text work properly
\definefontfamily[mainface][rm][arabictypesetting][features=arabic]
\definefontfamily[mainface][ss][diwanibent][features=arabic]
\definefontfamily[mainface][tt][amiri][features=arabic]
\setupbodyfont[mainface,rm]
\setupdirections[bidi=global]
\setupalign[r2l]
% Preparing the page for properly displaying vertically aligned content;
% setting up vertical spaces between paragraphs
\setuplayout[header=-6mm,footer=0mm,backspace=0mm,width=210mm]
\setuplines[before={\blank[14mm]},after={\blank[1em]}]
\starttext
% No page numbering; vertical alignment
\setupheader [state=stop]
\dontleavehmode
\vfill
\startalignment[middle]
\ss % Correct to use it this way?
\switchtobodyfont[150pt]
شراع
\crlf
\switchtobodyfont[126pt]
عينيك
\rm % Correct to use it this way?
\switchtobodyfont[20pt]
\startlines
عيناكِ في ألقِ الشَّعاع
كـنجمتَيـنِ في التَّماع
وشعـرُكِ الغافي على الْمَتَـنَين
لِمَلْمِهِ شراع
فإذا غفَا فيكِ الغرام
واستيقظَتْ في القلبِ آلامُ الهِـيام
أنا ذلكَ النِّضُو الشَّريد
أنا ذلكَ الهاوي البعيد
مَعْبُودَتِي - ما هكـذا جُعْلُ الغرام
إنِّي دُمُوعٌ موْغَلٌ فيها البُكـاء
إنِّي جُـذُورٌ يَستبيحُ دماءَ ها قحْطُ الشِّتاء
هل تسمِعيـن؟
وفي الْمَناحةِ ترْقَصِيـن؟
\stoplines
\tt % Correct to use it this way?
\switchtobodyfont[10pt]
(قصيدة من نظم هيثم الناهي)
\stopalignment % Ending horizontal alignment
\vfill % Ending vertical alignment
\stoptext
@sixtyfive
Copy link
Author

(Works well with ConTeXt beta as of January 7th, 2015)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment