Curves and Nodes

peterfwyang's picture

Hi, I have been reading about the advantages of OTF format and want to extend an old font beyond standard latin alphabet (A-Z). However, the font is originally in TTF format. I am wondering, after looking at the various pages on this site, is there a way of reducing the number of nodes in a OTF that has been converted from TTF without altering the shape of the glyph? I have seen "Optimise" and "Clean up" functions in FLS5 but they appear to alter the curves a bit.

Also when reducing the font from 2048 to 1000 em, what is the best way of doing it? Clean up everything first, then reduce, or reduce first, then clean everything up?

Thanks for your help.

Té Rowan's picture

There are two flavours of OpenType (OT): Compact Font Format (CFF) aka PostScript (PS), and TrueType (TT). The main difference between a TT font and a TT-flavoured OT font is the presence of OT look-up tables in the latter.

Meaning? Unless you absolutely need the font to have the CFF flavour, leave it as TT. You and the world will be much happier.

peterfwyang's picture

Hi Reynir,
Unfortunately, yes CFF is required in order to keep font size down :-(
Pete

Mel N. Collie's picture

You can license Robofont, open the ttf, set the font info to "preserve points", output ttf and cff compatible UFOs, reaching point-compatible ufos in each format. Compare the two, make whatever edits to the new cubic beziers you may find, and output a cff-ready OTF?

hrant's picture

So Robofont's conversion is cleaner? But it does still need occasional tweaking?

hhp

HVB's picture

It is not necessary to change the UPM size to 1000 for an OpenType font. There are many typophile threads attesting to this.

IIRC, the 1000 limitation applies to Type 1 fonts (pfb/pfm) but NOT to CFF OT fonts.

Are there any known circumstances where a CFF OT will fail if it has a UPM other than 1000? Six years ago Adam Twardoch said that InDesign assumes 1000 and uses a text cursor to match, so if the font has a UPM of 2000 the cursor would be sized at 50%.

- Herb

John Hudson's picture

The InDesign cursor scaling bug was fixed some time ago. However, we've found issues with some third-party PDF creators that assume a 1000 unit em for CFF fonts, and that mess up scaling and metrics. This won't stop us from producing fonts with higher UPM values if the details of the individual design require it, but it does mean that we try to stick to 1000 for PS fonts whenever possible.

Mel N. Collie's picture

"So Robofont's conversion is cleaner?"

One has the proper choices:
convert and keep the exact shape,
or convert and keep the exact points.

"But it does still need occasional tweaking?"

I suppose, if one is concerned about the output above 300 dpi, or so, one could tweak occasionally, and if not, not at all.

peterfwyang's picture

Hi all, thanks for the feedback.

@John Hudson - exactly! I have found that 1000em for CFF is best :-)

@ dberlow in your last post, you say that there are two proper choices, however, where do I find these options? When I open the font in Robofont, a popup message says "RoboFont will convert TrueType splines to splines with 2 offcurve points." so I click on ok. Then what? Forgive my ignorance, I have never used Robofont before.

Thanks

Mel N. Collie's picture

Peter, in the font window, the "Robofont" selection, under "Generate"...

peterfwyang's picture

Hi dberlow,

Done that, trying both ways - it doesn't actually reduce the number of points, it increases them :-( I'm trying to find a way that I can reduce the number of points/nodes so that I can reduce the size of the OTF. Thanks for the suggestion re robofont though.

hrant's picture

I think mathematically/theoretically you cannot reduce data (while preserving the shape) via conversion, you can only increase it. The number of on-curve points (of which a quadratic derivative may have fewer) is only half the story; off-curve points (of which a cubic original necessarily has fewer) have to be there too.

hhp

Té Rowan's picture

If you can get FontForge to work for you, it should be able to do the job without splatting nodes all over the place. Plus, it can simplify outlines with various degrees of aggressiveness.

hrant's picture

Why would you expect it to do a better job than FL and RF?

hhp

Mel N. Collie's picture

Peter: " the font is originally in TTF format. I am wondering, after looking at the various pages on this site, is there a way of reducing the number of nodes in a OTF that has been converted from TTF without altering the shape of the glyph?"

So, what I said is that the way to reduce the points is not to let them increase in the first place by using the RF conversion. If this does not work for you, or your situation, sorry, I hope something else works.

John Hudson's picture

Peter, much is going to depend on how the TTF outline looks to begin with. If a quadratic bezier outline has been fairly cleanly defined with on-curve points used only at extrema and where necessary, FontLab Studio -- Windows, at least, I've never tried the Mac version -- does a remarkably good job of converting to an accurate cubic (PS) bezier without introducing interpolated on-curve points between extrema. This illustration shows an original TTF outline and a converted PS outline; note that the number of cubic nodes is not affected by the number of off-curve quadratic points in the original:

It is as accurate in its preservation of curve quality as I think you can get given the fundamental differences in the mathematics involved. At typical type sizes, even at high resolution, these differences are smaller than the eye can discern. Here are the two outlines superimposed:

