<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 0 2px 0;">------------------ 原始邮件 ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>发件人:</b> "Ebrahim Byagowi"<ebraminio@gmail.com>;</div><div><b>发送时间:</b> 2020年2月9日(星期天) 晚上10:53</div><div><b>收件人:</b> "bianxg"<765033267@qq.com>;<wbr></div><div><b>抄送:</b> "harfbuzz"<harfbuzz@lists.freedesktop.org>;<wbr></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">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>