Re: [HarfBuzz] Support for Stylistic Sets

2019-09-15 Thread Eli Zaretskii
> Date: Sun, 15 Sep 2019 12:37:25 +0100
> From: Richard Wordingham 
> 
> > > > Does HarfBuzz guess the language?  
> > >
> > > Yes.
> 
> It seems to use the current locale.  That will usually be wrong for
> cuneiform, and generally be wrong for multilingual text.

But Emacs currently doesn't know better anyway.  When it does, we will
pass that information to HarfBuzz, but for now I see no reason to
replace HarfBuzz's guess based on the locale by Emacs's guess based on
that same locale.
___
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/harfbuzz

Re: [HarfBuzz] Support for Stylistic Sets

2019-09-15 Thread Eli Zaretskii
> From: Nikolay Sivov 
> Date: Sun, 15 Sep 2019 10:03:01 +0300
> Cc: Richard Wordingham , 
>   Harfbuzz 
> 
>  > Essentially yes, i.e. unsupported features will simply be ignored.
> 
>  Then there's no need to know whether a feature is supported.  Thanks.
> 
> MS Word for example shows a preview for each support ssXX feature, and user 
> can select one they want.
> 
> I don't know how (or why) you plan to use that for emacs, but you'll need to 
> have some logic to figure out
> which one to enable.

I think this should be up to the user and/or the application,
i.e. Lisp program that wants to take advantage of these features.

Or maybe I misunderstand what you mean by "figure out which one to
enable"?  Can you elaborate on the potential pitfalls?
___
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/harfbuzz

Re: [HarfBuzz] Support for Stylistic Sets

2019-09-15 Thread Ebrahim Byagowi
Hey there,

> The next question is how to know whether a given hb_font_t supports a
given feature?

Apparently you won't need this anymore. If you do however, you can use
`hb_ot_layout_language_find_feature`, it has the mentioned the
complications, after that you can even issue
`hb_ot_layout_feature_get_name_ids` to get name ids fonts provide for the
ssXX and cvXX features, have a look at this test,


https://github.com/harfbuzz/harfbuzz/blob/a33f238fcc969e1e393deda0518fb8dd6b13/test/api/test-ot-name.c#L35-L70

cvXX are apparently newer and can provide even more information so you may
like to encourage that in other applications you may have. Thanks!


On Sun, Sep 15, 2019 at 4:07 PM Richard Wordingham <
richard.wording...@ntlworld.com> wrote:

> On Sun, 15 Sep 2019 10:03:01 +0300
> Nikolay Sivov  wrote:
>
> > On Sun, Sep 15, 2019 at 5:33 AM Eli Zaretskii  wrote:
>
> > > Then there's no need to know whether a feature is supported.
> > > Thanks.
>
> > MS Word for example shows a preview for each support ssXX feature,
> > and user can select one they want.
> >
> > I don't know how (or why) you plan to use that for emacs, but you'll
> > need to have some logic to figure out which one to enable.
>
> I believe Emacs systems include intelligent wetware.
>
> I hope Eli's planning on allowing other features.  Some features may
> increase the differences between same script confusables, e.g. '0' v.
> 'O', 'l' v. '1' and 'ɡ' v. 'g'.
>
> > > > Does HarfBuzz guess the language?
> > >
> > > Yes.
>
> It seems to use the current locale.  That will usually be wrong for
> cuneiform, and generally be wrong for multilingual text.
>
> Richard.
> ___
> HarfBuzz mailing list
> HarfBuzz@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/harfbuzz
___
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/harfbuzz

Re: [HarfBuzz] Support for Stylistic Sets

2019-09-15 Thread Richard Wordingham
On Sun, 15 Sep 2019 10:03:01 +0300
Nikolay Sivov  wrote:

> On Sun, Sep 15, 2019 at 5:33 AM Eli Zaretskii  wrote:

> > Then there's no need to know whether a feature is supported.
> > Thanks. 

> MS Word for example shows a preview for each support ssXX feature,
> and user can select one they want.
> 
> I don't know how (or why) you plan to use that for emacs, but you'll
> need to have some logic to figure out which one to enable.

I believe Emacs systems include intelligent wetware.

