Blend font interpolated kerning ?

Primary tabs

22 posts / 0 new
Last post
ReginaldV's picture
Offline
Joined: 7 Apr 2008 - 4:13am
Blend font interpolated kerning ?
0

Hi all,

I've been doing some experiments with the Blend Fonts command to produce interpolated weights.

My question concerns the interpolation of the kerning values. The interpolated weights produced from the master blended font contains some of the kerning pairs that are present in the orginal fonts but not all of them.

I made sure that the orginal light and bold weights had the same kerning pairs but with different values.

Should the kerning be interpolated ?

Is there a better way of doing this ?

Is there a reason way some kerning pairs are present and not others ?

kris sowersby's picture
Offline
Joined: 18 Feb 2003 - 11:00am
0

You can interpolate kerning with Superpolator.

—K

ReginaldV's picture
Offline
Joined: 7 Apr 2008 - 4:13am
0

I don't have OS X 10.5

Miguel Sousa's picture
Offline
Joined: 18 May 2003 - 8:30pm
0

> The interpolated weights produced from the master blended font contains some of the kerning pairs that are present in the orginal fonts but not all of them. [...] Is there a reason way some kerning pairs are present and not others ?

Maybe because those pairs had a kerning value of 0 (zero) in the interpolated instance?

I work with MM fonts all the time containing thousands of pairs and I never had a problem. If there's a problem it might be in the Blend Fonts function. I recall it being quite buggy in regards of handling kerning.

James Montalbano's picture
Joined: 18 Jun 2003 - 11:00am
0

ReginaldV,

I suggest you ditch the Blend feature approach and build your MM fonts with the Mask-to-Master technique.

James

ReginaldV's picture
Offline
Joined: 7 Apr 2008 - 4:13am
0

Yes I think you could be right about Blend font being buggy.

Is it best then to create a MM font and generate the weights from that.

I'm reading the FL manual now but finding it hard to work out how to create a MM font from the light and bold weights.

I'm I barking up the wrong tree here ?

ReginaldV's picture
Offline
Joined: 7 Apr 2008 - 4:13am
0

James,

What is the Mask-to-Master technique ?

Karsten Luecke's picture
Offline
Joined: 6 Aug 2005 - 8:41am
0

