Perso-Arabic symbols for "year"

133 views
Skip to first unread message

Connie Bobroff

unread,
May 28, 2012, 12:26:30 AM5/28/12
to Persian Computing
Hi,
How can I type the symbols for "year" correctly so that the digits appear on top of the symbol? Is it possible in html?
I am struggling with
؁
and
؀
see Line 8.
(There is another symbol there to designate the year for which I have simply put a comma, not knowing what it is.)
I tried to Google these symbols to see how others have handled the problem but Google ignores them.
 
-Connie

Shervin Afshar

unread,
May 28, 2012, 5:29:50 AM5/28/12
to Connie Bobroff, Persian Computing
Connie,

U+0600 ( ؀ : ARABIC NUMBER SIGN) and U+0601 ( ؁ : ARABIC SIGN SANAH) as well as few others are subtending by definition (see p. 3):

http://www.unicode.org/charts/PDF/U0600.pdf

There are at least three fonts which claim they support the subtending behaviour: SIL's Scheherzade and Lateef, and Amiri:

http://scripts.sil.org/cms/scripts/page.php?item_id=ArabicFonts#b78d09ff
http://www.amirifont.org/

I tested Amiri, but it doesn't seem to render the behaviour properly under Mac OS X. May be it renders just fine under Uniscribe-based applications.

Shervin

Connie Bobroff

unread,
May 28, 2012, 6:06:11 AM5/28/12
to Shervin Afshar, Persian Computing
Shervin, Thank you. It looks like this is not going to be possible to display on a webpage just yet.
I tried Scheherzade on Windows 8 in LibreOffice Writer but it didn't work. I wonder if a certain input order is required: digits first, "year" first, space/ no space, etc?

John Hudson

unread,
May 28, 2012, 11:33:04 AM5/28/12
to Connie Bobroff, Persian Computing
On 28/05/12 3:06 AM, Connie Bobroff wrote:

> I tried Scheherzade on Windows 8 in LibreOffice Writer but it didn't
> work. I wonder if a certain input order is required: digits first,
> "year" first, space/ no space, etc?

The year sign is an encompassing mark, so the encoding order is

<year sign> <digit> [<digit>...]

In addition to the fonts noted, this works with the Microsoft 'Arabic
Typesetting' font and the 'Adobe Arabic' font. Both these fonts use
contextual substitutions to control the width of the sign relative to
the number of digits, and contextual kerning to position the digits
relative to the sign.

JH


--

Tiro Typeworks www.tiro.com
Gulf Islands, BC ti...@tiro.com

The criminologist's definition of 'public order
crimes' comes perilously close to the historian's
description of 'working-class leisure-time activity.'
- Sidney Harring, _Policing a Class Society_

Behdad Esfahbod

unread,
May 28, 2012, 11:36:56 AM5/28/12
to Connie Bobroff, Shervin Afshar, Persian Computing
On 05/28/2012 06:06 AM, Connie Bobroff wrote:
> I tried Scheherzade on Windows 8 in LibreOffice Writer but it didn't work.

I'm actually glad to hear that Uniscribe worked. Shervin, can you please
clarify which version of Windows that was?

For this sequence to work, the symbol has to end up in the same bidi run as
the numbers. Given the bidi classification of those character, it was not the
case up to Unicode 5.0. Roozbeh and I proposed that the bidi class of those
be changed from AL to AN, and that happened in Unicode 5.1. So you need
Unicode data newer than 5.1, and then the engines should manage to do it.

Now, I don't know what LibreOffice uses on Windows. It could be ICU or Uniscribe.

Now that I think about it, shaping that sequence using OpenType is problematic
since OpenType assumes that Arabic script shaping happens RTL, but a number
sequence is LTR. It probably wouldn't work with new HarfBuzz for that exact
reason.

behdad

Behdad Esfahbod

unread,
May 28, 2012, 11:39:11 AM5/28/12
to John Hudson, Connie Bobroff, Persian Computing
On 05/28/2012 11:33 AM, John Hudson wrote:
> On 28/05/12 3:06 AM, Connie Bobroff wrote:
>
>> I tried Scheherzade on Windows 8 in LibreOffice Writer but it didn't
>> work. I wonder if a certain input order is required: digits first,
>> "year" first, space/ no space, etc?
>
> The year sign is an encompassing mark, so the encoding order is
>
> <year sign> <digit> [<digit>...]
>
> In addition to the fonts noted, this works with the Microsoft 'Arabic
> Typesetting' font and the 'Adobe Arabic' font. Both these fonts use contextual
> substitutions to control the width of the sign relative to the number of
> digits, and contextual kerning to position the digits relative to the sign.

John,

Please see my other reply. If you are familiar with those fonts, do you know
which glyph order they expect? I assume logical. Which is kinda against what
OpenType suggests. I'll bring this up on the OpenType list I guess.

behdad

> JH

Connie Bobroff

unread,
May 28, 2012, 11:46:04 AM5/28/12
to John Hudson, Persian Computing
John, Thank you. I tried again and it worked this time on Windows 7 and LibreOffice Writer. It did not work the previous time I think because I'd put a space between the "year" and the digits.
However, the U+0600 "Arabic Number Sign" looks terrible. There is not enough room there for the 4 digits of a year.
After consulting the unicode.org document that Shervin mentioned, I see I'm perhaps not supposed to be using "Arabic Number Sign for that". There is something else called U+0604 "Arabic Sign Samvat" which perhaps is meant to be used for Hindu Vikram Samvat dates. However, if you look at my manuscript --and sorry, the site seems to be going up and down today-- which is at
line 8,
you see the "Arabic Number Sign" is exactly what the ancient scribe used for the date.

