Commit Graph

338 Commits

Author SHA1 Message Date
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
eugeni 6f054a0afd Do not use FT_Glyph_Copy with NULL glyphs.
Contrary to the docs, it leaves garbage in *target.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23104 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-24 17:36:03 +00:00
eugeni 9dbd459f7e Deallocate glyphs in a separate loop.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23054 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-21 11:02:49 +00:00
eugeni 2b1fb8c4ef Always deallocate glyphs. Fixes a memory leak.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23053 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-21 10:56:28 +00:00
eugeni 02966ab87d Reset outline glyph cache when configuration changes.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23052 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-21 10:43:19 +00:00
eugeni d5f828f347 Scale camera distance.
Otherwise perspective does not look the same in fullscreen.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23051 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-21 10:42:10 +00:00
eugeni de9f870522 Remove unused variables.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23049 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-20 23:25:30 +00:00
eugeni cd298098af Cosmetics.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23048 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-20 23:23:32 +00:00
eugeni e8b8c0fe0e Allow caching of rotated glyphs.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23047 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-20 23:23:00 +00:00
eugeni 7c281a626d Add shift_[xy] (vector that is added to the glyph before transformation) to
bitmap glyph key. Result of rotation depends on them because of perspective
transformation. They are only set when some rotation take place.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23046 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-20 23:19:23 +00:00
eugeni fda46c092d Fill bitmap_hash_key during parsing stage, call get_bitmap_glyph() much later.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23045 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-20 23:16:29 +00:00
eugeni f3375f1b4d Remove bbox and advance vector from bitmap cache.
They are now available from glyph cache.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23044 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-20 23:14:12 +00:00
eugeni 35cc43696d Store outline_glyph (glyph border) in glyph cache.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23043 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-20 23:13:34 +00:00
eugeni 05739aa046 Cosmetics: reindentation.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23042 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-20 23:12:19 +00:00
eugeni b9809c1e13 Because of the outline glyph cache it is now possible for glyph_info_t to have
both non-zero glyph and bitmap at the same time. In that case, bitmap should
not be generated anew.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23041 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-20 23:11:39 +00:00
eugeni d9741a0278 Make get_*_glyph return void.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23040 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-20 23:10:33 +00:00
eugeni 1c2b174029 Move outline glyph generation to a separate function, using outline glyph
cache.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23039 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-20 23:09:48 +00:00
eugeni 49a99955b7 Oops, fix compilation broken in r23037.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23038 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-20 23:09:06 +00:00
eugeni d2d2e12a3c Collect hit/miss statistic in hash map, and print in -v mode.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23037 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-20 23:06:12 +00:00
eugeni 5b0e4436fc Add outline glyph cache (unused yet).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23036 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-20 23:04:21 +00:00
eugeni 6c412d239b Rename glyph cache to bitmap cache.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23035 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-20 23:02:20 +00:00
eugeni 4408714100 Add generic hash map implementation.
Reimplement both font cache and glyph cache on top of it.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23034 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-20 23:00:30 +00:00
eugeni f7b1538978 A meaningless cosmetic change.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23033 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-20 22:57:55 +00:00
eugeni 36870a2a52 Add perspective projection.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23032 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-20 22:56:42 +00:00
eugeni cf9aff424f Applying transformation matrix to the glyph and the shift vector separately is
incorrect. Instead, it should be applied to translated glyph.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23031 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-20 22:55:28 +00:00
eugeni 3cbdb85046 Cosmetics: reindentation.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23030 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-20 22:51:19 +00:00
eugeni 1a1ba22f93 Disable caching of rotated glyphs.
The following commits will add perspective distortion to the glyphs rotated
with \frx and \fry. Somewhere along the way correct caching of such glyphs
will become impossible, but in the end everything will be fine.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23029 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-20 22:49:48 +00:00
eugeni 67061091c6 Fix a stupid bug in r22473: bbox is zero-filled everytime when a glyph
is found in the cache. This leads to broken karaoke (some glyphs are not
highlighted at all), and, probably, slightly incorrect linebreaks.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22986 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-13 13:46:49 +00:00
eugeni 6b925eca4f Remove unused includes.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22965 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-10 17:54:02 +00:00
eugeni 82072cfec5 Don't check if user-supplied default font path exists.
It is checked in FT_New_Face anyway.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22964 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-10 17:53:41 +00:00
eugeni 79e828c998 Fix lost hard linebreaks in libass by repeating the loop when both soft and
hard linebreaks are about to be added.

