Quantcast

Ligation Issues in Arabic & Devanagari

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Ligation Issues in Arabic & Devanagari

Erik Ogan
I am having some issues with ligation in Arabic & Devanagari scripts
in my embedded FOP application. I have not disabled Complex Script
Features, and have explicitly turned them on just to be sure:

  …
  FopFactoryBuilder builder = new FopConfParser(cfgStream,
baseURI).getFopFactoryBuilder();
  builder.setComplexScriptFeatures(true);
  …

I’ve searched the archives for tips, but most of the discussion of
ligatures is around removing/disabling them.

This discussion was the only one I found that seemed like it offered a solution:
http://marc.info/?l=fop-user&m=142547685119005&w=2

But alas, adding script attributes to my fo:block elements (as you’ll
see in the file below) seems to have had no effect.

I’m using NoTo Sans as my font, which does have ligature information.

Here is an example (intermediate) FO file:
https://s3-us-west-2.amazonaws.com/erik-fop-questions/with-scripts.fo
(I have also tried downcasing & upcasing the script attributes)

Here is my configuration file:
https://s3-us-west-2.amazonaws.com/erik-fop-questions/config.xml

And here is a resulting PDF:
https://s3-us-west-2.amazonaws.com/erik-fop-questions/current.pdf

The most _infuriating_ part of this is that before this project was
put on hold 1.5 years ago I apparently had it working in early
experiments (before I’d even corrected the alignment of Arabic &
Hebrew):

https://s3-us-west-2.amazonaws.com/erik-fop-questions/2015-08-09-example.pdf

I am using the same code, with the same configuration and font files,
yet it is producing a different result. I’ve been tearing my hair out
for weeks trying to figure out what is different.

I also have a dim memory of having had this issue in earlier
experiments, and discovering a simple solution. But I have NO idea
what that solution was, nor how it would be external to the code &
configuration I am currently running.

… I JUST had a flashbulb memory that perhaps the solution then was
upgrading from Java 1.6 to 1.7. I’m running all of this on 1.8 right
now.

Any help or suggestions folks have would be GREATLY appreciated. Thanks!

-e

--
Erik Ogan
[hidden email]
415.BE.MESSY

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ligation Issues in Arabic & Devanagari

Maxime Bégnis-2

Hello Erik,

I'm not sure but I may have had the exact same issue and  Glenn Adams provided me with a simple solution that worked. See:

http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-users/201606.mbox/browser

Best regards,

--
NeoDoc
Maxime Bégnis
[hidden email]
Tél: +33 (0)4.42.52.24.20
789 Rue de La Gare
13770 Venelles
France
Le 06/04/2017 à 16:57, Erik Ogan a écrit :
I am having some issues with ligation in Arabic & Devanagari scripts
in my embedded FOP application. I have not disabled Complex Script
Features, and have explicitly turned them on just to be sure:

  …
  FopFactoryBuilder builder = new FopConfParser(cfgStream,
baseURI).getFopFactoryBuilder();
  builder.setComplexScriptFeatures(true);
  …

I’ve searched the archives for tips, but most of the discussion of
ligatures is around removing/disabling them.

This discussion was the only one I found that seemed like it offered a solution:
http://marc.info/?l=fop-user&m=142547685119005&w=2

But alas, adding script attributes to my fo:block elements (as you’ll
see in the file below) seems to have had no effect.

I’m using NoTo Sans as my font, which does have ligature information.

Here is an example (intermediate) FO file:
https://s3-us-west-2.amazonaws.com/erik-fop-questions/with-scripts.fo
(I have also tried downcasing & upcasing the script attributes)

Here is my configuration file:
https://s3-us-west-2.amazonaws.com/erik-fop-questions/config.xml

And here is a resulting PDF:
https://s3-us-west-2.amazonaws.com/erik-fop-questions/current.pdf

The most _infuriating_ part of this is that before this project was
put on hold 1.5 years ago I apparently had it working in early
experiments (before I’d even corrected the alignment of Arabic &
Hebrew):

https://s3-us-west-2.amazonaws.com/erik-fop-questions/2015-08-09-example.pdf

I am using the same code, with the same configuration and font files,
yet it is producing a different result. I’ve been tearing my hair out
for weeks trying to figure out what is different.

I also have a dim memory of having had this issue in earlier
experiments, and discovering a simple solution. But I have NO idea
what that solution was, nor how it would be external to the code &
configuration I am currently running.

… I JUST had a flashbulb memory that perhaps the solution then was
upgrading from Java 1.6 to 1.7. I’m running all of this on 1.8 right
now.

Any help or suggestions folks have would be GREATLY appreciated. Thanks!