Connie Bobroff

unread,
May 28, 2012, 12:00:22 PM5/28/12
to John Hudson, Persian Computing
Behdad,
A couple points: Shervin found it didn't work on Mac. It may simply be he'd also put a space or input it incorrectly like I did the first try. Shervin, please try again!
As for Windows8 / Libre Office Writer, it correctly puts the digits above the "year" which is great to see. However, according to John, "Both these fonts use contextual substitutions to control the width of the sign relative to the number of digits", but this part does not work. The digits don't have enough room with "Arabic Number Sign". It may work with MS Word. However, "Arabic Sign Sanah" looks beautiful in both fonts. Amazing! But too bad this is not going to work on a website for now.

Behdad Esfahbod

unread,
May 28, 2012, 12:02:59 PM5/28/12
to Connie Bobroff, John Hudson, Persian Computing
On 05/28/2012 12:00 PM, Connie Bobroff wrote:
> Behdad,
> A couple points: Shervin found it didn't work on Mac. It may simply be he'd
> also put a space or input it incorrectly like I did the first try. Shervin,
> please try again!

Not working on Mac is expected I would say. Mac OpenType support is minimal
to say the least.

> As for Windows8 / Libre Office Writer, it correctly puts the digits above the
> "year" which is great to see. However, according to John, "Both these fonts
> use contextual substitutions to control the width of the sign relative to the
> number of digits", but this part does not work. The digits don't have enough
> room with "Arabic Number Sign". It may work with MS Word. However, "Arabic
> Sign Sanah" looks beautiful in both fonts. Amazing! But too bad this is not
> going to work on a website for now.

The font designer gets to decide how many digits to support. And using
contextual substitutions is exactly how it is supposed to be implemented in
OpenType.

behdad


> On Mon, May 28, 2012 at 9:16 PM, Connie Bobroff <con...@gmail.com
> <mailto:con...@gmail.com>> wrote:
>
> John, Thank you. I tried again and it worked this time on Windows 7 and
> LibreOffice Writer. It did not work the previous time I think because I'd
> put a space between the "year" and the digits.
> However, the U+0600 "Arabic Number Sign" looks terrible. There is not
> enough room there for the 4 digits of a year.
> After consulting the unicode.org <http://unicode.org> document that
> Shervin mentioned, I see I'm perhaps not supposed to be using "Arabic
> Number Sign for that". There is something else called U+0604 "Arabic Sign
> Samvat" which perhaps is meant to be used for Hindu Vikram Samvat dates.
> However, if you look at my manuscript --and sorry, the site seems to be
> going up and down today-- which is at
> http://persian.nmelrc.org/poetry/JangNaame2.html
> line 8,
> you see the "Arabic Number Sign" is exactly what the ancient scribe used
> for the date.
>
> On Mon, May 28, 2012 at 9:03 PM, John Hudson <jo...@tiro.ca
> <mailto:jo...@tiro.ca>> wrote:
>
> On 28/05/12 3:06 AM, Connie Bobroff wrote:
>
> I tried Scheherzade on Windows 8 in LibreOffice Writer but it didn't
> work. I wonder if a certain input order is required: digits first,
> "year" first, space/ no space, etc?
>
>
> The year sign is an encompassing mark, so the encoding order is
>
> <year sign> <digit> [<digit>...]
>
> In addition to the fonts noted, this works with the Microsoft 'Arabic
> Typesetting' font and the 'Adobe Arabic' font. Both these fonts use
> contextual substitutions to control the width of the sign relative to
> the number of digits, and contextual kerning to position the digits
> relative to the sign.
>
> JH
>
>
> --
>
> Tiro Typeworks www.tiro.com <http://www.tiro.com>
> Gulf Islands, BC ti...@tiro.com <mailto:ti...@tiro.com>
>
> The criminologist's definition of 'public order
> crimes' comes perilously close to the historian's
> description of 'working-class leisure-time activity.'
> - Sidney Harring, _Policing a Class Society_
>
>
> --
> http://persian-computing.org/
> http://groups.google.com/__group/persian-computing/
> <http://groups.google.com/group/persian-computing/>

Connie Bobroff

unread,
May 28, 2012, 12:18:28 PM5/28/12
to Behdad Esfahbod, John Hudson, Persian Computing
Ok, thank you, Behdad.
Now I see U+0604 Arabic Sign Samvat is not available in any font
I wonder why not?

John Hudson

unread,
May 28, 2012, 2:46:32 PM5/28/12
to Connie Bobroff, Behdad Esfahbod, Persian Computing
U+0604 is a relatively recent addition to Unicode, which explains why it
is not supported in many fonts. The two fonts to which I referred,
'Arabic Typesetting' and 'Adobe Arabic' both predate the encoding of
this sign in Unicode.


Behdad, I checked the Adobe Arabic lookups that handle the Arabic
encompassing signs U+0600 – U+0603. This implementation is based on that
developed by Paul Nelson at Microsoft for the Arabic Typesetting font.
It works with Uniscribe shaping and also with Adobe's World Ready text
engine.

The GSUB contextual substitutions controlling width of the sign are LTR
lookups with digit context in logical order, i.e. after the sign, e.g.
(in VOLT syntax)

numbersignArabic -> numbersignArabic.4
| <AllFigures> <AllFigures> <AllFigures> <AllFigures>

