2

I have a serious of auto-generated documents in various languages that include a mix of LTR and RTL languages. I am trying to come up with common markup that works across both directions. I've run into some trouble aligning images. When I wrap images at the start of a line, the LTR version properly wraps but the RTL version drops the image into the margin.

How do I correct the placement of the image so that both LTR and RTL variants will wrap the text around the image?

enter image description here

\enableregime[utf]
\setuppapersize [A5]
\setuplayout[width=fit,topspace=0pt,bottomspace=0pt,header=0pt]
\starttypescript [sans] [notolatin]
    \definefontsynonym [Sans] [name:notosans]
    \definefontsynonym [SansBold] [name:notosansbold]
    \definefontsynonym [SansItalic] [name:notosansitalic]
    \definefontsynonym [SansBoldItalic] [name:notosansbolditalic]
\stoptypescript
\starttypescript [sans] [notoarabic]
    \definefontfeature[persian][mode=node,language=dflt,script=arab,init=yes,medi=yes,fina=yes,isol=yes,calt=yes,rlig=yes,tlig=yes,trep=yes,curs=yes,kern=yes,mark=yes]
    \definefontsynonym [Sans] [name:notonaskharabic] [range=persian,features=persian]
    \definefontsynonym [SansBold] [name:notonaskharabicbold]
    \definefontsynonym [SansItalic] [name:notonaskharabicitalic]
    \definefontsynonym [SansBoldItalic] [name:notonaskharabicbolditalic]
\stoptypescript
\definetypeface [notolatin] [ss] [sans] [notolatin]
\definetypeface [notoarabic] [ss] [sans] [notoarabic]
\define\EN{\setupbodyfont[notolatin,ss]\pardir TLT \textdir TLT}
\define\PE{\setupbodyfont[notoarabic,ss]\pardir TRT \textdir TRT}
\starttext
\pagedir TRT
\bodydir TRT
\PE
هناك حقيقة مثبتة منذ زمن طويل وهي أن المحتوى المقروء لصفحة ما سيلهي القارئ عن التركيز على الشكل الخارجي للنص أو شكل توضع الفقرات في الصفحة التي يقرأها.

\setuphanging[location=left]
\starthanging{\externalfigure[https://api.unfoldingword.org/obs/jpg/1/checkinglevels/uW-Level1-128px.png]}
{
    {\PE \bf ۱.آفرینش}
    \blank
    {\PE \em داستانی برگرفته از کتاب مقدّس: کتاب پیدایش، فصلهای ۱و۲}
}
\stophanging

\pagedir TLT
\bodydir TLT
\EN
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit.

\setuphanging[location=left]
\starthanging{\externalfigure[https://api.unfoldingword.org/obs/jpg/1/checkinglevels/uW-Level1-128px.png]}
{
    {\EN \bf Checking level 1}
    \blank
    {\EN \em find out more at https://unfoldingword.org/quality}
}
\stophanging
\stoptext

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.