https://bugs.documentfoundation.org/show_bug.cgi?id=166037

--- Comment #9 from Khaled Hosny <[email protected]> ---
(In reply to seen from comment #8)
> (In reply to Khaled Hosny from comment #7)
> > (In reply to seen from comment #6)
> > > (In reply to Khaled Hosny from comment #5)
> > > > We convert languages to BCP47 tags when calling HarfBuzz (using 
> > > > getBcp47()),
> > > > so any solution that results in `el-polyton` being passed to HarfBuzz 
> > > > should
> > > > work.
> > > If the BCP47 tag `grc-polyton` [polytonic Ancient Greek] were passed to
> > > HarfBuzz, would it apply the font’s 'ss16' stylistic set in the same way
> > > that it does when it receives the `el-polyton` tag?
> > Seems so:
> Then if it’s the case that LibreOffice language “Greek” corresponds to BCP47
> tag `el` [Modern Greek], and “Greek, Ancient” corresponds to `grc` [Ancient
> Greek], then it would seem as though adding two new LibreOffice language
> correspondences, e.g. “Greek, Polytonic” → `el-polyton` [polytonic Modern
> Greek] and “Greek, Ancient, Polytonic” → `grc-polyton` [polytonic Ancient
> Greek], would resolve this bug.

I don’t understand the relationship between various language tag systems, but
OpenType seems to map both ELL and PGR to  ISO 639 ell
https://learn.microsoft.com/en-us/typography/opentype/spec/languagetags.

Similarly, HarfBuzz does not know grc language tag and converts it to uppercase
GRC tag unchanged, and converts -polyton subtag to PGR regardless of the
language tag (even with no language tag at all).

$ ./test-lang grek el
grek, el -> grek , ELL

$ ./test-lang grek el-polyton
grek, el-polyton -> grek , PGR

$ ./test-lang grek xx-polyton
grek, xx-polyton -> grek , PGR

$ ./test-lang grek -polyton
grek, -polyton -> grek , PGR

$ ./test-lang grek grc
grek, grc -> grek , GRC

$ ./test-lang grek grc-polyton
grek, grc-polyton -> grek , PGR


Using this test program:

#include <hb.h>
#include <hb-ot.h>
#include <stdio.h>

int main(int argc, char** argv)
{
        char* script_str = argv[1];
        char* language_str = argv[2];
        hb_script_t script = hb_script_from_string (script_str, -1);
        hb_language_t language = hb_language_from_string (language_str, -1);

        hb_tag_t script_tags[10];
        hb_tag_t language_tags[10];
        unsigned int script_count = 10;
        unsigned int language_count = 10;
        hb_ot_tags_from_script_and_language (script, language,
                &script_count, script_tags,
                &language_count, language_tags);

        printf("%s, %s -> ", script_str, language_str);
        for (unsigned int i = 0; i < script_count; i++)
                printf("%c%c%c%c ", HB_UNTAG(script_tags[i]));
        printf(", ");
        for (unsigned int i = 0; i < language_count; i++)
                printf("%c%c%c%c ", HB_UNTAG(language_tags[i]));
        printf("\n");
}

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to