which substitutes for the default number sign a wider variant that can
carry four digits (note that the lookup accepts Arabic, Persian or
European digits as context).

The GPOS contextual kerning is complex, and requires a series of lookups
that move and adjust the width of individual digit glyphs depending on
how many digits are applied to the sign. These are also expressed as LTR
lookups with context in logical order e.g.

numbersignArabic.4 | <AllFigures> <AllFigures> <AllFigures>

which is the context for the lookup controlling positioning for the
first of four digits applied to the number sign.

So yes, the expected glyph order is logical, and the layout engine has
to keep track of the directionality within the string.

JH


--

Tiro Typeworks www.tiro.com
Gulf Islands, BC ti...@tiro.com

Behnam Rassi

unread,
May 28, 2012, 6:25:50 PM5/28/12
to Connie Bobroff, John Hudson, Persian Computing
Actually from what I see, in OS X there is no possibility to even test the fonts for year sign behaviour. The year sign is simply ignored and when you actually input it in Text Edit, it doesn’t show. I copy&pasted from Text Edit to Mellel and the character reappeared. Mellel is incapable of supporting its OT behaviour but it does show the character. I didn’t test Open Office and others. I don’t know if Adobe products can support it but any application on the Mac which relies on Mac Core Text engine (Nisus, NeoOffice etc.) will likely be incapable of showing the character to begin with! (I only tested OS X and Mellel though)

-b

Shervin Afshar

unread,
May 28, 2012, 6:57:31 PM5/28/12
to Behnam Rassi, Connie Bobroff, John Hudson, Persian Computing
I noticed the same problem with Text Edit, but with NeoOffice using Amiri font I had a bit of success as the string of U+0601 followed by three Arabic numerals—say, ۱۲۳—ended up being rendered as U+0601 encompassing the first numeral in the string and the rest were left out. The same thing happens with other encompassing symbols like U+06DD ( ۝ : ARABIC END OF AYAH).

Also, regarding the limitation of encompassing numeral for U+0601, considering the following OT code:

http://amiri.git.sourceforge.net/git/gitweb.cgi?p=amiri/amiri;a=blob_plain;f=sources/enclosing.fea;hb=HEAD

Does this definition limit the count of possible numerals to be enclosed, say...to three or four?

Finally, can anyone make any sense of the "hacks" recommended by SIL in this page in terms of what's happening with the Bidi behaviour?

http://scripts.sil.org/cms/scripts/page.php?item_id=ArabicFonts#b78d09ff

Do they work?

Shervin Afshar

unread,
May 28, 2012, 7:10:52 PM5/28/12
to Connie Bobroff, Persian Computing
What about using the font as a webfont for your HTML page? I think all of the previously mentioned fonts allow embedding; e.g. http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL-FAQ_web#2102274b

Behdad Esfahbod

