Any app that support OpenType "rand" feature?

I just noticed the "rand" feature in the official Microsoft list of OpenType features and it made me wonder if anyone is aware of an application that actually supports it?

Comments

  • I believe PagePlus supports it.

    FontCreator also supports it in the OpenType Designer.
  • AbrahamLeeAbrahamLee Posts: 85
    Thanks @Erwin Denissen for the info. Looks like FontForge also supports it. That's so cool!
  • Khaled HosnyKhaled Hosny Posts: 168
    edited July 26
    Support in font editors does not require anything special as it is just a multiple alternates feature. Support in applications is a different story and AFAIK no mainstream application of OpenType layout engine supports it.
  • AbrahamLeeAbrahamLee Posts: 85
    Support in font editors does not require anything special as it is just a multiple alternates feature. Support in applications is a different story and AFAIK no mainstream application of OpenType layout engine supports it.
    Understood. Just because a feature is an option, doesn't mean any apps know what to do with it.
  • Kent LewKent Lew Posts: 616
    To support a {rand} feature in a page layout app, something more than just the font and text engine would be required. A routine needs to be included to generate random numbers, then use that result to make a selection from the one-from-many GSUB table registered to the feature.

    The generator would need to first parse out how many options there are to choose from for any given character and tailor the random number generation to that limit on a character-by-character basis.

    It can’t be done from within the font itself. So, it falls to the developers to implement all this randomness and hook it up to the text engine. Plenty of extraneous processing that I imagine layout app developers probably won’t ever be inclined to bother with.
  • Affinity Designer supports rand.
  • Mark SimonsonMark Simonson Posts: 814
    edited July 26
    I thought {rand} was not supported at all, deprecated even. Why else would there be so many examples over the years simulating the effect of such a feature, but using {calt}?
  • Khaled HosnyKhaled Hosny Posts: 168
    The biggest issue preventing support for “rand” feature is, well, the randomness. Many implementations and applications need predictable results; if you give it the same text, font, and set of features to switch, it should always give the same output so it can be cached and reused as needed. You don’t want your page to re-flow every time you scroll it! So the randomness needs to be pseudo random with reproducible results. Very few people are interested in figuring all this out.

    I’m pretty sure that is another example of features specified before there were any implementations or clear understanding of what OpenType was going to end up like, as @John Hudson said multiple times.
  • Not deprecated. 

    There is latitude in the spec for stepping through the alternates or seeding the alternates assigning numbers to them and what not.

    I believe Serif did the easiest with stepping through them.

    But once the glyph swap has occurred, there isn't reflow issues. In that sense it is no different than any gsub once it occurs. 
  • John HudsonJohn Hudson Posts: 1,144
    But once the glyph swap has occurred, there isn't reflow issues. In that sense it is no different than any gsub once it occurs. 
    It's a little different in that if you were to turn the feature off and back on again, the randomisation routine would presumably run again, which means that you would have no guarantee of getting back the same substitutions that you had previously. Depending how implemented, even Undo results might be unpredictable.

  • Mark SimonsonMark Simonson Posts: 814
    Although I think they have done a great job with implementing OT features in Affinity Designer in the most recent version, it was pretty rough at first. For quite a while, they had implemented {calt} completely wrong (flipping back and forth between normal and alternate forms, seemingly ignoring the feature code). So I'm curious what they've done with {rand}. I guess I could make a test font and try it out (I do have Designer).
  • AbrahamLeeAbrahamLee Posts: 85
    @Kent Lew: Nearly all (or all) programming languages have routines for random number generation, which means that it should be fairly painless because all you need to do is use them, not create them. I can't imagine that would be a limitation for not having it. On the other hand, not having enough fonts out there that use the feature to want to support it, that's a reason I can understand.

    @Mike Wenzloff: Thanks for the pointer to Affinity Designer. I'll look into that. Do many folks here use it? I've considered getting it myself. It looks really nice, but it would have to be so much easier for me to use than Inkscape to get me to swap. But I digress.

    @Mark Simonson: Unless you want very controlled, predictable substitutions via {calt} (which some people abuse to get the affect of randomness), using {rand} would be SOOO much easier to implement. From the app designer's perspective, the text engine would simply need a routine to goes something like this: When you encounter the glyph, pull a random integer i between 0 and N (where N is the number of alternate glyphs available) and then grab the glyph at the th index. It's quite straightforward. I've done this very thing myself.

    @Khaled Hosny: Although I can completely understand what you're saying about re-flow, I think the people who would actually be using it wouldn't care if it did happen because they would be more interested in the randomness. At least I would.
  • Khaled HosnyKhaled Hosny Posts: 168
    edited July 26
    @AbrahamLee the people might not care, but application developers do. For example many applications cache the shaping results per word, so they expect that a word appearing anywhere in the document will be shapped the same (when using same font and feature), so “random” glyph substitution have to be deterministic or this promise is broken which either means degraded performance (by disabling caching entirely when “rand” is used or broken layout.

  • Support in font editors does not require anything special as it is just a multiple alternates feature. Support in applications is a different story and AFAIK no mainstream application of OpenType layout engine supports it.
    The preview feature in our font editor mimics how word processing applications can handle it. It is pretty easy with a fixed random seed, so it remains "predictable random" and no reflow issues. For us it was basically these lines of code:

      // At first
      RandSeed := 123;

      // Then while processing lookups:
      if Feature = Randomize then
        AlternateIndex := Random(AlternatatesCount);




  • Thanks for the correction, John. 

    Other than testing, I guess I hadn't ever turned the feature on/off and paid any close attention.

    So this is what I get in AD. Feature on, feature off, feature back on.


    The font was one that Erwin prepared using calt that I repurposed to using rand.
  • Nick ShinnNick Shinn Posts: 1,139
    edited July 26
    Randomness isn’t much use unless you randomize glyph generation, as per Beowolf.
    With a limited number of alternates, randomization will give you the same alternate side-by-side, from time to time, which doesn’t look “random”.
    What’s really sought is non-repetition of glyphs, which is the purpose of pseudo-randomization.

    I’ve written a code for pseudo-randomizing four sets of characters, that non-repeats for a sequence of up to nine characters in a text stream—but it doesn’t address the problem of each line starting out with the same glyph of a character.  
  • I think the rand feature is OK. Seemingly poor application support. I think that, for myself, I would only really have the feature on in a drawing application such as AD if doing certain types of design work. Even then I don't know if I would use that feature or simply choose from whatever alternates were present. CorelDraw has what I consider the best UI for such work with OT features (SS, alts, etc.). Makes it dead easy to swap things around while designing.

    What I cannot see it used for on my end is an actual layout application with longer runs of text. At least for what I layout that feature makes little sense. Especially seeing how layout application support for features I do use is so spotty—or simply not supported.
  • AbrahamLee said:...

    @Mike Wenzloff: Thanks for the pointer to Affinity Designer. I'll look into that. Do many folks here use it? I've considered getting it myself. It looks really nice, but it would have to be so much easier for me to use than Inkscape to get me to swap. But I digress.
    ...
    I certainly keep an eye on it. I try to like it but I believe there are work-flow issues and just plain oddness in certain features. I don't illustrate and that is one type of work I think they target. But there are too many features missing or implemented poorly for me to use it daily for actual work. One for instance is seeing the bleed amount without a work-around. Kinda dumb. But there are other issues for my work.

    That said, it probably does have one of the fullest OT feature implementations that just work. More to be done in this regards, but Dave H of Serif has done a good job and is very receptive to correction and or suggested additions. I think that if nothing else it is a good application for the testing of OT Features, which is what I mostly use it for.

    I wrote a hist feature that replies on chaining contexts for handling the medial s (long s) for some journals I laid out. For ID, because it doesn't support hist directly, I had to test well in AD, then stuffed that work into an SS for ID and QXP (but QXP has issues with matching too early with chaining contexts and then moving on). Using AD to test features is for me a prime application.

    Mike
  • John HudsonJohn Hudson Posts: 1,144
    Mike,
    So this is what I get in AD. Feature on, feature off, feature back on.
    To clarify: reversibility is going to depend on how the rand feature is implemented in software. If cycling through the variants and always starting the cycle in the same way, or using pre-seeded pseudo-randomisation, then you will get reversible results, i.e. always the same 'randomisation' of substitutions for the same input text. But if the implementation were to actually generate random numbers to select variants, then you would expect different results every time the feature was applied.
Sign In or Register to comment.