How to add more vulgar fractions to glyphs?

Tim Monroe's picture

Is there a way to convert a fraction into a single character vulgar fraction? We use Minion Pro and Myriad Pro, but all I can find is nine common vulgar fractions. We need more. When we export xml from Indesign CS3, the vulgar fractions look good on our website, without needing anything done to them using CSS. Is there a way to build or buy a more complete set that included 13/16, 15/16, etc.
Thanks

seventy7's picture

You'll probably get a better answer from another Typophile, but here's a start. Without commissioning the foundry to customize your fonts with a full spectrum of fractions, you may have to build them manually. Would this method suffice?:

http://www.fonts.com/AboutFonts/Articles/GlyphsCharacters/MakingFraction...

Tim Monroe's picture

That method worked great for us in the printed version of the catalog. But now we're exporting text from the print version to be used in an online catalog. If we build the fraction from the open type menu, it reverts back to numeral slash numeral after we export it from Indesign as xml. Then the website developers apply some CSS styling to make it look like the original diagonal fraction. But it doesn't look as good.

When we export one of the few common glyph fractions, it's exported as a single unit and doesn't get exported as a numeral slash numeral. It looks good as is, and the web site developers don't need to apply any special CSS formatting. So I was hoping to find extended glyph packages for fractions, or learn how to make a fraction using the open type menu, and then convert it to a form that would not come apart during export.

Theunis de Jong's picture

Hmmm ... Are you using your own font on the web site? If not, there is no point in creating more fractions -- they would only appear on your screen, using your own (adjusted) font.

In addition, there are not than many preset Unicode code points for vulgar fractions: a list of code points containing 'fraction'. So you would need to add your characters into the PUA segment -- and if so, you cannot use any other font than your own.

Miguel Sousa's picture

As Theunis said, there's only a handful of fractions encoded in Unicode. If you need to exchange information reliably (i.e. without using PUAs) and also want the fractions to be encoded in the text as a single character, you're limited to that set.

However, you can get somewhat decent arbitrary fractions (e.g. 13/16, 15/16) by using superscript and subscript characters — the ones in the 2070–209F range plus the 1, 2 and 3 superior in the 0080–00FF range — separated by the fraction character (U+2044).

So, something like this: ¹³⁄₁₆ ⁶⁶⁄₇₈

It's far from perfect since the glyphs used are the superiors and inferiors, instead of the numerators and denominators.

Frode Bo Helland's picture

Tim: Have you considered asking a type designer to draw and hint a suitable font for you? Utilizing @font-face, one font dedicated to numerators and one dedicated to denominators would solve your problem. I’m up for the task if you need help.

Nick Shinn's picture

You wouldn't need two fonts.
You could build an OpenType font that, when the "fraction" feature is applied, changes the figures into the characters Miguel mentions, e.g.

sub one' slash figure by onesuperior;

etc.

Normally it's not a good idea for feature code to change one character to another, but in this "print first then web" workflow, it should work seamlessly.

Arno Enslin's picture

Normally it's not a good idea for feature code to change one character to another

Why not?

Frode Bo Helland's picture

OT support on the web is far from cross browser yet, Nick. That said, you could make do with one font and downgrade to ⁶⁶⁄₇₈ (instead of 66/78, as I first thought of) when @font-face isn’t supported.

Nick Shinn's picture

Why not?

Because it corrupts the text, creating problems (especially in PDFs) for copying text, and searching.

Tim Monroe's picture

I need to do some reading to catch-up with your replies; I've never heard about unicode points and poa segments.

We are not using our own font on web site. We asked them to use Verdana. Sounds like there are no extended sets available. Are you saying I could build 15/16 in Open Type so that it would match the glyph single character fractions? And that it would export intact as the single character glyphs do?

Frode Bo Helland's picture

Tim: You could have a full set of numerators and denominators accessible with Opentype (type “1234/5678”, select the text and choose “fraction” in the OT menu). That would work fine in Indesign but not on the web. The problem is lacking cross browser support for OT features and no Unicode definition for the glyphs you need to build arbitrary fractions.

My proposal is to draw one or two fonts with numerators/denominators instead of the regular figures in the same style as Verdana, and just change the fonts using CSS. The code on your website would look something like this,

<span class="numr">1234/</span><span class="dnom">5678</span>

and automatically convert 1234/5678 to a fraction.

Frode Bo Helland's picture

Verdana Pro is on it’s way, but even though it has the necessary glyphs, you can’t access them online (and it might not be licensed for online use either).

Frode Bo Helland's picture

And yes, you can build as many pre composed fractions as you like in an OT font, but a decent fraction function would let you write whatever fraction you need on the fly.

Nick Shinn's picture

I had a look at the system fonts the Mac, and none of them have a consistent set of superior and inferior figures that could be used for making fractions. Lucida Grande is close, but the superiors for 1 - 4 don't align with those for 5 - 8.

Frode Bo Helland's picture

Forgive me Tim. I just reread your first post. Perhaps I’m not answering your question directly: You CAN compose arbitrary with Myriad (I guess you can with Minion too) using the fractions feature in OT in Indesign or Illustrator. You CAN NOT have these fractions online unless you use superiors and inferiors, my method or something similar.

Frode Bo Helland's picture

Tim, I think 15/16 would have to be a single glyph in your font file to export it as one. If 15/16 was a glyph in your font, you still couldn’t access it online.

Theunis de Jong's picture

I need to do some reading to catch-up with your replies; I've never heard about unicode points and poa segments.

Ah -- a baseline of knowledge to work from! I'll be gentle, then.

Unicode is the (or, maybe just a) way of defining which characters are defined by which code. It all started with ASCII (and before that, EBDIC, but I haven't seen that used for, oh, 25 years?): the code for an "A" is 65, for a "B" is 66, and so on, for the regular alphabet as well as numbers. Unicode attempts to expand that to be able to encode (arguably) every written code system, and for that it needs lots of codes. "Code point" is the name computer geeks give to, uhm, a certain code at a certain point, as in "The code point for lowercase alpha is hex 3b1".

We are not using our own font on web site. We asked them to use Verdana. [..] Are you saying I could build 15/16 in Open Type so that it would match the glyph single character fractions? And that it would export intact as the single character glyphs do?

I think I understand why some of our answers leave you bewildered. Opentype is not a web-format. It's a font file format, and designed to provide definitions for a font in its own file. Therefore, if you ask your users to use Verdana, all you can use on your web page is Verdana. You cannot 'add' Opentype features -- other than adding them to the font file named "Verdana.ttf" and putting that on your web site for download. (And that'd not be a good solution, because firstly, it would be illegal, and secondly, people would need to download and install the font before looking at your web site.) (I'll skip Web font solutions for now, as I don't know squat about those.)

Tim Monroe's picture

I understood that what was exported from Indesign was raw text, and that any styling to restore the original look would need to be done after export. I just hoped to find a way to add more vulgar fractions to the glyph set because those exported intact and looked good. But it sounds like only nine common fractions are available as glyphs, so we'll continue to have the developer restyle the exported numerals slash numerals into diagonal fractions.

Thank you all for your help.

Frode Bo Helland's picture

You understood perfectly, except this:

… so we'll continue to have the developer restyle the exported numerals slash numerals into diagonal fractions.

You can’t have more than the nine common diagonal fractions online, unless you do some sort of custom solution.

Syndicate content Syndicate content