Creating a font family with TTX

Manosk's picture

Hi,
I have got a set of four .OTF fonts that in the font menu of MS Office 2003 are displayed as follow:

Times Regular
Times Italic
Times Bold
Times Bold Italic

I would like to edit the font files so that in the font menu they are displayed as a single line "Times".
Picking "Times" from the menu I should get Regular.
Italic, Bold and Bold Italic should be activated via the correspondent button in the toolbar.

I've already installed TTX and I have concerted the OTF files to XML. What lines should I edit to get what I want?

Thank you

Manosk's picture

Can someone help me with this?

Grzegorz Rolek's picture

Please search for what is called font style linking. It’s quite a common topic and it’s been dealt with many times here on Typophile alone. You should have no problem finding detailed instructions if you do some search by these keywords, I’m sure.

Michel Boyer's picture

How to do it with FontLab will not help. The relevant Microsoft information for the Naming table is

https://www.microsoft.com/typography/otspec/name.htm

The Name IDs need to be fixed.

In the xml file produced by ttx, the line after namerecord nameID="1" should be the family name, here Times; the line after namerecord nameID="2" should be the subfamily, here either Regular or Italic or Bold or Bold Italic; the line after namerecord nameID="4" should be the full name, i.e. either Times Regular or Times Italic or Times Bold or Times Bold Italic.

Notice that nameID="1", nameID="2" and nameID="4" normally appear at least twice, once for the Macintosh, once for Windows.

blokland's picture

Michel: ‘The Name IDs need to be fixed.’

Probably you’ll have to fiddle with the style-bit setting too (as mentioned in the Name IDs part):

https://www.microsoft.com/typography/otspec/os2.htm#fss

FEB

Manosk's picture

Hello,

first of all thank you for your precious help! I'm reading the pages you've linked: they are really interesting...

I have another question for you. I've just found a software that promises to solve my "font style linking" issue through a gui: TransType 4. It's not cheap but it could be very practical for my needs...

Is there any problem with using TranType 4 to link font styles? Is there any reason I should use TTX instead?

Manosk

Michel Boyer's picture

I don't know TransType 4 but TTX is normally a last resort.

Michel Boyer's picture

Frank: Probably you’ll have to fiddle with the style-bit setting too (as mentioned in the Name IDs part):

I see that FontForge adjusts those bits automatically.

blokland's picture

Michel: ‘I see that FontForge adjusts those bits automatically.’

Remains the question whether what FF automatically does with this bits is what you want it to do. In case of the four styles/weights in question this will be no problem, I reckon. But working with FF requires decompilation of the fonts to FF’s internal format, which is not the case with TTX or DTL OTMaster (OTM). Depending on the (quality of the) program used for the conversion of .ttf to .otf (is that allowed anyway?) that could be considered a disadvantage or an advantage though.

My advise is to first check the consistency of the font naming and style bits with the free Light version of OTM, which can be downloaded from the FM website.

FEB

Michel Boyer's picture

Frank

I agree with what you say. However, even with your light version of DTL, the user needs to know what to look for, and where, and for fsSelection the display is hardly better than with TTX.

In my opinion, to properly display the relevant information, some very basic python code using the fonttools would be preferable. Just to read the fsSelection bits, here is some code that assumes that AFDKO is installed; just copy the lines between the cut lines and paste them in a terminal window (on the macintosh).

---- cut line
TTX=`which AFDKOPython`
TTXF=`dirname $TTX`
cat > ${TTXF}/fssel <<'EOF'
#!/usr/bin/env AFDKOPython

from fontTools.ttLib import TTFont
import sys
fsbits = {0x001:'Italic',
          0x002:'Underscore',
          0x004:'Reverse video',
          0x008:'Outlined',
          0x010:'Striked out',
          0x020:'Bold',
          0x040:'Regular',
          0x080:'Use Windows spacing metrics',
          0x100:'WWW',
          0x200:'Oblique'}

f=TTFont(sys.argv[1])
fs = f["OS/2"].fsSelection
print "The fsSelection bits say:"
for bit in fsbits:
  if fs & bit:
    print "     ", fsbits[bit]
EOF
chmod 755 ${TTXF}/fssel
---- cut line
That saves an executable called fssel in your path. Now, here is a trace of execution on the same file as the grab above:
----
605 % fssel /Library/Fonts/ArnoPro-BoldItalic.otf
The fsSelection bits say:
      Italic
      Bold
      Use Windows spacing metrics
----
Slightly more readable, no?
blokland's picture

Michel: ‘However, even with your light version of DTL, the user needs to know what to look for and where and for fsSelection, the display is hardly better than with TTX.

Perhaps if one goes directly to the ‘OS/2’ table, but the Consistency Checker (‘Tools’ menu) is quite convenient IMHO:

The Consistency Checker in the OTM 370 full version provides even more information:

Also the consistency of the font naming can be checked with OTM (Light):

FEB

Thomas Phinney's picture

TransType is pretty much the ideal tool for fixing/updating family groups and style linking. The GUI is dead easy, and technically it does the Right Things with few opportunities for error.

Manosk's picture

Frankly ttx is a little intimidating for me. I would prefer to use a gui to create font families working in Word from original single OTF fonts. What is the best software to create OTF font families: TransType 4 or OTMaster? The latter is currently on offer, so their prices are similar.

Thomas Phinney's picture

If you are looking for GUI and ease of use, then go with TransType.

OTMaster is much more powerful and flexible in this area, but it does not hold your hand nearly so much or present family info nearly so visually.

I now work at FontLab, and we sell both tools. :)

Syndicate content Syndicate content