Original message:
http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2007-April/050876.html

Patch by Jindrich Makovicka /makovick gmail com/



git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22931 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-07 13:32:51 +00:00
uau 208d4343ef "()" to "(void)" function param list fixes
patch from Stefan Huehner, stefan huehner org


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22904 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-01 21:59:54 +00:00
iive b5da111dd8 Use FT_Glyph_StrokeBorder to render only the outside border.
Workarounds gaps between glyph and glyph border when rendering some fonts with freetype below 2.1.10


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22863 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-03-31 20:58:14 +00:00
diego f65b34684f Remove unnecessary include from CFLAGS.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22606 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-03-15 12:13:35 +00:00
diego 5519d98983 cosmetics: Fix indentation, reorder some lines for consistency.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22549 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-03-13 21:55:23 +00:00
diego 60b39e2786 Give more descriptive names to the source and library variables and split
between common, MPlayer-specific and MEncoder-specific parts.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22546 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-03-13 12:10:57 +00:00
eugeni d96c2d51d9 A function always returning 0 could as well return void.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22475 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-03-06 10:00:53 +00:00
eugeni df5bbaa735 Text alignment should not use bounding boxes of individual glyphs.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22474 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-03-06 09:59:53 +00:00
eugeni 3a14d1c37a Reset advance vector and glyph bounding box if glyph could not be found.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22473 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-03-06 09:31:12 +00:00
eugeni cb9cde3f8c Fix incorrect spacing introduced in r22231:
these two lines were supposed to perform truncation, not rounding.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22419 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-03-03 08:20:00 +00:00
eugeni 5c927f2367 10l: x2scr used twice instead of y2scr.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22415 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-03-02 17:59:19 +00:00
eugeni 83ef3fedab Bugfix: transform origin to screen coordinates.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22414 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-03-02 17:54:47 +00:00
uau 0a02ca6ec3 Fix \a parsing broken in r22291
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22321 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-23 03:08:54 +00:00
eugeni f2daf2d930 Add some missing includes.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22310 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-22 15:48:37 +00:00
eugeni 6177b51841 Oops, forgot {} before "else".
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22300 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-21 09:25:52 +00:00
eugeni 87cb56fa1f Cosmetics: fix indentation.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22294 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-20 17:22:34 +00:00
eugeni a267f03bfa With \t(\b) text becomes bold at the middle of time interval, not at the end
of it like before. The same for \t(\i).


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22293 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-20 17:20:21 +00:00
eugeni b4dac96e5a Any style modifier followed by no recognizable parameter resets to the default.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22291 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-20 17:17:51 +00:00
eugeni 796df56724 \fn without an argument resets font family to the value from style.
Fixes bugzilla #762.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22287 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-20 16:37:18 +00:00
eugeni c8497d4177 Fix display order of events.
Starting time does not matter, it depends on Layer and ReadOrder only.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22286 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-20 16:20:55 +00:00
eugeni 999e603eb7 Both (-1) and 1 mean bold font in SSA/ASS styles.
The same for italics and some other fields.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22281 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-19 20:10:55 +00:00
eugeni 11399e2ac8 Add \t(\b) support.
Contradicts the specification, but supported by all other renderers.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22280 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-19 19:01:45 +00:00
eugeni 2287f5662d Fix bounding box calculation with \fscx/\fscy.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22279 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-19 18:37:54 +00:00
eugeni 3e1dde83ba Fix \fscx/\fscy animation.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22278 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-19 18:31:05 +00:00
eugeni 39c818a551 Correct implementation of text spacing.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22277 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-19 18:01:49 +00:00
eugeni beaa890438 Reallocate event_images_t, removing limit on simultanious events count.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22276 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-19 17:44:29 +00:00
eugeni 885b7a1d4e Restore a minus sign that was lost in r22231.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22239 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-16 23:18:47 +00:00
eugeni fb6a1101ce Implement \frx and \fry (and reimplement \frz) as 3d rotations.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22233 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-16 17:54:47 +00:00
eugeni a2195cd28f Consistently name z-axis rotation angle "frz".
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22232 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-16 17:51:07 +00:00
eugeni 42871d8220 Move conversions between 16.16, 26.6 fixed point and int, double to separate
functions. Some rounding errors are fixed along the way.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22231 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-16 17:49:35 +00:00
eugeni 1400b0f436 Select the first charmap in the font, if FreeType did not autoselect any.
This happens, for example, with fonts only having an Apple Roman charmap.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22228 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-15 22:03:09 +00:00
eugeni 520db0d850 \r resets \frz to style value.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22227 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-15 21:53:28 +00:00
eugeni e802fdf790 Fix \t(\frz) handling.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22226 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-15 21:51:51 +00:00
eugeni 42cfb2bb4d \org(0,0) is different from no \org at all.
Use render_context.have_origin to tell them apart.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22225 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-15 21:50:21 +00:00
eugeni 7c137f48c6 Bugfix: glyph and bitmap pointers could be left uninitialized after
get_glyph().
Based on a patch by Stanislav Maslovski (stanislav d maslovski a gmail d com).


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22063 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-01-29 17:08:29 +00:00
reimar 580dccd5c4 Avoid invalid memory access in ass_process_subtitle for empty subtitles
with sub->lines <= 0


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21853 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-01-07 16:07:45 +00:00
eugeni 896c9c1384 Make -embeddedfonts enabled by default with FontConfig >= 2.4.2.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21648 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-12-17 12:35:12 +00:00
eugeni dd1a5a82c1 Update some comments.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21646 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-12-17 12:00:55 +00:00
eugeni c0358ff255 Cosmetics: fix indentation.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21636 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-12-16 19:35:48 +00:00
eugeni d6ffde2900 Keep reselected fonts in an array, adding new ones to the end. Glyph
lookup prefers earlier opened fonts.

