Made to Order Software Corporation Logo

SWF Kerning (swf_kerning)

SWF Structure Info
Tag Flash Version: 
1
SWF Structure: 
struct swf_kerning {
	if(f_font2_wide) {
		unsigned short		f_kerning_code1;
		unsigned short		f_kerning_code2;
	}
	else {
		unsigned char		f_kerning_code1;
		unsigned char		f_kerning_code2;
	}
	signed short		f_kerning_adjustment;
};

The following table defines the number of TWIPs to move left or right before to draw the 2nd character when the 1st one was drawn right before it. For instance, the letters AV may be drawn really close so the V is written over the A. To the contrary, WI may be seperated some more so the I doesn't get merged to the top of the W.

The computation to move the drawing pen is done as follow:

  /* writing 'AV' */
  x += f_font2_advance['A'] + f_kerning['AV'].f_kerning_adjustment;

where 'x' is the position at which f_kerning_code1 was draw.



Fig 1. Kerning "AV" and "WI"


Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.