summaryrefslogtreecommitdiffstats
path: root/libass
diff options
context:
space:
mode:
authoreugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-09-13 15:35:10 +0000
committereugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-09-13 15:35:10 +0000
commitdccd5e19ee6312c3f9b304f3d4162c96bd480695 (patch)
tree66c6ea52d0e48554c4557374a9b3f1b6a3a651a1 /libass
parent51590a64c4664ce49a859528d81eee632b75ff1f (diff)
downloadmpv-dccd5e19ee6312c3f9b304f3d4162c96bd480695.tar.bz2
mpv-dccd5e19ee6312c3f9b304f3d4162c96bd480695.tar.xz
Make font outline width proportional to movie resolution.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19831 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libass')
-rw-r--r--libass/ass_render.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index 12f06b8bd2..6aee3cd8d4 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -135,6 +135,7 @@ typedef struct frame_context_s {
int orig_width; // frame width ( = screen width - margins )
ass_track_t* track;
long long time; // frame's timestamp, ms
+ double font_scale;
double font_scale_x; // x scale applied to all glyphs to preserve text aspect ratio
} frame_context_t;
@@ -521,9 +522,7 @@ double ass_internal_font_size_coeff = 0.8;
static void change_font_size(int sz)
{
- double size = (double)sz * global_settings->font_size_coeff * ass_internal_font_size_coeff;
- size *= frame_context.orig_height;
- size /= frame_context.track->PlayResY;
+ double size = sz * frame_context.font_scale;
if (size < 1)
size = 1;
@@ -579,7 +578,7 @@ static void change_border(double border)
} else {
render_context.border = border;
FT_Stroker_Set( render_context.stroker,
- (int)(64 * border),
+ (int)(64 * border * frame_context.font_scale),
FT_STROKER_LINECAP_ROUND,
FT_STROKER_LINEJOIN_ROUND,
0 );
@@ -1878,6 +1877,9 @@ static int ass_start_frame(ass_instance_t *priv, ass_track_t* track, long long n
ass_lazy_track_init();
+ frame_context.font_scale = global_settings->font_size_coeff * ass_internal_font_size_coeff *
+ frame_context.orig_height / frame_context.track->PlayResY;
+
if (frame_context.width * track->PlayResY == frame_context.height * track->PlayResX)
frame_context.font_scale_x = 1.;
else