generic italic, bold attributes for ttf file?

Discuss FontCreator here, please do not post support requests, feature requests, or bug reports!
Post Reply
Font Wolf
Posts: 4
Joined: Thu Mar 06, 2008 7:22 pm

generic italic, bold attributes for ttf file?

Post by Font Wolf » Thu Mar 06, 2008 7:59 pm

I am wondering if its possible to take a given ttf file and without changing all the actual glyphs, alter a few fields somewhere and give the file generic bold and/or italic attributes.

Here's my sitiuation: I'm doing some work in Flash Actionscript 3, and you can embed a font either as a Windows System Font by specifying the font name, or, alternatively, you can embed it by specifying the actual ttf file. My confusion is that I can embed a Windows System Font also specifying bold or italic, but if I locate the actuall ttf file for that system font, and try to embed that as bold or italic, I get an error from the compiler: 'No bold italic info in file'. So it is clear that once that ttf file becomes a system font, windows is generating generic italic and bold versions on its own.

But I need for various reasons to embed directly from the ttf file. Since windows is capable of generically transforming some ttf file to give it an italic or bold font, is it possible for me to do the same by altering the ttf file directly. (For examples changing a slant angle field in some table or whatever).

I would be altering the ttf file directly in an automated context, but is there someway this would be done in FontCreator, i.e. some generic transformation of a font to give it italic or bold attributes, without changing the actual glyphs.

Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 8445
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Post by Bhikkhu Pesala » Thu Mar 06, 2008 8:22 pm

See Font Type in the user manual. Set the font type to italic on the metrics tab.

Finally, run Autonaming to rename the font, and save as a new TTF file.
My FontsReviews: MainTypeFont CreatorHelpFC12 Pro + MT9.0 @ Win10 1909 build 18363.592

Font Wolf
Posts: 4
Joined: Thu Mar 06, 2008 7:22 pm

Post by Font Wolf » Thu Mar 06, 2008 8:32 pm

Thanks.

I read some previous comments of yours somewhere about changing a font to italic, but I thought you meant it would just redesignate the font as italic without actually altering how the font was displayed. I take it from what your saying now it will actually alter how its displayed.

Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 8445
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Post by Bhikkhu Pesala » Thu Mar 06, 2008 9:16 pm

No, it won't alter how it is displayed. You said that you didn't wish to alter the glyphs. To do that, use the Italic Glyph Transformation.
My FontsReviews: MainTypeFont CreatorHelpFC12 Pro + MT9.0 @ Win10 1909 build 18363.592

Erwin Denissen
Moderator
Moderator
Posts: 8380
Joined: Fri Oct 04, 2002 12:41 am
Location: Bilthoven, The Netherlands
Contact:

Post by Erwin Denissen » Thu Mar 06, 2008 9:17 pm

When a specific font style is not available, Windows tries to imitate it based on an available member of the same font family. If the whole font family is missing, Windows will apply font substitution. I don't know how Flash Actionscript 3 handles missing fonts, but I think the best solution is to go find the missing font. Remember TrueType and OpenType fonts have a file for each and every font style.

Do let us know your results.
Erwin Denissen
High-Logic
Proven Font Technology

Font Wolf
Posts: 4
Joined: Thu Mar 06, 2008 7:22 pm

Post by Font Wolf » Thu Mar 06, 2008 10:46 pm

"When a specific font style is not available, Windows tries to imitate it based on an available member of the same font family. If the whole font family is missing, Windows will apply font substitution. I don't know how Flash Actionscript 3 handles missing fonts, but I think the best solution is to go find the missing font. Remember TrueType and OpenType fonts have a file for each and every font style. "

For ninety percent of the the fonts in the windows font directory on my system, there is one and only one ttf file for each of them. Certainly there's a seperate italic file and italic bold file and so on for Times New Roman, and some other well known fonts, but they are in the small minority. (I did download something called font bonanza whcih consists of thousands of fonts). Furthermore, in Windows, you can call a legacy SDK function called GetFontData, and it will return the entire ttf file from memory for any actual system font loaded into a device context. And its always the exact same ttf file for a given font, regardless if the loaded font is italic bold or normal (haven't tried times new roman, though). Also, I don't even understand why a seperate set of glyphs would be needed in most cases for italic, in that it seems in most cases just changing the slant angle is sufficient (same situation with bold - why a completely different set of glyphs).

