Commit Graph

277 Commits

Author SHA1 Message Date
diego fba0b66ff9 Add explanatory comments to the #endif part of multiple inclusion guards.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25563 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-12-31 16:15:50 +00:00
diego 82ee453947 typo
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25543 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-12-30 03:17:04 +00:00
eugeni e6839faa8d Improve comments for ass_process_* functions.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25542 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-12-30 02:17:16 +00:00
eugeni bf22a172e7 Return from ass_start_frame immediately if the track is empty.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25541 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-12-30 01:03:05 +00:00
ben 1abce87cbe make libass use sub_font_name whenever it's possible
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25420 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-12-16 11:13:24 +00:00
ulion 4f4c08415c Fix libass to support -nofontconfig.
For history reason, fontconfig is auto-enabled when ass is enabled,
we keep this behavior and document it clearly.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25379 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-12-12 10:00:34 +00:00
iive b43c16f8b6 Our enca code uses strdup() on the input encoding name, as we don't modify it we can use the original constant string.
Uses less memory, code is simpler and faster.
Fixes memory leak (noticed by ulion).


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24879 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-10-28 14:26:05 +00:00
eugeni 85b15648f9 Cosmetics: fix indentation after last commit.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24856 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-10-25 21:20:28 +00:00
eugeni c0eaa90799 Check return value of add_face.
This fixes segfault when reselecting fonts and the new font could not be
loaded (because of a bad font file, or too many font faces already loaded).
Patch by Glen Nakamura, glen at imodulo dot com.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24855 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-10-25 21:19:20 +00:00
eugeni 92efd606d1 Avoid text deformation and subtitles moving outside the screen in pan-and-scan
mode.

For this, crop amounts are passed from vo_gl as negative margins sizes. They
are used to calculate aspect ratio. They are ignored when calculating subtitle
 positions, so subtitles will stay on screen most of the time.
Based on a patch by Jindrich Makovicka [makovick gmail com].


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24815 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-10-19 18:16:23 +00:00
eugeni 666a245ff9 More precise line spacing.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24577 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-09-18 19:51:22 +00:00
eugeni 658f1e215e Fix text height calculation. It depends on line spacing.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24576 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-09-18 18:41:38 +00:00
eugeni 23f5d9b6ba Fix an obviously incorrect comment.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24575 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-09-18 18:36:54 +00:00
eugeni 351a62dbc4 Enable ass_line_spacing option.
Patch by Thomas Reitmayr (treitmayr devbase at).


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24574 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-09-18 18:34:52 +00:00
diego 84157efa5a Clean up the way get_path is handled: Compile get_path.c to an object to link
against instead of directly #including the C file and replace the many extern
declarations by a proper header file.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24262 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-08-28 11:20:24 +00:00
iive 8051b919a7 Fix compilation of ass_fontconfig.c when fontconfig is disabled.
Add missing parameter to the function in the #else case


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24008 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-08-04 10:46:14 +00:00
eugeni dc0541c142 Don't apply windows-like font scaling if hhea or os2 tables contain invalid
metrics.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24003 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-08-03 15:39:38 +00:00
eugeni 6f90765a40 Workaround for fonts with zero ascender/descender in horizontal header.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24002 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-08-03 15:22:55 +00:00
eugeni 66d6320b51 Factor out common code from ass_font_new and ass_font_reselect.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24001 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-08-03 14:10:53 +00:00
eugeni 10cd4a7e5a More simple and correct font reselection.
Since ass_font_t contains a list of font faces, there is no need to select the
face with maximum charset coverage each time. It is enough to select any face
with the required glyph.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24000 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-08-03 13:43:11 +00:00
diego 3e9e4acd8d Do not use leading underscores in multiple inclusion guards, they are reserved.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23709 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-07-02 22:34:45 +00:00
diego 437e32353f Consistently use filename as multiple inclusion guard.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23707 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-07-02 21:34:39 +00:00
eugeni 387ccdc034 When parsing ass-force-style arguments, search for '=' and '.' characters with
strrchr. This allows using it for styles whose name contains those characters.
Patch by Бранко Мајић <branko majic at gmail com>.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23560 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-06-15 22:22:16 +00:00
eugeni 34402c3cf2 Make sure there is at least one style in ass_track when parsing events.
Before it was only checked for embedded subtitles.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23559 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-06-15 22:15:27 +00:00
eugeni 4939caa691 Move code for reading a file and recoding it to utf-8 to a separate function.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23442 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-06-01 19:56:44 +00:00
eugeni c64608422a Fix #if condition.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23358 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-20 17:56:39 +00:00
eugeni 225a00fb2e FT_Request_Size does not exist in FreeType 2.1.*. Fallback to FT_Set_Char_Size.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23357 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-20 17:04:12 +00:00
eugeni 1762cbe986 Correct font size in libass.
Values from TrueType OS/2 table are used to reproduce VSFilter behaviour.
Magic 0.8 multiplier and scaling for the fractional part of font size are not
needed anymore.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23346 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-19 14:11:41 +00:00
eugeni c5bc1d693c Revert y-axis rotation. Change order of rotations.
Now rotations are performed in the following order: X, Y, Z. Before this, it
was the other way around. Also, in FreeType Y axis is directed upwards, so the
corresponding rotation must be reverted.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23340 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-18 18:58:34 +00:00
eugeni 8513877fac Support fractional font sizes.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23318 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-14 20:41:14 +00:00
eugeni b51b557529 Limit ass_font_set_transform to nonrotating transformations.
Rotations are not needed here (they are performed in transform3d) and they
disable autohinter.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23317 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-14 20:24:53 +00:00
eugeni 929e461eb0 Don't deallocate font data if it will be used later.
It produced either segfault or "Error opening memory font" with any script
that contains embedded fonts.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23282 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-09 21:38:28 +00:00
eugeni 7a3a0a3225 Move variables and a function under #ifdef FC_VERSION to avoid warnings.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23234 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-03 20:10:14 +00:00
eugeni ef3fb052c2 Deallocate FontConfig objects.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23233 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-03 19:52:46 +00:00
eugeni 1ec5f31f72 Fix stupid bug in r23229.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23232 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-03 19:47:34 +00:00
eugeni e4855381f4 Deallocate string.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23231 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-03 19:33:35 +00:00
eugeni e3e99c086c In ass_font_new, allocate temporary ass_font_t on stack and return the pointer
to cache-owned copy. This fixes leaked ass_font_t struct.

