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

babel: Italic text within bold if using "bidi=basic-r" #7

Closed
seloumi opened this issue Jan 13, 2018 · 13 comments
Closed

babel: Italic text within bold if using "bidi=basic-r" #7

seloumi opened this issue Jan 13, 2018 · 13 comments

Comments

@seloumi
Copy link

seloumi commented Jan 13, 2018

Brief outline of the bug

I'm trying to write arabic with babel (version 3.16). and I have troubles to write bold text, when using \bfseries part the bolded text appears also italic ( with option "bidi=basic-r" )

If I use "bidi=default" there is no problem

Minimal example showing the bug

% test2.tex  (xelatex)
\RequirePackage{latexbug}       
\documentclass{article}
\usepackage[nil, bidi=default]{babel}
\babelprovide[import=ar, main]{arabic}
\babelfont{rm}{Amiri} %   arabic font
\begin{document}

{\bfseries\Large تجريب إمكانيات babel الجديدة لكتابة العربية } 

{\Large تجريب إمكانيات babel الجديدة لكتابة العربية } 

\end{document}


% test3.tex  (lualatex)
\RequirePackage{latexbug}       
\documentclass{article}
\usepackage[nil, bidi=basic-r]{babel}
\babelprovide[import=ar, main]{arabic}
\babelfont{rm}{Amiri} %   arabic font
\begin{document}

{\bfseries\Large تجريب إمكانيات babel الجديدة لكتابة العربية } 

{\Large تجريب إمكانيات babel الجديدة لكتابة العربية } 

\end{document}

Log file (required) and possibly PDF file

test2.log
test3.log

test2.pdf
test3.pdf

@FrankMittelbach
Copy link
Member

@seloumi please keep the issue template structure intact (i.e., keep the headings). Also please provide the necessary data. There is a reason that one heading says:

Log (and possibly PDF) file

We do require the .log; only the pdf is optional not the other way around. This helps in identifying any issues with the setup.

@josephwright
Copy link
Member

@FrankMittelbach I see the same effect: my log attached.
test.log

@eg9
Copy link
Contributor

eg9 commented Jan 13, 2018 via email

@josephwright
Copy link
Member

@seloumi My suspicion is a font issue as @eg9 says: with \showoutput I get

....\TU/Amiri(1)/bx/n/14.4 b
....\TU/Amiri(1)/bx/n/14.4 a
....\TU/Amiri(1)/bx/n/14.4 b
....\TU/Amiri(1)/bx/n/14.4 e
....\TU/Amiri(1)/bx/n/14.4 l

i.e. babel is requesting a bold font, not a bold-italic one.

@seloumi seloumi changed the title Italic text within bold Italic text within bold if using "bidi=basic-r" Jan 14, 2018
@seloumi seloumi changed the title Italic text within bold if using "bidi=basic-r" babel: Italic text within bold if using "bidi=basic-r" Jan 14, 2018
@jbezos
Copy link
Contributor

jbezos commented Jan 15, 2018

Seems a bug in fontspec/luaotfload:

\documentclass{article}
\usepackage{fontspec}
\setmainfont[Script=Arabic]{Amiri}

\begin{document}
\pardir TRT\textdir TRT

\textbf{إمكانيات}
\end{document}

@josephwright
Copy link
Member

I think it's clear this is not a babel bug: most likely the font. I'll close on that basis.

@wspr
Copy link
Contributor

wspr commented Jan 15, 2018

If possible it would be better not to rely on luaotfload's auto-detection of shapes to find the bold version:

\setmainfont{amiri}[
  Script=Arabic,
  Extension=.ttf,
  UprightFont=*-regular,
  BoldFont=*-bold,
]

You could write an Amiri.fontspec file to hard-code this if it was a common font used by babel.

@khaledhosny
Copy link

@wspr would it be a good idea of the Amiri package on CTAN provided an Amiri.fontspec file?

@wspr
Copy link
Contributor

wspr commented Jan 18, 2018

@khaledhosny Sure! I haven't been reaching out to folks about doing this, but I think it would be a sensible approach. Are you familiar with how they're supposed to look?

@khaledhosny
Copy link

Not sure I remember the syntax (and I think it changed since I last tried it long ago), if you can give me a file that would be super awesome, otherwise I can always check the docs/source code and try.

@wspr
Copy link
Contributor

wspr commented Jan 18, 2018

This should be enough to get you started... not sure if Script=Arabic should be default or not and you might also want to add ItalicFont and BoldItalicFont. Note also that once amiri.fontspec exists it won't be regenerated, so edit the file directly after running the source below.

\begin{filecontents*}{amiri.fontspec}
\defaultfontfeatures[amiri]{
  Script=Arabic,
  Extension=.ttf,
  UprightFont=*-regular,
  BoldFont=*-bold,
}
\end{filecontents*}

\documentclass{article}
\usepackage{fontspec}
\setmainfont{amiri}
\begin{document}
إمكانيات
\par
\textbf{إمكانيات}
\end{document}

@khaledhosny
Copy link

Thanks @wspr, I did this (using file names that match the current release), let me know if I did something wrong.

@jbezos
Copy link
Contributor

jbezos commented Jan 31, 2018 via email

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

No branches or pull requests

7 participants