If the original TTF outline is less cleanly defined, then FontLab will tend to multiply the number of PS points, sometimes inserting them everywhere that the TTF off-curve points imply an intermediate on-curve point. The earlier FontLab conversion algorithm did this everywhere.
_____

David, I'd be interested in seeing some illustrations of the results of the two RoboFont options. I think I understand what you mean, but pictures, thousands of words, etc..

charles ellertson's picture

I have seen "Optimise" and "Clean up" functions in FLS5 but they appear to alter the curves a bit.

Indeed they do. But can you tell the difference?

The answer to that is mainly how you look for the difference. One way is to toggle back & forth with the glyph displayed at 256 points & watch things change. Yup, it's different.

Another way is to print out the characters, both the original ttf and the optimized .otf, using a laser printer, at, say, 12 point (or whatever size will typically be used). Shuffle the paper & go home. Come in the next day, look only at the paper, and see if you can tell them apart.

We use to do this with loudspeakers, after raunchy stereo salesmen would try & tell us how much "better" the more profitable speaker system was. The "we" here is a couple recording engineers, who had far better ears than the salesman.

So the parallel for you, if you can't tell the glyphs apart, when used as they will be used, would be to get a type designer to critique the differences -- again, as used, not at 256 points on the screen, overlayed.

(Loudspeakers? I use Magneplaners. There are better choices if you're into rock 'n roll with a lot of bass... Otherwise, plan on a lot more money...)

Mel N. Collie's picture

John, I'm not that interested in the preserve shape option... either from PS to TT, or from TT to PS.

Here is the preserve points option.

Path direction is your only clue as you will note the presence in RF of the often FL-requested never FL-granted TT point-type match, i.e. not all RF TT points act like corner points as in FL as I know it. But there can still be curve points, and tangents in FL TT in time for TT's 25th birthday!?

Hope this helps!

Mel N. Collie's picture

John, I'm not that interested in the preserve shape option... either from PS to TT, or from TT to PS.

Here is the preserve points option.

Path direction is your only clue and you will note the presence in RF of the often FL-requested never FL-granted TT point-type match, i.e. not all RF TT points look and act like corner points as in FL as I know it. But maybe there can be curve points, and tangent points in FL in time for TT's 25th birthday!?

Hope this helps!

John Hudson's picture

Path direction is your only clue

That and the length of the control handles relative to the curve segments: if a line drawn between the control handles would touch the curve, that's TT.

Té Rowan's picture

@Hrant – Why do you expect me to be expecting FF to be better than FL or RF? FF may well have a different approach or implementation that could turn out to be better for the job in question. Or worse. Or the same. I'm not a seer.

hrant's picture

It just feels like you're recommending a wild goose chase due to a personal preference for free software. I mean, I myself adore lard, but I'm not going to recommend it to somebody asking for dieting advice.

hhp

John Hudson's picture

I myself adore lard, but I'm not going to recommend it to somebody asking for dieting advice.

I would, presuming of course that we're talking about lard that you've rendered yourself from forage-fed pig fat, and not the hydrogenated stuff they sell in supermarkets.

hrant's picture

I mean this:
http://www.flickr.com/photos/48413419@N00/405892192
Although I have to doubt those particular critters are forage-fed. Speaking of what they're allowed to eat, the swineherds of the true "Pata Negra" variety of Jamón de Serra feed them only acorns - I wonder whether their lard is the best. But as wonderful as pigs are, if we loosen the definition of lard a bit there's nothing better than the tail of the Middle-Eastern sheep.
http://desertcandy.blogspot.com/2011_02_01_archive.html
BTW because (almost) all the fat is in the tail, the meat is free of that pungent smell that turns so many people away from lamb (although not myself).

hhp

JanekZ's picture

David: "not all RF TT points look and act like corner points as in FL as I know it"
aha


That is unbelievable!
top - FontLab 5.2, Nov 2012
bottom - FontForge, Jul 2012

Mel N. Collie's picture

Speaking of what pigs can do to threads, I'll take this opportunity to say goodbye.

peterfwyang's picture

Sorry for the late reply, thank you all for your comments. @ John Hudson, how did you make your nodes coloured in your picture, when I highlight mine (on mac) they are red colour only and when they are not highlighted they are black.

From what I gather on this thread, it is not so important to have less nodes/points rather to have as many to make an accurate conversion?

hrant's picture

Jan, I'm not getting your point - could you explain?

hhp

John Hudson's picture

Peter, the colouring of nodes in my screenshots are the standard FontLab colouring in Windows if you turn on coloured nodes in Options.

JanekZ's picture

I do not see any chance to edit the TT curves when smooth points behave like corner points. In the picture above the same lc "o" from SourceSans ttf font (Adobe).

Té Rowan's picture

@hrant – Not every trip needs a Range Rover. Some can be completed via bus.

hrant's picture

Sure, but I do think you're jumping to a self-validating conclusion.

hhp

Té Rowan's picture

That conclusion being?

Syndicate content Syndicate content