<div dir="ltr">Thanks guys, I've tried to turn off the rand feature (which is on by default in pango it seems) and it really did start working differently.<div>The example image that I've sent earlier now works identically!</div><div>My actual text doesn't seem to work 100% correctly yet, but there's some (per glyph) open type features there (ss01 etc) so I have to triple check it that it gets through correctly.</div><div><br></div><div>Thanks for your help!</div><div><br></div><div>Best regards,</div><div>Ales</div><div><br><div><br></div><div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 14, 2020 at 6:21 PM Jonathan Kew <<a href="mailto:jfkthame@gmail.com">jfkthame@gmail.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">On 14/02/2020 15:50, Aleš Mlakar wrote:<br>
> Hey Simon,<br>
> I think it doesn't use rand feature, because it never gets to that part <br>
> of the code or at least not to the random_number() function which is the <br>
> only rng function I could find in Harfbuzz :D.<br>
<br>
HarfBuzz will only use this if the font has a 'rand' feature with an <br>
AlternateSubstFormat1 subtable, to pick from among the available <br>
alternates for a glyph. You could try dumping the font's GSUB table <br>
(e.g. with fonttools) to see what's actually in there.<br>
<br>
It's entirely possible for a font's 'rand' feature to be implemented in <br>
some other way, such as a collection of contextual substitutions; then <br>
no real (pseudo-)randomness is involved.<br>
<br>
JK<br>
<br>
> I did some debugging and it goes into some coverage functions inside <br>
> hb-ot-layout-common.hh from hb-ot-layout-gsub-table.hh, it's too deep <br>
> for me to be able to understand it though.<br>
> So, as far as I can understand all of this either one of Indesign or <br>
> Harfbuzz is doing it wrong.<br>
> <br>
> Best,<br>
> Ales<br>
> <br>
> <br>
> On Fri, Feb 14, 2020 at 1:04 PM Simon Cozens <<a href="mailto:simon@simon-cozens.org" target="_blank">simon@simon-cozens.org</a> <br>
> <mailto:<a href="mailto:simon@simon-cozens.org" target="_blank">simon@simon-cozens.org</a>>> wrote:<br>
> <br>
> On 12/02/2020 19:28, Aleš Mlakar wrote:<br>
> > I did a quick debug through that part of HarfBuzz and it seems it's<br>
> > doing lookups and never gets to the random code.<br>
> <br>
> OpenType randomization on the whole isn't *really* random. Most fonts<br>
> implement pseudo-random selection of alternate glyphs by going<br>
> through a<br>
> series of lookup rules (see e.g. the bottom of<br>
> <a href="http://opentypecookbook.com/common-techniques.html" rel="noreferrer" target="_blank">http://opentypecookbook.com/common-techniques.html</a> ). As you can see,<br>
> none of the techniques there actually use any source of randomness;<br>
> they<br>
> just apply deterministic rules to the input stream.<br>
> <br>
> There *is* a "rand" feature in the OpenType standard, which asks the<br>
> shaper for non-deterministic random selection, but for this to work,<br>
> two<br>
> things need to be in place: the shaper needs to support it, and the<br>
> font<br>
> needs to define it. Harfbuzz as a shaper supports it, but no others do.<br>
> Because of this, few fonts define it.<br>
> <br>
> Even then, Harfbuzz's random number implementation is only pseudorandom<br>
> with a fixed random seed, so you get the same results each time anyway.<br>
> <br>
> I don't know whether Daft Brush uses the "rand" feature. It probably<br>
> doesn't. Although if you are seeing differences between harfbuzz and<br>
> InDesign, it might be that it does.<br>
> <br>
> In short it is down to the font.<br>
> <br>
> S<br>
> <br>
> <br>
> <br>
> -- <br>
> Aleš Mlakar,<br>
> Programmer/Consultant<br>
> *am.bits*<br>
> <br>
> _______________________________________________<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>
> <br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Aleš Mlakar, </div><div>Programmer/Consultant</div><div><b>am.bits</b></div></div></div></div></div>