Page 2 of 3

Re: OpenType Features: Order of Precedence

Posted: Sun May 07, 2017 5:13 pm
by MikeW
Oops. And the frac feature is...complicated.

There are 13 chaining contexts. I believe I based it upon Tal Leming's Fraction Fever code. So while not an infinite arbitrary fraction feature, I doubt people will be using more than it can handle.

Re: OpenType Features: Order of Precedence

Posted: Sun May 07, 2017 5:16 pm
by Bhikkhu Pesala
MikeW wrote:Cannot share the font project.

If needed, I can create a sample in some OFL font.
You're welcome to try with my Mandala font.

Fractions and Ordinals both use a chaining context.
Chaining Contexts.png
Chaining Contexts.png (5.58 KiB) Viewed 13201 times

Re: OpenType Features: Order of Precedence

Posted: Sun May 28, 2017 7:09 am
by Bhikkhu Pesala
MikeW wrote:Oops. And the frac feature is...complicated.

There are 13 chaining contexts. I believe I based it upon Tal Leming's Fraction Fever code. So while not an infinite arbitrary fraction feature, I doubt people will be using more than it can handle.
I found this thread on TypeDrawers, which refers to Tal Leming's Fraction Fever code.

I suspect that fractions with more than 5 or so numerators or denominators are unlikely.

I can imagine that someone might need fractions like (123+75)/(123-56), which is already eight numerators/denominators, but ten would surely be adequate for most users. However, my much simpler code works without any limits. The only problem is that it breaks the Ordinals feature.

I think I have found a much simpler method by adding a lookup to Ordinals for NumeratorsToNumbers. Take a look at my FontCreator 11.0 project file and see if it breaks something else.
Ordinals Feature.png
Ordinals Feature.png (60.93 KiB) Viewed 13137 times

Re: OpenType Features: Order of Precedence

Posted: Sun May 28, 2017 10:17 am
by Erwin Denissen
It looks promising, but (123/345) doesn't seem to work correctly if ordn is active as well.

Re: OpenType Features: Order of Precedence

Posted: Sun May 28, 2017 10:21 am
by Bhikkhu Pesala
Erwin Denissen wrote:It looks promising, but (123/345) doesn't seem to work correctly if ordn is active as well.
Yes. Still some issues to resolve. I updated it again, but 123/456 is currently still broken.

This is the latest version.

Re: OpenType Features: Order of Precedence

Posted: Sun May 28, 2017 11:35 am
by PJMiller
Ordinals and Fractions don't play nicely together but one must remember that for any given section of text the user of the font is only ever likely to enable ordinals or fractions, they are probably not going to enable both at once.

Re: OpenType Features: Order of Precedence

Posted: Sun May 28, 2017 11:45 am
by Bhikkhu Pesala
If I use Ordinals, I will enable it as part of the Body Text paragraph style. This is the only practical method. Highlighting every occurrence of st, nd, rd, or th to enable the Ordinals feature makes it pointless adding the feature in the first place. One may as well just use Superscripts.

If the Ordinals feature is enabled, therefore, whenever one wants to use the fractions feature, it would be nice if one did not have to disable the Ordinals feature first.

It is not a big problem, which is why I have not bothered to seek a solution before, but it would be better to avoid the conflict. It clearly can be done, but the solution of 13 contextual substitutions is too complex for novice users to figure out or do without help. I would love to find a simpler solution.

Re: OpenType Features: Order of Precedence

Posted: Sun May 28, 2017 1:04 pm
by PJMiller
It would indeed be good if they could play nicely together.

Re: OpenType Features: Order of Precedence

Posted: Sun May 28, 2017 8:07 pm
by Erwin Denissen
I'm sure we can get both to work for the basics, but what about more complex formulas, or even just something like:

1st = 2x + 1/3y - (34/456)z and 2nd = 0

Re: OpenType Features: Order of Precedence

Posted: Sun May 28, 2017 8:28 pm
by Bhikkhu Pesala
Erwin Denissen wrote:I'm sure we can get both to work for the basics, but what about more complex formulas, or even just something like:

1st = 2x + 1/3y - (34/456)z and 2nd = 0
If one writes (2x+1)/3y-(34+456) it can work, but I don't think the slash can be used twice, even if one adds a subscripted slash to the font. The space could probably be dealt with, but it might need a smaller value for superscripts and subscripts, so it's best to expect users to type formulae without extra spaces.

Re: OpenType Features: Order of Precedence

Posted: Sun May 28, 2017 11:01 pm
by MikeW
Erwin Denissen wrote:I'm sure we can get both to work for the basics, but what about more complex formulas, or even just something like:

1st = 2x + 1/3y - (34/456)z and 2nd = 0
capture-001132.png
But then, I don't know how you would have wanted it formatted...which is why for the (very) few journals I have done have at least drawings, or more likely have used MathType in Word, which I also used for generating the EPS files for ID and QXP--I just need to (1) export them ad hoc from MT in Word, and (2) make sure when laying it out that the EPS files really were like "the picture."

Re: OpenType Features: Order of Precedence

Posted: Mon May 29, 2017 9:24 am
by Erwin Denissen
If you write this with Equation Editor in Microsoft Word

1st = 2x + 1/3y - (34/456)z and 2nd = 0 or 4x^3

It looks like :
equationeditor.png
equationeditor.png (1.53 KiB) Viewed 13087 times
So I think ultimately OpenType features should make it look like:
equationopentype.png
equationopentype.png (9.19 KiB) Viewed 13087 times
On the other hand, the Fractions feature is only meant for fractions, not for exponents, so the last part (4x^3) is out of scope.

Re: OpenType Features: Order of Precedence

Posted: Mon May 29, 2017 10:50 am
by Bhikkhu Pesala
I think we're getting way too ambitious here.

I don't think we need 13 chaining contexts, or an equation editor.

A fraction feature that can cope with 123/456 or (1+2)/(abc-xyz) without conflicting with Ordinals would already be quite impressive.

Re: OpenType Features: Order of Precedence

Posted: Mon May 29, 2017 10:57 am
by Erwin Denissen
Bhikkhu Pesala wrote:I think we're getting way too ambitious here.

I don't think we need 13 chaining contexts, or an equation editor.

A fraction feature that can cope with 123/456 or (1+2)/(abc-xyz) without conflicting with Ordinals would already be quite impressive.
Fair enough, but I'm still wondering what to do with this:
1st = 2x + 1/3y

Typically OT features such as fractions and ordinals are manually applied to the run of text or automated process to do so.
It looks like MikeW is right, or at least that statement would make it a lot easier for us.

Re: OpenType Features: Order of Precedence

Posted: Mon May 29, 2017 11:06 am
by Bhikkhu Pesala
I think, if only fractions are enabled it should do this:
Frac.png
Frac.png (10.2 KiB) Viewed 13075 times
If both fractions and ordinals are enabled it should probably do this:
Frac + Ordn.png
Frac + Ordn.png (10.02 KiB) Viewed 13075 times
Or perhaps this, but I think that not all of a-z should be included in Ordinals, though that's a moot point:
Frac + Ordn 2.png
Frac + Ordn 2.png (9.67 KiB) Viewed 13075 times
I am still trying to understand what Mike means by "a run of text." Is it this:
Wikipedia wrote:FC Version 11.0 was released on 10th May 2017. It added support for cubic Bézier curves, Vertical font metrics, High Resolution monitors with new icons in a range of sizes from 24-48 pixels, and a 64-bit version.
Or, just this:
10th May 2017
Or is it the entire Wikipedia article?

I don't think it should be making it easier for the Font Designer. The Font Designer's job is to make it easier for the users.