This way glyph lookup is stable, which means that:
 - cache cleanup is never required after font reselecting;
 - a single unrecognized char won't change the appearance of all the others.



git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21635 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-12-16 19:34:00 +00:00
eugeni eba0f2e158 Avoid storing font file path and index in ass_font_t.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21634 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-12-16 19:29:33 +00:00
eugeni 4eb3c3173e Remove a mistakenly committed debug printf.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21633 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-12-16 19:28:21 +00:00
eugeni 624724c001 FT_Set_Transform is fast enough to be called once for each glyph.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21632 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-12-16 19:24:01 +00:00
eugeni 2875decdc4 Avoid "pointer targets differ in signedness" warnings.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21631 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-12-16 19:19:27 +00:00
eugeni db088e936d Move ascender, descender, and kerning computation to ass_font.c.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21630 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-12-16 19:17:50 +00:00
reimar f4b7a0e4d1 Get rid on -DGNU_SOURCE for internal code, imported libs should be fixed
ASAP, too, though


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21604 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-12-12 20:29:30 +00:00
eugeni e15d11c89e Speed up ASS subtitles display by detecting changes between two consecutive
rendering results.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21522 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-12-06 18:44:26 +00:00
reimar e70b5d8500 Also free ass_library_t members in ass_library_done
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21513 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-12-06 10:11:23 +00:00
eugeni 92256c07d1 Open embedded fonts directly from memory.
FontConfig 2.4.2 (released yesterday) supports scanning fonts with
FcFreeTypeQueryFace without writing them to disk. With earlier FontConfig
versions, the old mechanism is used.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21476 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-12-03 18:24:11 +00:00
eugeni 7db61d9736 Keep embedded fonts in ass_library_t and perform actual disk write
in fontconfig initialization. This is required for some fontconfig-related
improvements.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21474 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-12-03 17:59:13 +00:00
eugeni b5a682f0aa Rename: ass_process_font -> ass_add_font.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21471 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-12-03 17:35:40 +00:00
eugeni 985d92c189 Avoid calling validate_fname() twice for one string.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21469 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-12-03 16:10:23 +00:00
eugeni 9fdb13fd53 If a glyph is not found in the current font, switch to another one.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21367 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-28 22:50:02 +00:00
eugeni a4d33dbb47 Skip glyphs with char code < 0x20.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21366 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-28 22:44:40 +00:00
eugeni 2dbaab9320 Add FT_Library to ass_font_t.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21365 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-28 22:20:24 +00:00
eugeni 27ebb01514 Use (ass_font_t, char code) instead of (FT_Face, glyph index) to identify
glyphs in cache.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21364 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-28 22:17:33 +00:00
eugeni edc6501697 Don't include freetype headers in other headers.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21339 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-27 17:56:49 +00:00
eugeni 07786c1275 Fix compilation broken in previous commit.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21338 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-27 17:53:33 +00:00
eugeni 65dbd03fed Move ass_font_desc_t and ass_font_t declarations to ass_font.h.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21337 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-27 17:50:05 +00:00
eugeni f356ada7fb Cosmetics: reindent.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21336 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-27 17:34:47 +00:00
eugeni 42e4745f17 Don't call FT_Set_Transform/FT_Set_Pixel_Sizes if values have not changed.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21335 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-27 17:33:59 +00:00
eugeni 6e9a5a842c Move ass_font_t allocation to ass_font.h.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21333 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-27 17:13:52 +00:00
eugeni 84d0512e5b Initialize font size with 0.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21330 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-27 16:21:10 +00:00
eugeni b11cd1d856 Remove obsolete "no_more_font_messages" hack.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21295 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-26 22:53:52 +00:00
eugeni 1cbd5dfd31 Move fonts-related code to a separate file.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21293 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-26 22:49:27 +00:00
eugeni 4d27dbd5c9 Make ass_new_font return ass_font_t struct (instead of just FT_Face).
Use it to access the font face.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21283 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-26 20:53:29 +00:00
eugeni 004c19b520 Move ass_font_t to header.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21282 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-26 20:38:06 +00:00
eugeni 85fb960769 Rename:
face_desc_t -> ass_font_desc_t
face_cache_item_t -> ass_font_t
*face* -> *font*


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21281 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-26 20:34:54 +00:00
diego dc2be42703 Merge common parts of all Makefiles into one file included by all.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21275 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-26 18:12:36 +00:00
diego 8f167fc5c5 SRCS should be one per line to make patches more readable.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21229 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-25 17:06:08 +00:00
diego b0e412cc9c Remove pointless indirection.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21227 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-25 17:02:52 +00:00
diego 27b0177662 Remove superfluous comment.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21222 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-25 16:12:36 +00:00
eugeni bec3287bd4 Cosmetics: remove unneeded curly brackets.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21114 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-20 17:13:19 +00:00
eugeni 852e37033b Fix collision detection. The old method tried to avoid gaps between subtitles
by moving the upper subtitle down. This is wrong. With this fix, a subtitle
will be moved only if it overlaps with another one.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21113 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-20 17:10:18 +00:00
diego cf4bf03dc2 Unify dep/depend targets.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21096 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-20 11:18:01 +00:00
kraymer 598d5be3ad MSGTRs for libass
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21082 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-19 22:35:17 +00:00
eugeni 8856d67d40 Collect all includes of mplayer headers in libass in a single file (mputils.h).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21042 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-19 00:41:00 +00:00
eugeni 656bde87fa Support \t with acceleration.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20891 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-13 16:49:32 +00:00
eugeni 4a27cb5876 Partial fix for semitransparent glyph outlines.
This fix removes semitransparent area (less then pixel width) between glyph and
it's outline. Instead, it makes them overlap a little. It usually looks much
better this way.
Complete fix seems impossible with the current output format (single color
alpha bitmaps). The right way is to blend both glyph and outline into one
bitmap so that 2 pixels with 50% transparency produce a fully solid one.
This requires RGBA bitmap output from libass.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20890 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-13 16:35:15 +00:00
eugeni 60d29dbd71 s/break/continue/. A crazy mistake, somehow unnoticed for more that 2 months.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20795 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-08 18:57:40 +00:00
eugeni ff4a1ad4a9 Bugfix: when copying ass_force_style_list, ending 0 was left out.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20738 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-06 20:09:28 +00:00
eugeni c8b995cf2f Calculate text bounding box in a way that does not depend on actual glyph
bitmaps. Each glyph is considered to be bounded by (origin, origin + advance)
horizontally, and (max font ascender, max font descender) vertically.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20734 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-06 02:47:57 +00:00
eugeni aca2396794 Initialize fontconfig in VFCTRL_INIT_EOSD handler.
Recent libass api changes moved fontconfig initialization to filter's
config() function. It is bad, because cache update can take a long time,
resulting in unpleasant sound effects. This change restores the original
behaviour.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20722 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-05 18:56:31 +00:00
eugeni 0a8d19b293 Cosmetics: indentation fix.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20718 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-05 18:21:39 +00:00
eugeni f78a3783e5 Fix the following compiler warnings:
ass.c:999: warning: unused variable 'i'
ass.c:1041: warning: pointer targets in assignment differ in signedness
ass.c:1043: warning: pointer targets in assignment differ in signedness


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20714 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-05 17:26:55 +00:00
eugeni a5c1f03baa More precise bounding box calculation for karaoke effects.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20669 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-04 17:58:09 +00:00
eugeni 46afb40907 Prefer microsoft-specific charmaps to all other.
There are some fonts with both 'Unicode' and 'Microsoft/Unicode'
charmaps, and the second always seems to be the right choice.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20653 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-03 23:11:00 +00:00
eugeni 6fef7a200f Introduce MSGT_ASS, use it for all libass messages.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20645 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-03 18:15:33 +00:00
eugeni 593e642133 Implement loading subtitles from memory.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20619 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-03 02:15:08 +00:00
eugeni 452d1d6c61 Bugfix: sub_recode could deallocate global sub_cp under some circumstances.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20618 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-03 01:41:48 +00:00
eugeni ef5dee5d56 Revert r20517.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20519 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-10-29 17:29:55 +00:00
eugeni 978061ad27 Move ass_library initialization code to ass_mp.c.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20518 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-10-29 15:26:13 +00:00
eugeni 06758d89bc Copy the following functions to libass to avoid dependency on the rest of mplayer:
guess_buffer_cp
utf8_get_char
blur



