Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Right-to-left languages #65

Open
Fakeel opened this issue Jan 12, 2021 · 12 comments
Open

Right-to-left languages #65

Fakeel opened this issue Jan 12, 2021 · 12 comments
Assignees
Labels

Comments

@Fakeel
Copy link

Fakeel commented Jan 12, 2021

I have started a challenge to translate the whole book in Arabic. I am not an expert in Context but I am learning.

As you know some languages writing system like Arabic, Hebrew, Pashto, Persian, Urdu, and Sindhi are written from right to left. So I solve most of issue for the Arabic language, only one remain issue.

Solving the Lettrine placement for both pages

What should I do?

page_design.zip

@jemmybutton jemmybutton self-assigned this Jan 13, 2021
@jemmybutton
Copy link
Owner

@Fakeel Wow! That's super cool!

There was a bug in my initials placement algorithm when an RtL script is used. Now it's fixed (hopefully) and your example seems to work ok. All you need to do now is to update preamble_be.tex file.

byrne_ar

There most likely are still some problems left, so please don't hesitate to ask, if something goes wrong, i'll try to fix it.
One thing that definitely doesn't work now is lettrines.mp script for the generated initials with ornaments. It currently only supports one glyph at a time, but you seem to use full words. I'll try and fix that at some point.

As a side note: are there initials in Arabic typography? Maybe you have some references?

@Fakeel
Copy link
Author

Fakeel commented Jan 13, 2021

There aren't initials in Arabic typography and it does not use block letters and separate letters.
Most of the Arabic art uses calligraphy design.

In this project the whole Arabic word should be place inside the lettrine or use calligraphy design like the one below

https://www.arabiccalligraphygenerator.com/
image

@jemmybutton
Copy link
Owner

If initials do not belong in Arabic typography, I can simply add an option to turn them off.

@Fakeel
Copy link
Author

Fakeel commented Jan 13, 2021

I have tried your fixed
Nothing is changed

I am missing something?

page_design.zip
page_design.pdf

@jemmybutton
Copy link
Owner

Strange, my output seems ok for the same file.
page_design.pdf
What version of ConTeXt are you using?

@Fakeel
Copy link
Author

Fakeel commented Jan 13, 2021

ConTeXt version 2018.04.04 00:51

mtx-context | ConTeXt Process Management 1.02
mtx-context |
mtx-context | main context file: /usr/share/texmf/tex/context/base/mkiv/context.mkiv
mtx-context | current version: 2018.04.04 00:51

@jemmybutton
Copy link
Owner

I have a newer version and it apparently is different from the older ones (I had to use newer system on TravisCI, because build failed with the older one). Currently the code decides where to place the initial using an internal variable \textdirection which seems to have appeared only in recent versions. So I suspect, this may be the problem. You can try, as a a quick fix, setting it manually somewhere in the preamble (say, right before starttext like so:

\newcount\textdirection
\textdirection=1 %1 stands for RtL

Or update to a newer version.

@Fakeel
Copy link
Author

Fakeel commented Jan 13, 2021

Thank, it works.

It will be helpful if there is a note or comment to indicate which version of ConTeXt should be used.

@jemmybutton
Copy link
Owner

Great!
There's a nasty bug in the version I'm currently using, so I can't recommend it, at the same time, everything seemed to be reasonably backwards-compatible till this case. Once i update, i'll indicate the best version to use in the README.md.

@jemmybutton
Copy link
Owner

jemmybutton commented Jan 27, 2021

@Fakeel Multi-glyph initials, as you do in Arabic, should work now, but only in theory. In practice, the function which produces text outlines in ConTeXt's MetaPost currently doesn't respect RtL text. Also some longer words may not fit well into the square box and I'm thinking about making this box's width variable.

@Fakeel
Copy link
Author

Fakeel commented Jan 28, 2021

You are right, ConTeXt's MetaPost currently doesn't respect RtL text as shown in
out.pdf

Also, don't worry about box's width because I am trying to choose Arabic word that don't exceed 3 letter.

@jemmybutton
Copy link
Owner

@Fakeel With this change initials' placeholders should work again for RtL, but you still can't generate ornaments for them. The bug with RtL is fixed in future versions of ConTeXt, so I guess, I'd just wait for the fixed version to be released and then everything should work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants