1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-15 11:25:10 +00:00
Commit Graph

290 Commits

Author SHA1 Message Date
eugeni
5f2b3c6c67 Comment out dump_glyph(): it is unused and, as it is now, breaks compilation.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26068 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-02-22 21:24:35 +00:00
eugeni
fc6600af48 Check glyph bounding box before rasterizing and complain if it is too large.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26067 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-02-22 19:31:53 +00:00
eugeni
b803331d0c Some debugging routines.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26066 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-02-22 19:31:51 +00:00
eugeni
dd8c7c9e2c Better handling of behind-the-camera objects.
Every point that is behind the camera is moved to the clipping plane by
orthographic projection. It is obviously incorrect, but this is a very rare
case, and proper clipping of Bezier curves is not that easy.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26065 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-02-22 19:31:49 +00:00
eugeni
59f43e8231 Print FreeType version in libass init. Makes error logs slightly more helpful.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26064 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-02-22 19:31:47 +00:00
diego
a022eca50c Consistently give all libass multiple inclusion guards a LIBASS_ prefix.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25927 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-01-29 23:25:11 +00:00
diego
fe9ec3ffdd Consistently use uppercase filename as multiple inclusion guard.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25897 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-01-28 01:32:52 +00:00
eugeni
00cce8eb30 Add global ass_force_reload flag.
If it is set, renderer is reconfigured before the next frame.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25841 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-01-23 21:18:30 +00:00
eugeni
eb96cc741e Do not try to guess font metrics based on its bounding box.
It was originally a workaround for fonts with bad ascender/descender values,
but it breaks display of some otherwise valid fonts (bugzilla 987), so
reverted.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25688 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-01-12 02:27:01 +00:00
eugeni
e779ddad56 Fix ass_clear_fonts not deallocating fontdata.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25649 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-01-08 12:45:41 +00:00
eugeni
169e65afd9 No need to reinvent strdup...
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25644 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-01-07 21:06:50 +00:00
eugeni
d2a07a1270 Copy font data to ass_library instead of referencing demuxer-owned memory.
This fixes segfault when fonts are accessed after demuxer has been closed.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25641 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-01-07 14:02:06 +00:00
eugeni
518f4e003c Allow overriding [Script Info] parameters with -ass-force-style option.
Patch by Anton Khirnov, wyskas gmail com.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25610 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-01-05 15:38:46 +00:00
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