Without this, font pointers obtained from ass_font_new() and
ass_font_cache_find() were different, and bitmaps rendered with the first one
could not be located in the cache later.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23230 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-03 19:26:43 +00:00
eugeni 0b8bd90b9e Make cache_*_add functions return the pointer to new (copied) value.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23229 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-03 19:13:54 +00:00
eugeni 9cda6a4834 Always deallocate glyphs. Fixes memory leak.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23208 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-02 10:15:12 +00:00
eugeni e23d5dacb7 Update comments.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23197 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-01 15:54:00 +00:00
eugeni 22f759c04a Cosmetics.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23196 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-01 15:34:08 +00:00
eugeni f0ffc341b6 Move glyph_to_bitmap() call and outline glyph deallocation to
get_bitmap_glyph().


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23195 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-01 15:33:06 +00:00
eugeni 6deff1f55a Minor code simplification.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23193 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-01 15:21:34 +00:00
eugeni eaa1f9ab16 Move get_bitmap_glyph() call to a separate loop.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23192 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-01 15:14:22 +00:00
eugeni 8ffc803841 Move transform_3d() call to get_bitmap_glyph().
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23191 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-01 15:12:36 +00:00
eugeni 3e9be13d66 Make a function static.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23190 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-01 15:07:41 +00:00
eugeni 005220995c Don't recalculate rotation radius.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23189 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-01 15:05:20 +00:00
eugeni 5221c54cb6 Bugfix: glyph cache depends on border width, because it contains outline_glyph
(glyph border obtained with FT_Glyph_StrokeBorder) since r23043.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23188 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-01 14:29:28 +00:00
eugeni c67220c86f Add -ass-hinting option for setting font hinting method.
It is possible to separately configure hinting for scaled and unscaled osd.
The default is native hinter for unscaled osd (only vo_gl at this point),
no hinting for vf_ass.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23152 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-27 14:25:36 +00:00
eugeni 13156cd794 Fix division by zero in "\t" parsing.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23151 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-27 14:18:44 +00:00