From the help manual entry provided:

"Set Italic Angle to a negative value (e.g. -16.33) - on the Format menu, click Settings and then click on the Post tab."

What is the point of having this field if an entirely new set of glyphs needs to be created?

I was hoping that a single field in a ttf file would change the weight of a font as well - not require a whole new set of glyphs to be created.

So, I'm still utterly confused by the whole issue.

Just to reiterate my objective, in my program I want to take some arbitrary ttf file and on the fly change it into an italic or bold file, by changing a few fields. It seems you all are saying (if I read you correctly) that FontCreator must use some complex glyph transformation to create an entirely new set of glyphs to make an existing ttf file italic.

Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 8445
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Post by Bhikkhu Pesala » Fri Mar 07, 2008 6:06 am

Font Wolf wrote:It seems you all are saying (if I read you correctly) that FontCreator must use some complex glyph transformation to create an entirely new set of glyphs to make an existing ttf file italic.
It is not that complex, it just changes a few fields as explained above, then slants each glyph by the italic angle. It is not a true italic font, but just an oblique font. To make a true italic takes a lot more work.

I presume what you're trying to do is reduce the size of your flash files like this dude: Flash Faux Fonts

If you use faux fonts (italics or bold attributes for fonts that don't have a matching TTF file) in a desktop publishing application like PagePlus, then publish to PDF, the faux fonts will be converted to curves as the fonts are not available to embed, thus greatly increasing the PDF file size.

I think your problem is that Flash Action Script doesn't have the code needed to generate faux italic fonts, though faux bold seems to be possible according to the above link.
My FontsReviews: MainTypeFont CreatorHelpFC12 Pro + MT9.0 @ Win10 1909 build 18363.592

Font Wolf
Posts: 4
Joined: Thu Mar 06, 2008 7:22 pm

Post by Font Wolf » Fri Mar 07, 2008 1:54 pm

Bhikkhu:

Thanks very much for going above and beyond with finding that information. It certainly would take care of the bold, and reduce the size of the SWF file as well. (Although file size isn't my main concern. The mxmlc compiler actually uses two different font managers for embedding fonts and the superior one according to their own documentation, "Batik", can only handle ttf files, not windows system fonts. The other font manager, JRE, actually crashes from time to time, and I would be invoking it from a program).

So that just leaves italic. To repeat a previous question of mine, do you understand what function there is for an italic angle field in the TTF spec , if it doesn't actually do anything. So, you change all the font names, change a couple of other fields to specify "italic" and change this slant angle field, and all that doesn't do anything to actually alter the appearance of the font. Although actually I guess I'm going to try all that in a bit and see if it causes Flash to magically render the font as italic. (My 30 day trial period on FontCreator ran out and I haven't purchased it yet, although I intend to. I can see however, that changing all those fields doesn't actually alter the appearance of the font in FontCreator.)

Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 8445
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK
Contact:

Post by Bhikkhu Pesala » Fri Mar 07, 2008 5:08 pm

Font Wolf wrote:Do you understand what function there is for an italic angle field in the TTF spec , if it doesn't actually do anything.
Sure, it does something, just not what you think it does.

Change the italic angle on the Settings, Post tab for an italic typestyle, then recalculate the caret run/rise on the General tab. The caret run alters the angle of the text cursor. The italic angle is also used by FontCreator when positioning accents with CompleteComposites. Other applications may use it for other purposes.

When Wordpad or other apps make a faux italic font from a regular font, there is no italic data to use, i.e. italic angle is zero and the font is not marked as italic.

Here are some fonts in Wordpad: 1) Arial Bold Italic, 2) Arial Black (faux italic), 3) Comic Sans (faux italic), 4) Garava Italic, 5) Brush Script (Regular). Note that Arial Black and Comic Sans have the same italic angle, but the other fonts use a different angle. The italic angle of Arial Bold Italic is 12º while Garava Italic has an italic angle of 6º. Wordpad is using a one-size-fits-all value of about 15º. The actual angle of the glyphs in fonts may not match the italic angle. Look at Brush Script, for example. It is a regular font, not italic.
Italic Angle.png
Italic Angle.png (6.65 KiB) Viewed 14866 times
My FontsReviews: MainTypeFont CreatorHelpFC12 Pro + MT9.0 @ Win10 1909 build 18363.592