unread,
May 28, 2012, 7:50:55 PM5/28/12
to Shervin Afshar, Behnam Rassi, Connie Bobroff, John Hudson, Persian Computing, Khaled Hosny, Harfbuzz
[CC'ing Khaled and HarfBuzz list]

On 05/28/2012 06:57 PM, Shervin Afshar wrote:
> I noticed the same problem with Text Edit, but with NeoOffice using Amiri font
> I had a bit of success as the string of U+0601 followed by three Arabic
> numerals—say, ۱۲۳—ended up being rendered as U+0601 encompassing the first
> numeral in the string and the rest were left out. The same thing happens with
> other encompassing symbols like U+06DD ( ۝ : ARABIC END OF AYAH).
>
> Also, regarding the limitation of encompassing numeral for U+0601, considering
> the following OT code:
>
> http://amiri.git.sourceforge.net/git/gitweb.cgi?p=amiri/amiri;a=blob_plain;f=sources/enclosing.fea;hb=HEAD
>
> Does this definition limit the count of possible numerals to be enclosed,
> say...to three or four?

It *tries* to limit to four I believe. Read below:

This block:

feature calt {
sub @YearSign @Digits' lookup
digit2medium;
sub @Digits.medium @YearSign @Digits' lookup
digit2medium;
sub @Digits.medium @Digits.medium @YearSign @Digits' lookup
digit2medium;
sub @Digits.medium @Digits.medium @Digits.medium @YearSign @Digits' lookup
digit2medium;
} calt;


Looks completely wrong to me in that it matches the backtrack sequence in the
wrong order. Ie, from what I understand, and I can be totally wrong, it
should have lines like this:

sub @YearSign @Digits.medium @Digits.medium @Digits' lookup digit2medium;

instead of this:

sub @Digits.medium @Digits.medium @YearSign @Digits' lookup digit2medium;


I like how Scheherazade SIL implements this BTW.


> Finally, can anyone make any sense of the "hacks" recommended by SIL in this
> page in terms of what's happening with the Bidi behaviour?
>
> http://scripts.sil.org/cms/scripts/page.php?item_id=ArabicFonts#b78d09ff
>
> Do they work?

That's what I was explaining before. Two things:

1. You want to force the enclosing sign into the same bidi run as the numbers.
Because, as I said, before Unicode 5.1 it was classified as an Arabic Letter
and hence RTL, whereas digits are LTR.

2. It's not clear whether the OpenType rules should expect an LTR glyph
sequence here, or RTL.

Hence the two described hacks, to force all LTR, or force all RTL.

Neither works with current harfbuzz-ng of course, since we always flip Arabic
to be RTL before applying lookups. I have to consult the OpenType list to
decide how we want to resolve that.

HTH,
behdad

Khaled Hosny

unread,
May 28, 2012, 10:29:03 PM5/28/12
to Behdad Esfahbod, Shervin Afshar, Behnam Rassi, Connie Bobroff, John Hudson, Persian Computing, Harfbuzz
On Mon, May 28, 2012 at 07:50:55PM -0400, Behdad Esfahbod wrote:
> [CC'ing Khaled and HarfBuzz list]
>
> On 05/28/2012 06:57 PM, Shervin Afshar wrote:
> > I noticed the same problem with Text Edit, but with NeoOffice using Amiri font
> > I had a bit of success as the string of U+0601 followed by three Arabic
> > numerals—say, ۱۲۳—ended up being rendered as U+0601 encompassing the first
> > numeral in the string and the rest were left out. The same thing happens with
> > other encompassing symbols like U+06DD ( ۝ : ARABIC END OF AYAH).
> >
> > Also, regarding the limitation of encompassing numeral for U+0601, considering
> > the following OT code:
> >
> > http://amiri.git.sourceforge.net/git/gitweb.cgi?p=amiri/amiri;a=blob_plain;f=sources/enclosing.fea;hb=HEAD
> >
> > Does this definition limit the count of possible numerals to be enclosed,
> > say...to three or four?
>
> It *tries* to limit to four I believe. Read below:

Four for year sign and three for the others which is reasonable IMO (at
least of end of ayah and footnote sign, not sure about number sign).

> This block:
>
> feature calt {
> sub @YearSign @Digits' lookup digit2medium;
> sub @Digits.medium @YearSign @Digits' lookup digit2medium;
> sub @Digits.medium @Digits.medium @YearSign @Digits' lookup digit2medium;
> sub @Digits.medium @Digits.medium @Digits.medium @YearSign @Digits' lookup digit2medium;
> } calt;
>
> Looks completely wrong to me in that it matches the backtrack sequence in the
> wrong order. Ie, from what I understand, and I can be totally wrong, it
> should have lines like this:
>
> sub @YearSign @Digits.medium @Digits.medium @Digits' lookup digit2medium;
>
> instead of this:
>
> sub @Digits.medium @Digits.medium @YearSign @Digits' lookup digit2medium;

AFAIK the backtrack coverage has to be in the reverse order, if I do as
you suggest, only first digit will be matched. This have been tested
with FireFox¹ (hb-ng), Pango (hb-old), LibreOffice (ICU) and MS Word
(Uniscribe), so I think it is correct² :)

> I like how Scheherazade SIL implements this BTW.

I wanted to do it with as fewer glyph variants as possible (was then
obsessed with smaller file size) and Scheherazade’s didn’t work with
LibreOffice last time I checked.

> > Finally, can anyone make any sense of the "hacks" recommended by SIL in this
> > page in terms of what's happening with the Bidi behaviour?
> >
> > http://scripts.sil.org/cms/scripts/page.php?item_id=ArabicFonts#b78d09ff
> >
> > Do they work?
>
> That's what I was explaining before. Two things:
>
> 1. You want to force the enclosing sign into the same bidi run as the numbers.
> Because, as I said, before Unicode 5.1 it was classified as an Arabic Letter
> and hence RTL, whereas digits are LTR.

AFAIK this is no longer an issue, it has been fixed in later Unicode
releases and an up to date software stack should do just fine with no
hacks.

Regards,
Khaled

¹ only end of ayah not the others, but since they all share the same
lookup, I suspect it is a Unicode properties issue on FireFox side.

² The last Amiri release had a thinko that didn’t exist in previous
release which breaks the positioning of the digits, but the substation
is OK, and is already fixed on master.

Connie Bobroff

unread,
May 29, 2012, 1:55:01 AM5/29/12
to Shervin Afshar, Persian Computing
Shervin, that is a good idea to embed, something I've been meaning to try for a while. Of course, all these fancy Persian fonts are not really made for web use and the fontsize, relative to default core fonts like Times New Roman, Tahoma, Geeza Pro is VERY small which means I will have to designate a huge fontsize. Then if the embedding doesn't work and a default font is instead displayed, it will appear extraordinarily huge. It is unfortunate that all Persian fonts are not the same relative size.  Server guys tell me the site will be down until Tuesday their time so I'll try to figure that out then.

Behdad Esfahbod

unread,
May 29, 2012, 2:06:43 AM5/29/12
to Connie Bobroff, Shervin Afshar, Persian Computing
On 05/29/2012 01:55 AM, Connie Bobroff wrote:
> Shervin, that is a good idea to embed, something I've been meaning to try for
> a while. Of course, all these fancy Persian fonts are not really made for web
> use and the fontsize, relative to default core fonts like Times New Roman,
> Tahoma, Geeza Pro is VERY small which means I will have to designate a huge
> fontsize. Then if the embedding doesn't work and a default font is instead
> displayed, it will appear extraordinarily huge. It is unfortunate that all
> Persian fonts are not the same relative size. Server guys tell me the site
> will be down until Tuesday their time so I'll try to figure that out then.

CSS has the 'font-size-adjust' property to try to address this. I proposed
that it be included in the @font-face declaration, but I'm not sure that has
happened. Plus, 'font-size-adjust' is defined in terms of x-height, which
does not really translate to Arabic. At any rate, lots of room for
experimenting, or moving the discussion to the W3 style working group.

behdad

Behdad Esfahbod

unread,
May 29, 2012, 2:19:41 AM5/29/12
to Khaled Hosny, Shervin Afshar, Behnam Rassi, Connie Bobroff, John Hudson, Persian Computing, Harfbuzz
On 05/28/2012 10:29 PM, Khaled Hosny wrote:
>
>> This block:
>>
>> feature calt {
>> sub @YearSign @Digits' lookup digit2medium;
>> sub @Digits.medium @YearSign @Digits' lookup digit2medium;
>> sub @Digits.medium @Digits.medium @YearSign @Digits' lookup digit2medium;
>> sub @Digits.medium @Digits.medium @Digits.medium @YearSign @Digits' lookup digit2medium;
>> } calt;
>>
>> Looks completely wrong to me in that it matches the backtrack sequence in the
>> wrong order. Ie, from what I understand, and I can be totally wrong, it
>> should have lines like this:
>>
>> sub @YearSign @Digits.medium @Digits.medium @Digits' lookup digit2medium;
>>
>> instead of this:
>>
>> sub @Digits.medium @Digits.medium @YearSign @Digits' lookup digit2medium;
>
> AFAIK the backtrack coverage has to be in the reverse order, if I do as
> you suggest, only first digit will be matched. This have been tested
> with FireFox¹ (hb-ng), Pango (hb-old), LibreOffice (ICU) and MS Word
> (Uniscribe), so I think it is correct² :)

