<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><br><div>> Hi Louis,<br>> <br>> In my font engine I start by doing font selection depending on the presence of glyphs and encoding before call harfbuz to shape the string. The process is tedious but simple: break the text into text runs by trying to find changes in the properties of the text stream:<br>> 1. Split text into paragraphs (LayoutText)<br>> 2. Split text into fonts<br>> 3. Split paragraphs into ranges (LayoutParagraph)<br>> 4. Split ranges into possible fonts (I try to keep the number of fonts to a minimum)<br>> 5. Split ranges into lines / words if needed<br>> <br>> Then I shape each run with harfbuz. Each run can have a different font.<br>> I’m not saying it’s the perfect solution to the problem but it worked fine for me and for now I don’t think I have encountered cases where harfbuz was missing a glyph in the end. I think that having a "missing glyph” callback would not work for me as it would already be too late and that I would have to restart the text layout and font selection from the beginning.<br><br>Thanks Sebastian. <br><br>I assume when you say "depending on the presence of glyphs" you mean that, at some point, you are making an individual call for each code point of the input text in order to check whether the proposed font has that code point or not, correct?<br><br>I can definitely understand the idea that a "missing glyph callback" would come too late for some layout engines, however I still think it's useful in some cases to know from the output of Harfbuzz whether there were any missing glyphs, especially if speed is important, the missing glyph case is rare, and one wants to avoid the extra, expensive per-code-point cmap lookup in the common case of no missing glyphs.<br><br>So I am hoping some of the Harfbuzz folks here can address the original question about whether glyph index 0 always means "missing", and whether glyph index 0 is the sole and only way that Harfbuzz indicates "missing." Or if there is some other way to interpret the output of hb_shape() to look for missing glyphs.<br><br>Thanks.<br><br></div> </div></body>
</html>