Was talking about 'm_language = "pes";' which can be replaced with "fa", other than that, you can go without setting language to buffer, there are cases like Serbian Cyrillic <https://en.wikipedia.org/wiki/OpenType#Serbian_Cyrillic_solution>, CJK distinguish and individual font preferences which makes it needed for those cases however one still can skip it for limited use but better to set it if you know the language.
On Sun, Feb 9, 2020 at 7:11 PM bianxg <765033...@qq.com> wrote: > It works well when use 'hb_buffer_guess_segment_properties'. Thanks. > > But, I don't understand this sentence. Can you explain more? > "Also modern Persian language has a ISO 639-1 code, "fa", which should be > used for your case instead AFAIK if is needed at all (not many fonts are > doing something specific for Persian)." > > ------------------ 原始邮件 ------------------ > *发件人:* "Ebrahim Byagowi"<ebrami...@gmail.com>; > *发送时间:* 2020年2月9日(星期天) 晚上10:53 > *收件人:* "bianxg"<765033...@qq.com>; > *抄送:* "harfbuzz"<harfbuzz@lists.freedesktop.org>; > *主题:* Re: [HarfBuzz] Render Persian probelm > > Hey there, Old Persian which you've used is a different script and wasn't > written in RTL also, the correct script selection for modern Persian is > Arabic, feel free to just use `hb_buffer_guess_segment_properties` which > sets it based on text you've given. > > Also modern Persian language has a ISO 639-1 code, "fa", which should be > used for your case instead AFAIK if is needed at all (not many fonts are > doing something specific for Persian). > > Cheers > > On Sun, Feb 9, 2020 at 4:43 PM bianxg <765033...@qq.com> wrote: > >> Hi, >> >> I'm using HarfBuzz with freetype to render Persian text. I can not find >> any example about this. >> This is my config. Is it right? I can display Persian result.but I think >> it's not right. >> >> m_language = "pes"; >> m_script = HB_SCRIPT_OLD_PERSIAN; >> m_direction = HB_DIRECTION_RTL; >> >> m_hbfont = hb_ft_font_create(s_ft_face, NULL); >> m_hbbuffer = hb_buffer_create(); >> hb_buffer_allocation_successful(m_hbbuffer); >> ... >> hb_buffer_reset(m_hbbuffer); >> hb_buffer_set_direction(m_hbbuffer, m_direction); >> hb_buffer_set_script(m_hbbuffer, m_script); >> hb_buffer_set_language(m_hbbuffer, >> hb_language_from_string(m_language.c_str(), m_language.size())); >> >> >> Thanks, >> Bian >> _______________________________________________ >> 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