Right. That was my first guess. I looked in Scheherazade to confirm but it
doesn't use more than one backtrack glyph for these characters so that didn't
help. I then checked Adobe's documentation:

https://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html

It never defines how backtrack sequences are matched, but this example made me
think that it's matched in the straight order:

ignore substitute f [a e] d'
ignore substitute a d' d;
substitute [a e n] d' by d.alt;

It's the first line that suggests that it's trying to match and ignore 'fad'
and 'fed' as opposed to 'afd' and 'efd'.

Now, I know that in the OT tables backtrack is encoded in reverse order, so
this can quite possibly be a documentation issue on Adobe's side.

I don't seem to have the Adobe 'fea' parser source code to check, so I will
report this to Adobe in a separate thread and CC you.

behdad

Behdad Esfahbod

unread,
May 31, 2012, 1:00:31 AM5/31/12
to Khaled Hosny, Behdad Esfahbod, Shervin Afshar, Behnam Rassi, Connie Bobroff, John Hudson, Persian Computing, Harfbuzz
On 2012-05-28, at 10:29 PM, Khaled Hosny <khale...@eglug.org> wrote:

> On Mon, May 28, 2012 at 07:50:55PM -0400, Behdad Esfahbod wrote:
>> [CC'ing Khaled and HarfBuzz list]
>>
>>>
>>>
>>>
>>
>> This block:
>>
>> feature calt {
>> sub @YearSign @Digits' lookup digit2medium;
>> sub @Digits.medium @YearSign @Digits' lookup digit2medium;
>> sub @Digits.medium @Digits.medium @YearSign @Digits' lookup digit2medium;
>> sub @Digits.medium @Digits.medium @Digits.medium @YearSign @Digits' lookup digit2medium;
>> } calt;
>>
>> Looks completely wrong to me in that it matches the backtrack sequence in the
>> wrong order. Ie, from what I understand, and I can be totally wrong, it
>> should have lines like this:
>>
>> sub @YearSign @Digits.medium @Digits.medium @Digits' lookup digit2medium;
>>
>> instead of this:
>>
>> sub @Digits.medium @Digits.medium @YearSign @Digits' lookup digit2medium;
>
> AFAIK the backtrack coverage has to be in the reverse order, if I do as
> you suggest, only first digit will be matched. This have been tested
> with FireFox¹ (hb-ng), Pango (hb-old), LibreOffice (ICU) and MS Word
> (Uniscribe), so I think it is correct² :)

Reporting back from the Adobe communication thread:

So, apparently Adobe meant the backtrack sequence to be in logical
order, not reversed. Combining this with Khaled's observation of the
font working can only suggest that Fontforge is producing backtrack
table in reverse. Fixing that will break all fo ts relying on that
behavior of Fontforge. Khaled is to investigate more to figure out how
to proceed.

behdad

Khaled Hosny

unread,
May 31, 2012, 12:58:47 AM5/31/12
to Behdad Esfahbod, Shervin Afshar, Behnam Rassi, Connie Bobroff, John Hudson, Persian Computing, Harfbuzz
On Tue, May 29, 2012 at 04:29:03AM +0200, Khaled Hosny wrote:
> ¹ only end of ayah not the others, but since they all share the same
> lookup, I suspect it is a Unicode properties issue on Firefox side.

This might be a Firefox regression, I commented here:
https://bugzilla.mozilla.org/show_bug.cgi?id=438571#c21

Regards,
Khaled

Behdad Esfahbod

unread,
May 31, 2012, 1:28:52 AM5/31/12
to Khaled Hosny, Behdad Esfahbod, Shervin Afshar, Behnam Rassi, Connie Bobroff, John Hudson, Persian Computing, Harfbuzz
On 2012-05-31, at 12:58 AM, Khaled Hosny <khale...@eglug.org> wrote:

> On Tue, May 29, 2012 at 04:29:03AM +0200, Khaled Hosny wrote:
>> ¹ only end of ayah not the others, but since they all share the same
>> lookup, I suspect it is a Unicode properties issue on Firefox side.
>
> This might be a Firefox regression, I commented here:
> https://bugzilla.mozilla.org/show_bug.cgi?idC8571#c21

Link broken?

> Regards,
> Khaled

Khaled Hosny

