<div dir="ltr"><div dir="ltr"><div>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 <a href="https://en.wikipedia.org/wiki/OpenType#Serbian_Cyrillic_solution" target="_blank">Serbian Cyrillic</a>, 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.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Feb 9, 2020 at 7:11 PM bianxg <<a href="mailto:765033267@qq.com" target="_blank">765033267@qq.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>It works well when use 'hb_buffer_guess_segment_properties'. Thanks.</div><div><br></div><div>But, I don't understand this sentence. Can you explain more?</div><div><div>"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)."</div><div><br></div><div style="font-size:12px;font-family:Arial Narrow;padding:2px 0px">------------------ 原始邮件 ------------------</div><div style="font-size:12px;background:rgb(239,239,239) none repeat scroll 0% 0%;padding:8px"><div><b>发件人:</b> "Ebrahim Byagowi"<<a href="mailto:ebraminio@gmail.com" target="_blank">ebraminio@gmail.com</a>>;</div><div><b>发送时间:</b> 2020年2月9日(星期天) 晚上10:53</div><div><b>收件人:</b> "bianxg"<<a href="mailto:765033267@qq.com" target="_blank">765033267@qq.com</a>>;</div><div><b>抄送:</b> "harfbuzz"<<a href="mailto:harfbuzz@lists.freedesktop.org" target="_blank">harfbuzz@lists.freedesktop.org</a>>;</div><div><b>主题:</b> Re: [HarfBuzz] Render Persian probelm</div></div><div><br></div><div dir="ltr"><div>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.</div><div><br></div><div>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).</div><div><br></div><div>Cheers<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Feb 9, 2020 at 4:43 PM bianxg <<a href="mailto:765033267@qq.com" target="_blank">765033267@qq.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Hi,</div><div><br></div><div>I'm using HarfBuzz with freetype to render Persian text. I can not find any example about this. </div><div>This is my config. Is it right? I can display Persian result.but I think it's not right.</div><div><br></div><div>m_language = "pes";</div><div><div>m_script = HB_SCRIPT_OLD_PERSIAN;</div><div>m_direction = HB_DIRECTION_RTL;</div></div><div><br></div><div>m_hbfont = hb_ft_font_create(s_ft_face, NULL);</div><div><div>m_hbbuffer = hb_buffer_create();</div><div>hb_buffer_allocation_successful(m_hbbuffer);</div></div><div>...</div><div><div>hb_buffer_reset(m_hbbuffer);</div><div>hb_buffer_set_direction(m_hbbuffer, m_direction);</div><div>hb_buffer_set_script(m_hbbuffer, m_script);</div><div>hb_buffer_set_language(m_hbbuffer, hb_language_from_string(m_language.c_str(), m_language.size()));</div></div><div><br></div><div><br></div><div>Thanks,</div><div>Bian</div>_______________________________________________<br>
HarfBuzz mailing list<br>
<a href="mailto:HarfBuzz@lists.freedesktop.org" target="_blank">HarfBuzz@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/harfbuzz" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/harfbuzz</a><br>
</blockquote></div></div></blockquote></div></div>