William
Top Typographer
Top Typographer
Posts: 1999
Joined: Tue Sep 14, 2004 6:41 pm
Location: Worcestershire, England
Contact:

Post by William » Sat Mar 08, 2008 8:24 am

The third post in the following thread, the post which is time stamped as "Posted: Wed Oct 24, 2007 10:49 am", might be of interest.

I have been making an italic version of my Kern Deco Jazz font and I went back through my notes so as to use the same method as when I made an italic version of Kern Deco.

viewtopic.php?t=1823

The post includes the following two lines in relation to trying to make an Italic by using the Glyph Transformer Italic feature.
Tick the checkbox for "Set font subfamily and font design to italic".
Use Autonaming. Keep the name as Kern Deco. Note how the italic information is included elsewhere.
If one opens the Kern Deco Italic font file in the windows fontviewer program, the name of the font, in large letters across the top, is Kern Deco Italic, yet the Typeface name, in smaller letters below, is Kern Deco.

If one opens the Kern Deco font, (there is a link in the first post of the above referenced thread), the name of the font, in large letters across the top, is Kern Deco, and the Typeface name, in smaller letters below, is Kern Deco.

Thus, for the two fonts, the font names are different, yet the typeface names are the same for both of them.

William Overington

8 March 2008

William
Top Typographer
Top Typographer
Posts: 1999
Joined: Tue Sep 14, 2004 6:41 pm
Location: Worcestershire, England
Contact:

Post by William » Mon Mar 10, 2008 8:05 am

Bhikkhu Pesala wrote:Wordpad is using a one-size-fits-all value of about 15º.
This thread has prompted me to try to make italic versions of some of my previously published fonts.

I am starting with Whiteboard Venetian. As the lowercase l is very straight I decided to try to calculate the italic angle used by WordPad for a faux Whiteboard Venetian Italic.

I set the lowercase l in Whiteboard Venetian at 72 point in WordPad in black, then I highlighted it and made it italic. Using Format Font in WordPad is a convenient way to find out if an italic is being produced using a TrueType italic font or is being imitated for the display.

I made a Print Screen copy of the image and pasted it into Microsoft Paint. I then used 8x magnification and added a horizontal line in red 10 pixels long against the lower right side of the inclined vertical, adding it a pixel at a time, with a marker pixel down at every two pixels along the line. At the right end of the horizontal line I added a vertical line in red until it met the black line of the lowercase l, adding it a pixel at a time, with a marker pixel to the right at every two pixels along the line and an extra marker pixel to the right at every ten pixels along the line. The vertical line was twenty-nine pixels long, though other readers might get a different figure as there is some subjective decision making as to quite where the line should end. Using the values 10 and 29 I used Microsoft Calculator to calculate 10/29 giving 0.34482758620689655172413793103448 and I then set the Inv checkbox and pressed the tan button so as to compute the arctangent of 0.34482758620689655172413793103448 so as to give an angle of just over 19 degrees. As the length for the vertical red construction line of the test is somewhat subjective, I am wondering whether the actual figure used by WordPad might be twenty degrees.

Incidentally, I tried the same test yet using Serif PagePlus 11 instead of WordPad, exporting the image from PagePlus directly as a bmp and then adding red pixels within Microsoft Paint I and got the same 29 pixel vertical length.

I am thinking of making the angle for a TrueType Whiteboard Venetian Italic as 7.125 degrees as that is the arctangent of 256/2048, meaning that the angle is 256 font units to the right in 2048 font units tall. In fact, I have found that FontCreator rounds that to 7.13 degrees. An angle of 7.13 degrees is much less than 20 degrees.

William Overington

10 March 2008

Post Reply