<div dir="ltr"><div class="gmail_default" style="font-size:small">Khaled wrote:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_extra"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class=""><br>
</span>Each Unicode character has a script property, so you don’t need to hard<br>
code it for the text. The only complication is inherited or common<br>
characters, but there is a simple heuristic to handle them, see for<br>
example:<br>
<a href="https://github.com/HOST-Oman/libraqm/blob/master/raqm.c#L289" rel="noreferrer" target="_blank">https://github.com/HOST-Oman/libraqm/blob/master/raqm.c#L289</a><br>
<br>
But if you are sure your text is always single script and language (I<br>
see the Arabic has English words, so doesn’t seem to be the case), then<br>
you can hard code the script values.<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small;display:inline">Does this mean that passing UNKNOWN and letting HB figure it out is the right thing then? </div></div><div><div class="gmail_default" style="font-size:small;display:inline"><br></div></div><div><div class="gmail_default" style="font-size:small;display:inline">Empirically, I tried setting the script and language to totally incorrect things a few times, and I have not seen obviously incorrect output, so I don't know how to isolate test cases for these things; and even if I were to implement a complicated strategy for picking the language and script, I have no idea how I am supposed to know when my code is actually working.</div> </div><div><br></div><div><div class="gmail_default" style="font-size:small">For example: Is there some sample text in mixed Arabic w/ bidi English names, etc, that will come out wrong if I just set the language to "arb" and script to arabic? That is what I am doing in those screenshots, and whereas "they look fine to me" we all know that is no guarantee things aren't horrible in some corner case.</div><br></div><div><br></div><div><br></div><div><div class="gmail_default" style="font-size:small">Simon wrote:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">> <span style="font-size:12.8px">The confusion comes from the fact that Jonathan seems to be writing a</span></div><span style="font-size:12.8px"><div class="gmail_default" style="font-size:small;display:inline">> </div>glyph rendering library<div class="gmail_default" style="font-size:small;display:inline"> .</div>.<div class="gmail_default" style="font-size:small;display:inline">.. </div></span><span style="font-size:12.8px">The *problem* comes from the fact that he's mixing <br><div class="gmail_default" style="font-size:small;display:inline">> </div>layers and using<div class="gmail_default" style="font-size:small;display:inline"> </div></span><span style="font-size:12.8px">Harfbuzz inside his glyph rendering library, which is <br><div class="gmail_default" style="font-size:small;display:inline">> </div>totally not where<div class="gmail_default" style="font-size:small;display:inline"> </div></span><span style="font-size:12.8px">it should be used.</span><span style="font-size:12.8px"><div class="gmail_default" style="font-size:small;display:inline"></div></span></div><div><br></div><div><div class="gmail_default" style="font-size:small">That is not at all what is happening. This is a 300kLOC program that does really quite a lot of things. One tiny fraction of its functionality is rendering glyphs; another tiny fraction of its functionality is the higher-level interface where you say "Draw this text at this location with this shader etc" and it talks to HB and FT. When one is programming at all these layers, one chooses the abstractions that make the most sense for that particular domain.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The confusion is mostly just a cultural issue as I was guessing. Now that it's clarified things make more sense.</div><br></div></div></div></div>