-e


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ligation Issues in Arabic & Devanagari

Glenn Adams-2
In reply to this post by Erik Ogan
Firstly, don't specify any script property, or if you do, set it to "dflt". Try that and see what happens.

Secondly, there are many Noto Sans fonts, so you may have to specify a different font to be applied to specific scripts.

Thirdly, note that Devanagari has never been fully completed, so there are a few known bugs.

On Thu, Apr 6, 2017 at 8:57 AM, Erik Ogan <[hidden email]> wrote:
I am having some issues with ligation in Arabic & Devanagari scripts
in my embedded FOP application. I have not disabled Complex Script
Features, and have explicitly turned them on just to be sure:

  …
  FopFactoryBuilder builder = new FopConfParser(cfgStream,
baseURI).getFopFactoryBuilder();
  builder.setComplexScriptFeatures(true);
  …

I’ve searched the archives for tips, but most of the discussion of
ligatures is around removing/disabling them.

This discussion was the only one I found that seemed like it offered a solution:
http://marc.info/?l=fop-user&m=142547685119005&w=2

But alas, adding script attributes to my fo:block elements (as you’ll
see in the file below) seems to have had no effect.

I’m using NoTo Sans as my font, which does have ligature information.

Here is an example (intermediate) FO file:
https://s3-us-west-2.amazonaws.com/erik-fop-questions/with-scripts.fo
(I have also tried downcasing & upcasing the script attributes)

Here is my configuration file:
https://s3-us-west-2.amazonaws.com/erik-fop-questions/config.xml

And here is a resulting PDF:
https://s3-us-west-2.amazonaws.com/erik-fop-questions/current.pdf

The most _infuriating_ part of this is that before this project was
put on hold 1.5 years ago I apparently had it working in early
experiments (before I’d even corrected the alignment of Arabic &
Hebrew):

https://s3-us-west-2.amazonaws.com/erik-fop-questions/2015-08-09-example.pdf

I am using the same code, with the same configuration and font files,
yet it is producing a different result. I’ve been tearing my hair out
for weeks trying to figure out what is different.

I also have a dim memory of having had this issue in earlier
experiments, and discovering a simple solution. But I have NO idea
what that solution was, nor how it would be external to the code &
configuration I am currently running.

… I JUST had a flashbulb memory that perhaps the solution then was
upgrading from Java 1.6 to 1.7. I’m running all of this on 1.8 right
now.

Any help or suggestions folks have would be GREATLY appreciated. Thanks!

-e

--
Erik Ogan
[hidden email]
415.BE.MESSY

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ligation Issues in Arabic & Devanagari

Erik Ogan
Thanks for your quick response! Let me reply inline:

On Thu, Apr 6, 2017 at 8:10 AM, Glenn Adams <[hidden email]> wrote:
> Firstly, don't specify any script property, or if you do, set it to "dflt".
> Try that and see what happens.

I really only added scripts as a last-ditch attempt, in the hope that
Claudius Teodorescu’s email was the answer for which I’d been looking.
Most of my attempts to make this work did not include them.

I’ll try setting it to “dflt” now, just to see if it helps, but
otherwise I’ll leave them out.

> Secondly, there are many Noto Sans fonts, so you may have to specify a
> different font to be applied to specific scripts.

Sorry, I should have been more precise. I’m using Noto Sans as my
_typeface_, I’m using the various fonts for each of these scripts. For
example I’m using NotoNaskhArabic-{Regular,Bold}.ttf for Arabic, and
NotoSansDevanagari-{Regular,Bold}.ttf for Devanagari.

> Thirdly, note that Devanagari has never been fully completed, so there are a
> few known bugs.

Interesting. It was working well enough for my test content in the PDF
produced in 2015. Perhaps after this is all released our resident
language expert & I can look into pushing that forward a bit.

-e

--
Erik Ogan
[hidden email]
415.BE.MESSY

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ligation Issues in Arabic & Devanagari

Erik Ogan
THANK YOU! THANK YOU! Removing @language attributes fixed the ligation.

It does mean that the hyphenation will be incorrect, but that is
arguably a lower priority. And now that I have a working example, I
can try to build up from here to correct hyphenation.

(It’s also possible the language attributes were being misapplied, or
applied to widely. This will likely force a more accurate FO file.)

Thanks again. I’ve been beating my head against the desk over this. I
owe you a beverage of your choice!

-e

On Thu, Apr 6, 2017 at 9:50 AM, Glenn Adams <[hidden email]> wrote:

