<p dir="ltr">On Jun 25, 2016 12:33 PM, <<a href="mailto:kelvinsthirteen@gmail.com">kelvinsthirteen@gmail.com</a>> wrote:<br>
><br>
><br>
><br>
> > On Jun 25, 2016, at 1:39 PM, Khaled Hosny <<a href="mailto:khaledhosny@eglug.org">khaledhosny@eglug.org</a>> wrote:<br>
> ><br>
> > On Sat, Jun 25, 2016 at 01:06:27PM -0400, Kelvin Ma wrote:<br>
> >>>>>> Don’t you<br>
> >>>>> need<br>
> >>>>>> context to be ignored if the boundaries of the text you want to shape<br>
> >>>>> fall<br>
> >>>>>> inside a cluster? Like in the string 'af[fluency s]tate' where only<br>
> >>> the<br>
> >>>>>> 'fluency s' is supposed to be shaped?<br>
> >>>>><br>
> >>>>> Depends on why you are shaping “fluency s” alone, if it is because of,<br>
> >>>>> say, font change, then you need HarfBuzz to know the context otherwise<br>
> >>>>> you get broken Arabic shaping.<br>
> >>>><br>
> >>>> Well font change would produce a separate run that wouldn’t know about<br>
> >>> the<br>
> >>>> other runs so context can only be within a same-direction, same-font run.<br>
> >>><br>
> >>> This is wrong, font change shouldn’t break Arabic shaping, so you have<br>
> >>> to pass the context even in this case.<br>
> >>><br>
> >><br>
> >> If the text consists of text strings separated by formating objects, each<br>
> >> text string doesn’t know about what’s around it. Because that’s at a much<br>
> >> higher level in the code and harfbuzz can only handle a single font in a<br>
> >> single run at a time. To artificially jam in the neighboring runs for each<br>
> >> shaping attempt would involve an inordinate amount of string concatenation<br>
> >> and searching on the fly.<br>
> ><br>
> > One can always fix his code to not do wrong assumptions. When doing text<br>
> > layout you always need the full paragraph, and you should have it around<br>
> > after itemisation. Itemisation does not have to be done by splitting<br>
> > text, you can just store run start indices and lengths.<br>
><br>
> No, meaning font styling is created by inline styling objects. They’re like inline images except they have zero width. So a font change is really stored as a special character in between the two sections. This character is not understood by harfbuzz, which is why it does not make sense to pass anything containing it into the shaper.</p>
<p dir="ltr">That's your design's limitation.  You still can fix it by using custom Unicode funcs with HarfBuzz, that returns a "default-ignorable" Unicode property for your placeholder codepoints.  I just checked and it wouldn't work right now; I'll fix that.  What placeholder character do you use?  Can you change that?<br>
><br>
> ><br>
> > Regards,<br>
> > Khaled<br>
> _______________________________________________<br>
> HarfBuzz mailing list<br>
><a href="mailto:HarfBuzz@lists.freedesktop.org"> HarfBuzz@lists.freedesktop.org</a><br>
><a href="https://lists.freedesktop.org/mailman/listinfo/harfbuzz"> https://lists.freedesktop.org/mailman/listinfo/harfbuzz</a><br>
</p>