I hope Eli's planning on allowing other features.  Some features may
increase the differences between same script confusables, e.g. '0' v.
'O', 'l' v. '1' and 'ɡ' v. 'g'.

> > > Does HarfBuzz guess the language?  
> >
> > Yes.

It seems to use the current locale.  That will usually be wrong for
cuneiform, and generally be wrong for multilingual text.

Richard. 
___
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/harfbuzz

Re: [HarfBuzz] Support for Stylistic Sets

2019-09-15 Thread Nikolay Sivov
On Sun, Sep 15, 2019 at 5:33 AM Eli Zaretskii  wrote:

> > Date: Sat, 14 Sep 2019 21:33:00 +0100
> > From: Richard Wordingham 
> > Cc: harfbuzz@lists.freedesktop.org
> >
> > On Sat, 14 Sep 2019 21:15:04 +0300
> > Eli Zaretskii  wrote:
> >
> > > > Date: Sat, 14 Sep 2019 18:13:25 +0100
> > > > From: Richard Wordingham 
> > > >
> > > > I think it's safe to specify the use of unsupported features, in
> > > > which case this is a luxury feature.
> > >
> > > you mean, specifying an unsupported feature will not cause hb_shape to
> > > fail, but instead just use the nominal glyphs?
> >
> > Essentially yes, i.e. unsupported features will simply be ignored.
>
> Then there's no need to know whether a feature is supported.  Thanks.
>

MS Word for example shows a preview for each support ssXX feature, and user
can select one they want.

I don't know how (or why) you plan to use that for emacs, but you'll need
to have some logic to figure out which one to enable.


>
> > > Emacs currently leaves it to HarfBuzz to guess the language, so I
> > > don't think this is an issue.
> >
> > Does HarfBuzz guess the language?
>
> Yes.
> ___
> HarfBuzz mailing list
> HarfBuzz@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/harfbuzz
___
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/harfbuzz

Re: [HarfBuzz] Support for Stylistic Sets

2019-09-14 Thread Eli Zaretskii
> Date: Sat, 14 Sep 2019 21:33:00 +0100
> From: Richard Wordingham 
> Cc: harfbuzz@lists.freedesktop.org
> 
> On Sat, 14 Sep 2019 21:15:04 +0300
> Eli Zaretskii  wrote:
> 
> > > Date: Sat, 14 Sep 2019 18:13:25 +0100
> > > From: Richard Wordingham 
> > > 
> > > I think it's safe to specify the use of unsupported features, in
> > > which case this is a luxury feature.  
> > 
> > you mean, specifying an unsupported feature will not cause hb_shape to
> > fail, but instead just use the nominal glyphs?
> 
> Essentially yes, i.e. unsupported features will simply be ignored.

Then there's no need to know whether a feature is supported.  Thanks.

> > Emacs currently leaves it to HarfBuzz to guess the language, so I
> > don't think this is an issue.
> 
> Does HarfBuzz guess the language?

Yes.
___
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/harfbuzz

Re: [HarfBuzz] Support for Stylistic Sets

2019-09-14 Thread Richard Wordingham
On Sat, 14 Sep 2019 21:15:04 +0300
Eli Zaretskii  wrote:

> > Date: Sat, 14 Sep 2019 18:13:25 +0100
> > From: Richard Wordingham 
> > 
> > I think it's safe to specify the use of unsupported features, in
> > which case this is a luxury feature.  
> 
> you mean, specifying an unsupported feature will not cause hb_shape to
> fail, but instead just use the nominal glyphs?

Essentially yes, i.e. unsupported features will simply be ignored.

> > One complication is that features are provided by a font on a (per
> > script) per language basis.  
> 
> Why is that a complication?  The user who requests the feature should
> do so only for text of a suitable script, no?

It means that support questions need to be framed in terms of both
script and language.  One can't just ask if a font supports feature
'ss05' or if it supports the feature for Cyrillic - the answer will
depend on the script and language.

> Emacs currently leaves it to HarfBuzz to guess the language, so I
> don't think this is an issue.

Does HarfBuzz guess the language?  I would expect it to default to the
'default language', which shall be supported.  As that is all that those
dependent on Microsoft renderers will get, it should be good enough for
many users.

Richard.
___
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/harfbuzz

