Italic and bold info in TTF

fanatic font addict's picture

Is there a straightforward modification that can be made to a TTF file, via adding a table, or altering a few entries in some tables, that would give the font generic italic and bold styles. Or, is there some well-known utility that does this.

Here's some background on this question.

I'm doing some work in Flex and Actionscript 3, (part of the Adobe flash family) and one of the options is to embed a font in an application. You can either embed a font as a 'systemFont' or as 'source' (the actual TTF file). When embedding, you also have the option of specifying fontStyle='italic' or fontWeight='Bold.' My point of confusion is that, while I can embed some Windows system font as italic or bold (or a combination), if I locate the actual TTF file for that system font, and try to embed that directly (i.e. as a 'source' embedding), and also specify italic or bold, invaribly I get an error from the compiler - 'no italic and bold info in the file'. So, it is evident to me that as a system font, Windows is generally coming up with the italic and bold transformations on its own, and not from info in the ttf file. This is even more apparent if you call GetFontData (a windows legacy function) which retrieves the ttf from memory for an actual loaded font, and whether the font is italic or bold or normal, it returns the exact same ttf file from memory, identical to what is on disk.

So my question is, if Windows can generate its own italic and bold transformations on its own, is there a way I could alter a ttf file to have generic bold and italic info to begin with. (For various reasons I need to embed directly from the ttf file and not from a Windows system font.) I know a fair amount about the structure of tables in a ttf file after studying some Apple docs for the last few days, and have made some other types of successful modification to ttf files. I want some simple generic transformation of a ttf file along the lines of whatever windows is doing on its own. I've been looking at the fvar and gvar tables, but none of the fonts on my system use those tables at all (so I don't have any examples).

k.l.'s picture

Which fonts and styles? (I doubt that you need to adjust the fonts for that ...)

fanatic font addict's picture

Any font. Italic and bold is all I need for styles.

For some well known fonts, e.g. Times New Roman, etc, there are seperate ttf files for italic, bold, and bold italic. But for ninety percent of the fonts on my system, there is one ttf file for each of them, and windows is generating italic and bold fonts on its own, by some generic transformation. I want to be able to make a straightforward modification to such a file to make it italic (For example it would be convenient if there were some numeric field among the ttf tables, in which you could specify some default slant angle for italic.) But anyway, the flash compiler is taking one look at some ttf file and saying, "This isn't an italic file", and it would be a start to know at least how its doing that.

Thought that maybe some of you guys that design a lot of fonts might be experts in the ttf file tables.

j.hadley's picture

As far as I know, you cannot control how the OS generates fake bold or fake italic by editing the regular weight font. These are done algorithmically.

Thomas Phinney's picture

Josh is correct. However, if memory serves (this was years ago that I dealt with this), on Mac OS you used to be able to suppress the OS generating fake italics and bolds by modifying the base font. There were flags in the FOND resource to control this. But that was all: either let the OS do its thing, or disallow it.



Syndicate content Syndicate content