Commit Graph

164 Commits

Author SHA1 Message Date
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