unread,
May 31, 2012, 1:48:41 AM5/31/12
to Behdad Esfahbod, Behdad Esfahbod, Shervin Afshar, Behnam Rassi, Connie Bobroff, John Hudson, Persian Computing, Harfbuzz
Something converted =‌43 to C on your side (I inserted a ZWNJ to
see if this will fool it), here is shortened URL:
http://goo.gl/tc5T4

Regards,
Khaled

Connie Bobroff

unread,
Jun 2, 2012, 4:41:18 AM6/2/12
to Khaled Hosny, Behdad Esfahbod, Behdad Esfahbod, Shervin Afshar, Behnam Rassi, John Hudson, Persian Computing, Harfbuzz
I made a browser test page for this issue:
Although I followed the instructions on the SIL website, the @fontface is not apparently working.
You are supposed to see it in Arabic Typesetting font (all Windows users) or otherwise, it should access the Scheherazade font placed in the same folder. Not sure what went wrong.
Currently these symbols seem to only work if you're on Windows and IE.

Khaled Hosny

unread,
Jun 3, 2012, 12:19:24 PM6/3/12
to Behdad Esfahbod, Behdad Esfahbod, Shervin Afshar, Behnam Rassi, Connie Bobroff, John Hudson, Persian Computing, Harfbuzz
This have been fixed in FontForge’s master branch, it will break feature
files expecting the older behaviour, but there is not much we can do
here, and it is hardly the only incompatible fix to FontForge’s feature
file code since the last release.

Regards,
Khaled

Khaled Hosny

unread,
Jun 3, 2012, 12:25:39 PM6/3/12
to Connie Bobroff, Behdad Esfahbod, Behdad Esfahbod, Shervin Afshar, Behnam Rassi, John Hudson, Persian Computing, Harfbuzz
I've a version of Amiri font that works with Firefox as well (still have
to test it on Windows), I can send it to if you want to test it (though
my number sign handles up to 3 digits only, but if this is wrong I’m
happy to extend it).

Regards,
Khaled

Behdad Esfahbod

unread,
Jun 3, 2012, 1:12:05 PM6/3/12
to Khaled Hosny, Behdad Esfahbod, Shervin Afshar, Behnam Rassi, Connie Bobroff, John Hudson, Persian Computing, Harfbuzz
On 06/03/2012 12:19 PM, Khaled Hosny wrote:
> This have been fixed in FontForge’s master branch, it will break feature
> files expecting the older behaviour, but there is not much we can do
> here, and it is hardly the only incompatible fix to FontForge’s feature
> file code since the last release.

Thanks Khaled. I still don't have any idea how to correctly handle these
sequences in HarfBuzz, but will experiment with Uniscribe, try to see if I can
figure out what it's doing.

behdad

Connie Bobroff

unread,
Jun 3, 2012, 10:56:47 PM6/3/12
to Behdad Esfahbod, Khaled Hosny, Behdad Esfahbod, Shervin Afshar, Behnam Rassi, John Hudson, Persian Computing, Harfbuzz
Khaled,
Yes, please send the version of Amiri that works on Firefox. The latest version from SourceForge works very nicely on IE but not Firefox. Amiri is nice in that it's relatively the same size as Tahoma and therefore, much more suitable for web use than the others. (However, for this particular project, unfortunately, I won't be able to use it since the Heh Goal is not the right shape to match the old style manuscript.)
 
I did not quite see until now these "Advanced Features" on SIL which say how many digits the font allows:
Probably there should be a discussion somewhere about using "Arabic Number Sign" for dates and therefore needing 4 digits. I presume "Arabic Sign Samvat" will be given 4 digits but as I said, it's the wrong shape at least for me in this project.
-Connie

Connie Bobroff

