Fix issues with shearing in combination with scaling
Fix issues with shearing in combination with scaling

There are two problems.

First, the shearing tags (\fay and \fax) misbehave when used with
scaling tags (\fscx and \fscy). We have to compensate for the scaling
in either direction when shearing, because the shearing is applied
after scaling. VSFilter, which by definition has the correct behavior,
does it the other way around.

Second, libass doesn't scale smoothly when small font sizes are
involved. These can come either from downscaling (e.g. make the mplayer
window smaller than the video with a video output like gl or vdpau), or
from setting the font size manually. In these cases, the font size
passed to freetype get very low, so that rounding errors or size
adjustments due to hinting or other pixel grid fitting add up. The
result is text rendered in the wrong size, or "pulsating" text if the
font size depends on animated parameters. This is worsened by the
practice found in subtitle scripts to use tag combinations like
"\fscy2500\fs2" to get more precision for controlling font size (needed
because VSFilter doesn't read fractional scale values).

We solve the second issue by always requesting a constant font size
from freetype, and then scaling the resulting glyph to the desired
size. This seems to disable freetype's glyph fitting issue. The caveat
is that it (obviously) also disables hinting, which may result in worse
text quality. However, the combination of applying \fs and \fscx tags,
and animating them, seems to leave no other choice.

This fixes libass issue #46 (hopefully).

grigorig/libass,torque/libass,grigorig/libass,sanyaade-g2g-repos/libass,mwgoldsmith/libass,Akemi/libass,libass/libass,stps/libass,stps/libass,tgoyne/libass,stps/libass,MrSmile/libass,ShiftMediaProject/libass,richardpl/libass,pigoz/libass-ct,tgoyne/libass,pigoz/libass-ct,astiob/libass,MrSmile/libass,libass/libass,blinkseb/libass,sanyaade-g2g-repos/libass,ShiftMediaProject/libass,xbmc/libass,mwgoldsmith/libass,richardpl/libass,torque/libass,Akemi/libass,richardpl/libass,mwgoldsmith/libass,pigoz/libass-ct,torque/libass,astiob/libass,tgoyne/libass,blinkseb/libass,xbmc/libass,Akemi/libass,blinkseb/libass,sanyaade-g2g-repos/libass