OpenType Features: Order of Precedence
Re: OpenType Features: Order of Precedence
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.
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.
-
- Top Typographer
- Posts: 9877
- Joined: Tue Oct 29, 2002 5:28 am
- Location: Seven Kings, London UK
- Contact:
Re: OpenType Features: Order of Precedence
You're welcome to try with my Mandala font.MikeW wrote:Cannot share the font project.
If needed, I can create a sample in some OFL font.
Fractions and Ordinals both use a chaining context.
-
- Top Typographer
- Posts: 9877
- Joined: Tue Oct 29, 2002 5:28 am
- Location: Seven Kings, London UK
- Contact:
Re: OpenType Features: Order of Precedence
I found this thread on TypeDrawers, which refers to Tal Leming's Fraction Fever code.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 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.
-
- Moderator
- Posts: 11158
- Joined: Fri Oct 04, 2002 12:41 am
- Location: Bilthoven, The Netherlands
- Contact:
Re: OpenType Features: Order of Precedence
It looks promising, but (123/345) doesn't seem to work correctly if ordn is active as well.
-
- Top Typographer
- Posts: 9877
- Joined: Tue Oct 29, 2002 5:28 am
- Location: Seven Kings, London UK
- Contact:
Re: OpenType Features: Order of Precedence
Yes. Still some issues to resolve. I updated it again, but 123/456 is currently still broken.Erwin Denissen wrote:It looks promising, but (123/345) doesn't seem to work correctly if ordn is active as well.
This is the latest version.
-
- Top Typographer
- Posts: 977
- Joined: Tue Jun 16, 2015 8:12 pm
- Location: Sheffield, South Yorkshire
- Contact:
Re: OpenType Features: Order of Precedence
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.
-
- Top Typographer
- Posts: 9877
- Joined: Tue Oct 29, 2002 5:28 am
- Location: Seven Kings, London UK
- Contact:
Re: OpenType Features: Order of Precedence
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.
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.
-
- Top Typographer
- Posts: 977
- Joined: Tue Jun 16, 2015 8:12 pm
- Location: Sheffield, South Yorkshire
- Contact:
Re: OpenType Features: Order of Precedence
It would indeed be good if they could play nicely together.
-
- Moderator
- Posts: 11158
- Joined: Fri Oct 04, 2002 12:41 am
- Location: Bilthoven, The Netherlands
- Contact:
Re: OpenType Features: Order of Precedence
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
1st = 2x + 1/3y - (34/456)z and 2nd = 0
-
- Top Typographer
- Posts: 9877
- Joined: Tue Oct 29, 2002 5:28 am
- Location: Seven Kings, London UK
- Contact:
Re: OpenType Features: Order of Precedence
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.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
Re: OpenType Features: Order of Precedence
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."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
-
- Moderator
- Posts: 11158
- Joined: Fri Oct 04, 2002 12:41 am
- Location: Bilthoven, The Netherlands
- Contact:
Re: OpenType Features: Order of Precedence
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 :
So I think ultimately OpenType features should make it look like:
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.
1st = 2x + 1/3y - (34/456)z and 2nd = 0 or 4x^3
It looks like :
So I think ultimately OpenType features should make it look like:
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.
-
- Top Typographer
- Posts: 9877
- Joined: Tue Oct 29, 2002 5:28 am
- Location: Seven Kings, London UK
- Contact:
Re: OpenType Features: Order of Precedence
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.
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.
-
- Moderator
- Posts: 11158
- Joined: Fri Oct 04, 2002 12:41 am
- Location: Bilthoven, The Netherlands
- Contact:
Re: OpenType Features: Order of Precedence
Fair enough, but I'm still wondering what to do with this: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.
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.
-
- Top Typographer
- Posts: 9877
- Joined: Tue Oct 29, 2002 5:28 am
- Location: Seven Kings, London UK
- Contact:
Re: OpenType Features: Order of Precedence
I think, if only fractions are enabled it should do this:
If both fractions and ordinals are enabled it should probably do this:
Or perhaps this, but I think that not all of a-z should be included in Ordinals, though that's a moot point:
I am still trying to understand what Mike means by "a run of text." Is it this:
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.
If both fractions and ordinals are enabled it should probably do this:
Or perhaps this, but I think that not all of a-z should be included in Ordinals, though that's a moot point:
I am still trying to understand what Mike means by "a run of text." Is it this:
Or, just 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 is it the entire Wikipedia article?10th May 2017
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.