git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20517 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-10-29 15:03:30 +00:00
eugeni 7e9c778cf2 Fix width -> orig_width typo.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20513 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-10-29 13:59:36 +00:00
eugeni 572576eb67 Don't set PlayResX for plaintext subtitles.
This way font proportions will not depend on frame aspect.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20512 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-10-29 13:58:30 +00:00
eugeni 870ed1a164 Add \N at the end of each subtitle line when converting from subdata.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20511 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-10-29 13:52:51 +00:00
eugeni efea99c2c9 Libass interface reworked:
- ass_instance_t renamed to ass_renderer_t
- ass_library_t introduced
- use of mplayer-specific global variables limited to ass_mp.c


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20493 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-10-28 15:07:18 +00:00
reimar ef45c3167f If HAVE_FONTCONFIG is not defined, font_fontconfig might be declared both
extern and static, causing compilation to fail


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20485 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-10-28 10:21:30 +00:00
eugeni 4d268b94d7 Add missing fontconfig_done() call.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20467 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-10-27 16:02:44 +00:00
eugeni e8733cbf9d Split ass_configure() into several smaller functions.
FontConfig initialization moved from ass_init() to ass_set_fonts().


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20462 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-10-26 20:08:46 +00:00
eugeni 08d9c0718a Don't forget to apply scaling coefficients to kerning values.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20326 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-10-20 23:06:52 +00:00
eugeni a4a817a15f Fix center of rotation calculation. It was overly complex and
incorrect for right- and center-aligned text.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20308 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-10-19 18:08:44 +00:00
eugeni 7abe5a4ef8 Center of rotation depends on alignment.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20302 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-10-18 21:19:51 +00:00
eugeni 2d3ad59854 Support separate rotation angle for each glyph.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20301 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-10-18 21:11:29 +00:00
eugeni 5b5798f039 Move base point calculation to a separate function. Will be reused soon.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20300 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-10-18 18:33:19 +00:00
eugeni 67232605ef Cosmetics: remove commented code.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20299 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-10-18 17:57:00 +00:00
eugeni 6d4ad204b2 Fix a typo in collision detection code.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20297 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-10-18 15:52:26 +00:00
eugeni 28ecbe3cc3 Remove an outdated debug message.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20275 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-10-16 19:02:11 +00:00
reimar 404c75b083 Fix crash because of last_glyph < first_glyph, probably caused by first line
only consisting of '\n'


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20232 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-10-15 13:03:43 +00:00
eugeni 47006b0d7d Zerofill libass static variables during initialization.
Patch by Jindrich Makovicka <makovick a gmail d com>.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20208 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-10-14 14:42:23 +00:00