I need to create a font of nut fractions with our own alt text. So, 1/2 would be read as “one half” by a screen reader, rather than “one slash two”. Or 1/4 as “one fourth”. How do I set this up in Glyphs?
Thank you!
I need to create a font of nut fractions with our own alt text. So, 1/2 would be read as “one half” by a screen reader, rather than “one slash two”. Or 1/4 as “one fourth”. How do I set this up in Glyphs?
Thank you!
oneoverfour
I’m not sure if screen readers apply opentype features. I suspect that they only look at the underlying characters. In that case, you can’t do anything from within the font.
There are some fractions encoded in Unicode. If those are used in the text, the screen reader might pick it up.
Google AI recommended this feature would give me the nut fractions I want. Apparently something is wrong. What do these warnings mean and how do I think them. Thank you!
Here is what I used to use with FontLab. It may not parse in Glyphs:
fracbar+onesuperior+|fourinferior=onequarter.nut fracbar+onesuperior+|twoinferior=onehalf.nut fracbar+threesuperior+|fourinferior=threequarters.nut fracbar+onesuperior+|threeinferior=onethird.nut fracbar+twosuperior+|threeinferior=twothirds.nut fracbar+onesuperior+|eightinferior=oneeighth.nut fracbar+threesuperior+|eightinferior=threeeighths.nut fracbar+fivesuperior+|eightinferior=fiveeighths.nut fracbar+sevensuperior+|eightinferior=seveneighths.nut fracbar+onesuperior+|fiveinferior=onefifth.nut fracbar+twosuperior+|fiveinferior=twofifths.nut fracbar+threesuperior+|fiveinferior=threefifths.nut fracbar+foursuperior+|fiveinferior=fourfifths.nut fracbar+zerosuperior+|zeroinferior=zeronut.nut
This one is better:
fraction.afrc+onesuperior+fourinferior=oneoverfour fraction.afrc+onesuperior+twoinferior=oneovertwo fraction.afrc+threesuperior+fourinferior=threeoverfour fraction.afrc+onesuperior+threeinferior=oneoverthree fraction.afrc+twosuperior+threeinferior=twooverthree fraction.afrc+onesuperior+fiveinferior=oneoverfive fraction.afrc+twosuperior+fiveinferior=twooverfive fraction.afrc+threesuperior+fiveinferior=threeoverfive fraction.afrc+foursuperior+fiveinferior=fouroverfive fraction.afrc+onesuperior+eightinferior=oneovereight fraction.afrc+threesuperior+eightinferior=threeovereight fraction.afrc+fivesuperior+eightinferior=fiveovereight fraction.afrc+sevensuperior+eightinferior=sevenovereight
Does anyone has a screenreader to try this? If they apply opentype or not?
Setting up nut fractions in Glyphs with prebuilt or live composed OpenType might not change whatever the screenreader sees.
“OpenType might not change whatever the screenreader sees.”
This is what we’re trying to determine. Can someone please explain what these errors mean? They’re too obscure for me to understand.
<< Feature reference allowed in “aalt” feature only>>
<< Unexpected “afrc”; expected statement.>>
In the feature editor, you only add the substitutions or lookups, not the feature afrc.
Screen readers only access the underlying text, any font-level substitution is invisible to them.
If you want the text to read “one half” then you need to input that text, and maybe use font level substitutions to make it look like a fraction (for people who see the text), not the other way around.
You can use tools like JAWS Inspect: Visualize Screen Reader Output for Accessibility Testing to inspect what screen readers see.
Thank you for the reply.
<<If you want the text to read “one half” then you need to input that text,>>
Can you clarify what you mean by “input that text”? Where to I put that text? I’m doing complicated fractions like 12/5 that need to be read. In fact, editors want it to be read “twelve over five” instead of “twelve slash five”.
He meant that you literally put “ twelve over five” in the text.
What text?
The text the reader should read.
Yes, I know what the text reader should read. Specifically, where do I put that “twelve over five” in the Glyphs file? Somewhere in Features? Exports?
There is nothing to do in Glyphs or in the font. You need to edit the text that is shown to the end user, the text that is fead to the screen reader. There you need to replace “12/7” with “ twelve over seven”.
I see. Well, since it’s a math book for children to teach them fractions, replacing the numbers with words won’t solve the problem. The book is full of number fractions. The book must show 12/5, and the screen reader see that and say “twelve over five.” If Glyphs can’t make a font that will read aloud a fraction, we’ll have to explore other options.
As Khaled said, the font can’t do anything about this. So you might need to find an annotation system (is something like this exists).