[Ups, didn't read careful enough ...]

Tim Ahrens's picture
Offline
Joined: 28 Sep 2004 - 9:15am
0

I agree to terminaldesign, forget the blend feature and use Mask to Master. However, Mask to Master does not merge the kerning.

If you need to transfer the kerning between masters or fonts you can use afm files. The metrics window allows you to export and import them. When you import an afm into an MM font, only the currently active master will be affected. Same for export. This works really reliably and has helped me repair MM fonts quite a few times already.

Thomas Phinney's picture
Offline
Joined: 3 Sep 2002 - 11:00am
0

Didn't FL used to have a bug where exported AFM files were sometimes incomplete? Was that fixed in a dot release?

T

James Montalbano's picture
Joined: 18 Jun 2003 - 11:00am
0

MM via Mask-to master

1. Create two fonts that you want to create a MM with. Export their afm files via the metrics window.
2. Make sure all the glyphs have the same number and type of points, in the same relative position. Also make sure all path directions are the same for each glyph.
3. Assign one of the fonts to the mask layer Tools>Mask> Assign Font Mask
4. Define the appropriate axis: Tools> Multiple Master> Define New Axis
5. At this point if not before, it is a good idea to Save As and assign this soon to be MM vfb a new name. Just in case something goes wrong
6. Select the glyphs in the font window and using Mask to Master convert the Mask to the appropriate Master Axis: Tools>Multiple Master> Mask to Master. When you are asked whether to let FontLab add points where necessary, make sure you select NO

If you have done your prep correctly you will have no problems, but that hardly ever happens, you will always have a few problems. At this point you will most likely have to import the kerning and sometimes the metrics via the afm files you created to the newly created MM axes.

James Montalbano's picture
Joined: 18 Jun 2003 - 11:00am
0

I would also recommend not kerning anything in the original fonts, and do all your kerning in the newly created MM vfb. But that is just a personal preference.

ReginaldV's picture
Offline
Joined: 7 Apr 2008 - 4:13am
0

terminaldesign,

I'm confused by your description

I have two fonts that I want to make into one MM font, so

3. Assign one of the fonts to the mask layer Tools>Mask> Assign Font Mask

I do this to the first font (Font 1)

4. Define the appropriate axis: Tools> Multiple Master> Define New Axis

This applies to Font 1

5. At this point if not before, it is a good idea to Save As and assign this soon to be MM vfb a new name. Just in case something goes wrong

Save Font 1 as the MM font

6. Select the glyphs in the font window and using Mask to Master convert the Mask to the appropriate Master Axis: Tools>Multiple Master> Mask to Master. When you are asked whether to let FontLab add points where necessary, make sure you select NO

Does this apply to Font 1 or is this Font 2 ?

I can't work out how I get the two fonts into one file.

Sorry if I'm being stupid

James Montalbano's picture
Joined: 18 Jun 2003 - 11:00am
0

The Bold font and the light font are both open.

Assign the light font to the mask layer of the bold font.

Define the new axis (weight)

Using Mask to Master, assign the mask (light font) to the Wt0 axis. (As opposed to the Wt1 axis which would be the Bold font)

You now have the light font at axis Wt0 and the Bold font at axis Wt1.

Both axes are in the one font. Which started out as just your bold font

Frank E. Blokland's picture
Joined: 28 Mar 2003 - 12:31pm
0

Perhaps this small Mac/Win command line Java tool is useful in this case:

http://www.fonttools.org/downloads/DTL_AFMInterpolator.zip

________________________________________________________________

DTL AFM Interpolator version 1.1
last update: 2 July 2008

New in version 1.1:

- also interpolates POS values next to KPX
- negligible values (specified by an optional, extra argument) are left out
- instead of using a space as delimiter character, it now delimits using any amount of whitespace

Usage:
java AFMInterpolator [file1] [file2] [factor] [flag] [output] ([limit])

- file1: first AFM file
- file2: second AFM file
- factor: interpolation percentage (0-100)
- flag: 0 leaves incomplete pairs out, 1 ignores missing pairs and calculates using 0 instead
- output: output file
- limit: lower limit for values, leaves pairs with values smaller or equal out (optional)

example use:
java AFMInterpolator fontname_regular.afm fontname_bold.afm 50 1 fontname_medium.afm 10

Note: output file is automatically overwritten

Tim Ahrens's picture
Offline
Joined: 28 Sep 2004 - 9:15am
0

Very cool! Need to try that later. Thanks for sharing.

The next thing would be to get the kerning data converted to OT feature code elegantly, for use with AFDKO. Could that be done alongside?

Karsten Luecke's picture
Offline
Joined: 6 Aug 2005 - 8:41am
0

Hi Tim, this would need additional information: your class definitions, plus, per class, which is the key glyph and whether the class is used left, right or both side(s).

Paul van der Laan's picture
Joined: 4 Mar 2007 - 8:56am
0

Alternatively, Robofab offers a kerning interpolation method where the kerning of two seperate fonts can be interpolated in another font directly in FontLab:

from robofab.world import CurrentFont
from robofab.interface.all.dialogs import SelectFont

interpolval = 0.5 # 50% interpolation

f1 = CurrentFont()
f2 = SelectFont('please select mininum pole')
f3 = SelectFont('please select maximum pole')

k1 = f1.kerning
k2 = f2.kerning
k3 = f3.kerning

k1.interpolate(k2, k3, interpolval, clearExisting = True)
f1.update()
print 'done'

ReginaldV's picture
Offline
Joined: 7 Apr 2008 - 4:13am
0

I've gone down the route of creating the MM font with the 'Mask to Master' technique described above. Surprisingly everything seems to be going really well (I was always concerned that making an MM font would be complicated).

All the glyphs are coloured green, (which means there are no problems right). The spacing and kerning all seems to be interpolating correctly with the same number of pairs in all generated instances. Before I get too excited is there anything else I should be looking for. I did spend a long time preping the light and bold weights, but my experience of developing fonts has always been two steps forward and one step back. This seems like two steps forward and I'm worried I'm missing something.

Miguel Sousa's picture
Offline
Joined: 18 May 2003 - 8:30pm
0

> Before I get too excited is there anything else I should be looking for.

Sometimes it happens that the masters look good, but in an interpolated instance some glyphs are mangled. This is caused by incompatibilities between the masters, things like,
-- different starting point node
-- contours in different order*
-- contours in different directions (I'm not sure of this one)

*pay close attention to glyphs like the ellipsis, the colon, the equal sign, the double quotes, etc.

James Montalbano's picture
Joined: 18 Jun 2003 - 11:00am
0

The last item in Font Info is Multiple Master Settings. I suggest you move the slider to some middle position between your two axes. This will change the display of the font in the Font Window and you'll have a better chance of seeing any mangled glyphs.

kiko's picture
Offline
Joined: 11 Apr 2007 - 6:37pm
0

Is there any relevant diference on using the "Assign Master" command insted of the "Mask to Master" operation? Would be the result any diferent, or do they work alike?

Regards