unread,
Jun 4, 2012, 2:16:13 AM6/4/12
to Khaled Hosny, Behdad Esfahbod, Behdad Esfahbod, Shervin Afshar, Behnam Rassi, John Hudson, Persian Computing, Harfbuzz
Khaled,
Thanks and congratulations. The new Amiri works great on Firefox. All 4 digits are nicely above the Arabic Number Sign. (Just note that if the right-most digit is "8", the bottom, right portion collides with the Arabic Number Sign a bit. But no big deal.
I think the other points, many of which are critical issues, need to be taken up in a separate thread. Please hang on.


 
On Mon, Jun 4, 2012 at 11:02 AM, Khaled Hosny <khale...@eglug.org> wrote:
On Mon, Jun 04, 2012 at 08:26:47AM +0530, Connie Bobroff wrote:
> Khaled,
> Yes, please send the version of Amiri that works on Firefox. The latest version
> from SourceForge works very nicely on IE but not Firefox.

File attached.


> Amiri is nice in that it's relatively the same size as Tahoma and
> therefore, much more suitable for web use than the others.

That is by design, almost all Arabic fonts are ridiculously too small
compared to Latin for reason beyond me, making it impossible to use the
same point size for Arabic and non-Arabic text.


> (However, for this particular project, unfortunately, I won't be able
> to use it since the Heh Goal is not the right shape to match the old
> style manuscript.)

This was intentional, IMO many of the variant Arabic letters in Unicode
are really stylistic variants specific to certain calligraphic style
commonly used for certain languages, Heh Goal is such an example, it is
a Nastliq-style variant of the regular Heh and a calligrapher writing
Heh this way will do so even when writing Arabic or any other language
using Arabic script, the same applies for the so-called Keheh or Farsi
Kaf which is really a Nastaliq Kaf, and Arabic calligraphers writing in
Nastaliq use that very same Kaf. So for Amiri, being a Naskh style font,
I decided that this variance makes no sense and does not match the
design so I ignored it, however if there is evidence of manuscripts in
Naskh style making that distinction I'll happily follow it.


> I did not quite see until now these "Advanced Features" on SIL which say how
> many digits the font allows:
> http://scripts.sil.org/cms/scripts/page.php?item_id=ArabicFonts
> Probably there should be a discussion somewhere about using "Arabic Number
> Sign" for dates and therefore needing 4 digits. I presume "Arabic Sign Samvat"
> will be given 4 digits but as I said, it's the wrong shape at least for me in
> this project.

The problem is that I don’t really know what is the intended use of the
Arabic number sign, the available Unicode proposals that supposedly lead to its
inclusion do not say much about it:
http://std.dkuug.dk/jtc1/sc2/wg2/docs/n2413.htm

This page says it is “used to indicate the beginning of a number” which
does not say much either, but suggests it takes an arbitrary number
digits, so I extended Amiri’s number sign to accept 4 digits:
http://people.w3.org/rishida/scripts/urdu/

Regards,
 Khaled

Khaled Hosny

unread,
Jun 4, 2012, 1:32:46 AM6/4/12
to Connie Bobroff, Behdad Esfahbod, Behdad Esfahbod, Shervin Afshar, Behnam Rassi, John Hudson, Persian Computing, Harfbuzz
On Mon, Jun 04, 2012 at 08:26:47AM +0530, Connie Bobroff wrote:
> Khaled,
> Yes, please send the version of Amiri that works on Firefox. The latest version
> from SourceForge works very nicely on IE but not Firefox.

File attached.

> Amiri is nice in that it's relatively the same size as Tahoma and
> therefore, much more suitable for web use than the others.

That is by design, almost all Arabic fonts are ridiculously too small
compared to Latin for reason beyond me, making it impossible to use the
same point size for Arabic and non-Arabic text.

> (However, for this particular project, unfortunately, I won't be able
> to use it since the Heh Goal is not the right shape to match the old
> style manuscript.)

This was intentional, IMO many of the variant Arabic letters in Unicode
are really stylistic variants specific to certain calligraphic style
commonly used for certain languages, Heh Goal is such an example, it is
a Nastliq-style variant of the regular Heh and a calligrapher writing
Heh this way will do so even when writing Arabic or any other language
using Arabic script, the same applies for the so-called Keheh or Farsi
Kaf which is really a Nastaliq Kaf, and Arabic calligraphers writing in
Nastaliq use that very same Kaf. So for Amiri, being a Naskh style font,
I decided that this variance makes no sense and does not match the
design so I ignored it, however if there is evidence of manuscripts in
Naskh style making that distinction I'll happily follow it.

> I did not quite see until now these "Advanced Features" on SIL which say how
> many digits the font allows:
> http://scripts.sil.org/cms/scripts/page.php?item_id=ArabicFonts
> Probably there should be a discussion somewhere about using "Arabic Number
> Sign" for dates and therefore needing 4 digits. I presume "Arabic Sign Samvat"
> will be given 4 digits but as I said, it's the wrong shape at least for me in
> this project.

The problem is that I don’t really know what is the intended use of the
Arabic number sign, the available Unicode proposals that supposedly lead to its
inclusion do not say much about it:
http://std.dkuug.dk/jtc1/sc2/wg2/docs/n2413.htm

This page says it is “used to indicate the beginning of a number” which
does not say much either, but suggests it takes an arbitrary number
digits, so I extended Amiri’s number sign to accept 4 digits:
http://people.w3.org/rishida/scripts/urdu/

Regards,
Khaled

amiri-regular.ttf.xz

Khaled Hosny

unread,
Jun 4, 2012, 4:45:18 AM6/4/12
to Connie Bobroff, Behdad Esfahbod, Behdad Esfahbod, Shervin Afshar, Behnam Rassi, John Hudson, Persian Computing, Harfbuzz
Thanks, I fixed the eight issue.

Regards,
Khaled

Connie Bobroff

unread,
Jun 5, 2012, 12:02:39 AM6/5/12
to Khaled Hosny, Behdad Esfahbod, Behdad Esfahbod, Shervin Afshar, Behnam Rassi, John Hudson, Persian Computing, Harfbuzz
Khaled,
Thanks for fixing the 8 problem.
 
I would also like to see the discussion on these symbols. I don't know what then intended use of Arabic Number Sign was. It would be nice to know.

Behdad Esfahbod

unread,
Jun 11, 2012, 9:01:07 AM6/11/12
to Connie Bobroff, Khaled Hosny, Behdad Esfahbod, Shervin Afshar, Behnam Rassi, John Hudson, Persian Computing, Harfbuzz
BTW, I came across this picture from six years ago, before Unicode had fixed
the bidi category of the Arabic number sign:

https://secure.flickr.com/photos/behdad/107995524

I still have no idea how to fix it in HarfBuzz without breaking other stuff...

Behdad Esfahbod

unread,
Jul 22, 2012, 10:02:05 PM7/22/12
to Connie Bobroff, Khaled Hosny, Behdad Esfahbod, Shervin Afshar, Behnam Rassi, John Hudson, Persian Computing, Harfbuzz
Khaled,

I think I now have a solution to this problem. You can use 'rtlm'/'ltrm' to
choose different behavior based on the direction the shaper ended up appyling
features. You may want to apply your font.

Let me know if this works.

behdad

Connie Bobroff

unread,
Aug 3, 2012, 11:47:04 PM8/3/12
to Behdad Esfahbod, Khaled Hosny, Behdad Esfahbod, Shervin Afshar, Behnam Rassi, John Hudson, Persian Computing, Harfbuzz
Hi Everyone,
Good news: Behdad has added Amiri to the Google web fonts.
See Line 14.
Although the Arabic Number Sign digits are somehow a bit squished, Firefox users (at least on Windows, not sure about Mac...) can now see the year and signs properly aligned vertically.

Khaled Hosny

unread,
Jan 22, 2013, 5:57:17 PM1/22/13
to Connie Bobroff, Persian Computing
Hi Connie,

It have been a while, but next version of Amiri will make the number
sign digits of the same size as year sign ones, you can test it from
here:
http://khaledhosny.org/files/tmp/amiri-0.106.tar.bz2

Regards,
Khaled

P.S. Persian readers will probably appreciate the new, Nastaliqish,
design of Gaf, instead of the old, more Naskhi but unconventional, one.
gaf.png

Connie Bobroff

unread,
Jan 23, 2013, 12:53:16 AM1/23/13
to Khaled Hosny, Persian Computing
Khaled,
Thanks for the update. I installed the new version and the numbers look very nice now in the appropriate size. Now we just need to get Behdad to update the Google web font, <hint> <hint>!
A for the new Gaf, I'm not sure I like it. See what the others say. For example,
کک
(means "flea" in Persian) looks a little strange to my eye.
Again, thanks for all this. It's great to have this font.

Connie Bobroff

unread,
Jan 23, 2013, 1:30:44 AM1/23/13
to Khaled Hosny, Persian Computing
Very good.

On Wed, Jan 23, 2013 at 11:48 AM, Khaled Hosny <khale...@eglug.org> wrote:
On Wed, Jan 23, 2013 at 11:23:16AM +0530, Connie Bobroff wrote:
> Khaled,
> Thanks for the update. I installed the new version and the numbers look
> very nice now in the appropriate size. Now we just need to get Behdad to
> update the Google web font, <hint> <hint>!

This is just a snapshot, there probably will be a new release before the
end of the month.


> A for the new Gaf, I'm not sure I like it. See what the others say. For
> example,
> کک
> (means "flea" in Persian) looks a little strange to my eye.

That is actually the old form, seems I missed some contextual form. It
should have been looked like ک‍ک.

Regards,
Khaled

Khaled Hosny

unread,
Jan 23, 2013, 1:18:35 AM1/23/13
to Connie Bobroff, Persian Computing
On Wed, Jan 23, 2013 at 11:23:16AM +0530, Connie Bobroff wrote:
> Khaled,
> Thanks for the update. I installed the new version and the numbers look
> very nice now in the appropriate size. Now we just need to get Behdad to
> update the Google web font, <hint> <hint>!

This is just a snapshot, there probably will be a new release before the
end of the month.

> A for the new Gaf, I'm not sure I like it. See what the others say. For
> example,
> کک
> (means "flea" in Persian) looks a little strange to my eye.

That is actually the old form, seems I missed some contextual form. It
should have been looked like ک‍ک.

Regards,
Khaled

Behnam Rassi

unread,
Jan 23, 2013, 3:56:12 AM1/23/13
to Khaled Hosny, Connie Bobroff, Persian Computing
Although it's vastly ignored, but I vaguely remember from my school time that the proper use of Sarkash in final and single forms was 'either Sarkash or miniaturized sign'. Not both.
In pre-Roman Turkish notations, there seemed to be a form for Gaf following that logic.

But I didn't do a serious research really. I just picked up bits of informations here and there.
-behnam

<gaf.png>

Behdad Esfahbod

unread,
Jan 29, 2013, 11:14:24 PM1/29/13
to Behnam Rassi, Khaled Hosny, Connie Bobroff, Persian Computing
I don't remember ever seeing a Gaf without sarkesh. That said, I remember
having seen Kaf with a Kafche *with* an extra stroke *underneath*, not above;
mostly in handwriting perhaps.

On 13-01-23 03:56 AM, Behnam Rassi wrote:
> Although it's vastly ignored, but I vaguely remember from my school time that
> the proper use of Sarkash in final and single forms was 'either Sarkash or
> miniaturized sign'. Not both.
> In pre-Roman Turkish notations, there seemed to be a form for Gaf following
> that logic.
>
> But I didn't do a serious research really. I just picked up bits of
> informations here and there.
> -behnam
>
> On 2013-01-22, at 5:57 PM, Khaled Hosny <khale...@eglug.org
--
behdad
http://behdad.org/

Khaled Hosny

unread,
Jan 31, 2013, 3:50:12 PM1/31/13
to Connie Bobroff, Persian Computing
On Wed, Jan 23, 2013 at 08:18:35AM +0200, Khaled Hosny wrote:
> On Wed, Jan 23, 2013 at 11:23:16AM +0530, Connie Bobroff wrote:
>
> > A for the new Gaf, I'm not sure I like it. See what the others say. For
> > example,
> > کک
> > (means "flea" in Persian) looks a little strange to my eye.
>
> That is actually the old form, seems I missed some contextual form. It
> should have been looked like ک‍ک.

I uploaded a new tarball where this is fixed, please test (the old form
can be accessed with ss04 feature, for people who like it).

http://khaledhosny.org/files/tmp/amiri-0.106.tar.bz2

Regards,
Khaled
Reply all
Reply to author
Forward
0 new messages