Re: [HarfBuzz] Support for Stylistic Sets

2019-09-14 Thread Eli Zaretskii
> Date: Sat, 14 Sep 2019 18:13:25 +0100
> From: Richard Wordingham 
> 
> I think it's safe to specify the use of unsupported features, in which
> case this is a luxury feature.

you mean, specifying an unsupported feature will not cause hb_shape to
fail, but instead just use the nominal glyphs?

> One complication is that features are provided by a font on a (per
> script) per language basis.

Why is that a complication?  The user who requests the feature should
do so only for text of a suitable script, no?

> For example, my Da Lekh font provides feature ss19 for the default
> language, but not for Lao, Tai Lü or 'Shan'. In this font, Feature
> ss19 means apply Lao style, and that is applied automatically if the
> font is told it is being used for Lao. It would be a bit off to tag
> aerated Pali text as Lao just to get a Lao style. Aerated Pali has
> different line-breaking rules to Lao, which is written without visible
> word separation.

Emacs currently leaves it to HarfBuzz to guess the language, so I
don't think this is an issue.
___
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/harfbuzz

Re: [HarfBuzz] Support for Stylistic Sets

2019-09-14 Thread Richard Wordingham
On Sat, 14 Sep 2019 18:59:56 +0300
Eli Zaretskii  wrote:

> The next question is how to know whether a given hb_font_t supports a
> given feature?

I think it's safe to specify the use of unsupported features, in which
case this is a luxury feature.  One complication is that features are
provided by a font on a (per script) per language basis.

For example, my Da Lekh font provides feature ss19 for the default
language, but not for Lao, Tai Lü or 'Shan'. In this font, Feature
ss19 means apply Lao style, and that is applied automatically if the
font is told it is being used for Lao. It would be a bit off to tag
aerated Pali text as Lao just to get a Lao style. Aerated Pali has
different line-breaking rules to Lao, which is written without visible
word separation.

Richard.
___
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/harfbuzz

Re: [HarfBuzz] Support for Stylistic Sets

2019-09-14 Thread Eli Zaretskii
> From: Nikolay Sivov 
> Date: Sat, 14 Sep 2019 17:00:53 +0300
> Cc: Harfbuzz 
> 
>  AFAIU, HarfBuzz does support Stylistic Sets, but it is not clear to me
>  what should an application do to request glyphs corresponding to a
>  certain stylistic set.
> 
>  Suppose an application wants to display a text string using a specific
>  stylistic set -- could someone please outline the sequence of API
>  calls to get that, or point me to some documentation which describes
>  that?
> 
> Hi, Eli.
> 
> I think it must be a matter of enabling features explicitly, in case you're 
> asking about it would be features
> ss01-ss20, see hb_shape() arguments documentation.
> Basically, you set hb_feature_t fields to appropriate tag, value (1 for 
> enabled), and start/end limits. That should
> do it.

I'm beginning to see the light, thanks.

So hb_feature_t's 'value' field should always be 1 for an enabled
features, and its 'tag' field should be something like

  HB_TAG('s', 's', '0', '1')

is that right?

The next question is how to know whether a given hb_font_t supports a
given feature?

Thanks.
___
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/harfbuzz

Re: [HarfBuzz] Support for Stylistic Sets

2019-09-14 Thread Nikolay Sivov
On Sat, Sep 14, 2019 at 4:54 PM Eli Zaretskii  wrote:

> Hi,
>
> AFAIU, HarfBuzz does support Stylistic Sets, but it is not clear to me
> what should an application do to request glyphs corresponding to a
> certain stylistic set.
>
> Suppose an application wants to display a text string using a specific
> stylistic set -- could someone please outline the sequence of API
> calls to get that, or point me to some documentation which describes
> that?
>

Hi, Eli.

I think it must be a matter of enabling features explicitly, in case you're
asking about it would be features ss01-ss20, see hb_shape() arguments
documentation.
Basically, you set hb_feature_t fields to appropriate tag, value (1 for
enabled), and start/end limits. That should do it.


>
> TIA
> ___
> HarfBuzz mailing list
> HarfBuzz@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/harfbuzz
___
HarfBuzz mailing list
HarfBuzz@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/harfbuzz