> Also, you might try leaving out any xml:lang or language attributes if you
> still have problems.
>
> On Thu, Apr 6, 2017 at 10:41 AM, Erik Ogan <[hidden email]> wrote:
>>
>> Thanks for your quick response! Let me reply inline:
>>
>> On Thu, Apr 6, 2017 at 8:10 AM, Glenn Adams <[hidden email]> wrote:
>> > Firstly, don't specify any script property, or if you do, set it to
>> > "dflt".
>> > Try that and see what happens.
>>
>> I really only added scripts as a last-ditch attempt, in the hope that
>> Claudius Teodorescu’s email was the answer for which I’d been looking.
>> Most of my attempts to make this work did not include them.
>>
>> I’ll try setting it to “dflt” now, just to see if it helps, but
>> otherwise I’ll leave them out.
>>
>> > Secondly, there are many Noto Sans fonts, so you may have to specify a
>> > different font to be applied to specific scripts.
>>
>> Sorry, I should have been more precise. I’m using Noto Sans as my
>> _typeface_, I’m using the various fonts for each of these scripts. For
>> example I’m using NotoNaskhArabic-{Regular,Bold}.ttf for Arabic, and
>> NotoSansDevanagari-{Regular,Bold}.ttf for Devanagari.
>>
>> > Thirdly, note that Devanagari has never been fully completed, so there
>> > are a
>> > few known bugs.
>>
>> Interesting. It was working well enough for my test content in the PDF
>> produced in 2015. Perhaps after this is all released our resident
>> language expert & I can look into pushing that forward a bit.
>>
>> -e
>>
>> --
>> Erik Ogan
>> [hidden email]
>> 415.BE.MESSY
>
>



--
Erik Ogan
[hidden email]
415.BE.MESSY

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ligation Issues in Arabic & Devanagari

Erik Ogan
It was suggested (rightly) that I should post the final PDF here for
completeness. Here is what it looks like:

https://s3-us-west-2.amazonaws.com/erik-fop-questions/fixed.pdf

Thanks again, I’ve been admiring the result since I was able to produce it.

-e

On Thu, Apr 6, 2017 at 11:39 AM, Erik Ogan <[hidden email]> wrote:

> THANK YOU! THANK YOU! Removing @language attributes fixed the ligation.
>
> It does mean that the hyphenation will be incorrect, but that is
> arguably a lower priority. And now that I have a working example, I
> can try to build up from here to correct hyphenation.
>
> (It’s also possible the language attributes were being misapplied, or
> applied to widely. This will likely force a more accurate FO file.)
>
> Thanks again. I’ve been beating my head against the desk over this. I
> owe you a beverage of your choice!
>
> -e
>
> On Thu, Apr 6, 2017 at 9:50 AM, Glenn Adams <[hidden email]> wrote:
>> Also, you might try leaving out any xml:lang or language attributes if you
>> still have problems.
>>
>> On Thu, Apr 6, 2017 at 10:41 AM, Erik Ogan <[hidden email]> wrote:
>>>
>>> Thanks for your quick response! Let me reply inline:
>>>
>>> On Thu, Apr 6, 2017 at 8:10 AM, Glenn Adams <[hidden email]> wrote:
>>> > Firstly, don't specify any script property, or if you do, set it to
>>> > "dflt".
>>> > Try that and see what happens.
>>>
>>> I really only added scripts as a last-ditch attempt, in the hope that
>>> Claudius Teodorescu’s email was the answer for which I’d been looking.
>>> Most of my attempts to make this work did not include them.
>>>
>>> I’ll try setting it to “dflt” now, just to see if it helps, but
>>> otherwise I’ll leave them out.
>>>
>>> > Secondly, there are many Noto Sans fonts, so you may have to specify a
>>> > different font to be applied to specific scripts.
>>>
>>> Sorry, I should have been more precise. I’m using Noto Sans as my
>>> _typeface_, I’m using the various fonts for each of these scripts. For
>>> example I’m using NotoNaskhArabic-{Regular,Bold}.ttf for Arabic, and
>>> NotoSansDevanagari-{Regular,Bold}.ttf for Devanagari.
>>>
>>> > Thirdly, note that Devanagari has never been fully completed, so there
>>> > are a
>>> > few known bugs.
>>>
>>> Interesting. It was working well enough for my test content in the PDF
>>> produced in 2015. Perhaps after this is all released our resident
>>> language expert & I can look into pushing that forward a bit.
>>>
>>> -e
>>>
>>> --
>>> Erik Ogan
>>> [hidden email]
>>> 415.BE.MESSY
>>
>>
>
>
>
> --
> Erik Ogan
> [hidden email]
> 415.BE.MESSY



--
Erik Ogan
[hidden email]
415.BE.MESSY

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...