summaryrefslogtreecommitdiffstats
path: root/libass
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #26 from wm4/warningsGrigori Goronzy2014-01-242-8/+11
|\ | | | | Use more warning flags
| * build: add more warningswm42014-01-241-1/+3
| |
| * ass_strtod: use modern Cwm42014-01-241-7/+8
| |
* | Attempt to make code more readablewm42014-01-251-9/+11
| | | | | | | | No more double pointer dereferencing.
* | Append new cache items at the start of the collision list11rcombs2014-01-251-2/+2
| | | | | | | | | | | | | | The idea is that more recently-added cache items are more likely to get hits. Signed-off-by: wm4 <wm4@nowhere>
* | Simplify hash function11rcombs2014-01-251-7/+4
| | | | | | | | | | | | | | | | | | We can rely on fast multiplication and good compilers. v2: use default FNV-1a prime Signed-off-by: wm4 <wm4@nowhere> Signed-off-by: Grigori Goronzy <greg@chown.ath.cx>
* | fontconfig: don't compact the sorted font listOleg Oshmyan2014-01-241-1/+1
| | | | | | | | Some broken fonts are dropped by Fontconfig during compacting.
* | Start \k, \ko at exact start time, not right after itOleg Oshmyan2014-01-241-1/+1
|/
* Remove some ass_msg() callswm42014-01-243-38/+6
| | | | | | | These aren't very useful for debugging due to the high volume of the log output in problem cases. In fact, all they do is making the code slower (the message callback can easily appear in the profiler output, even if the callback doesn't actually print the messages).
* Allocate track array exponentiallywm42014-01-241-2/+1
| | | | This reduces the frequency of reallocations.
* Fix \fade corner casesOleg Oshmyan2014-01-151-9/+14
| | | | | | | | Times in \fade(,,,-1,fadein,fadeout,-1) are interpreted as in \fad(fadein,fadeout). Make sure we check the times in the same order as VSFilter in case they are not sorted.
* Fix \t corner casesOleg Oshmyan2014-01-151-20/+17
| | | | | The end time is reset to line duration if and only if it is zero. Negative accelerations are allowed (and can cause overflow later).
* Don't ignore trailing empty lineOleg Oshmyan2014-01-151-4/+5
| | | | | Trailing \N is effectively ignored, but \N\N should still yield an empty line.
* Fix missing pointer dereference in 1636a551Oleg Oshmyan2014-01-141-1/+1
|
* Do not reset \pbo and \p values after each drawingOleg Oshmyan2014-01-083-8/+10
| | | | Confirmed with VSFilter. This complements the previous commit.
* Terminate drawings on {Oleg Oshmyan2014-01-081-7/+8
| | | | | This brings us in line with VSFilter and also fixes Google Code issue #101.
* shaper: disable ligatures for non-zero \fspOleg Oshmyan2014-01-081-7/+20
|
* Distinguish cached glyphs with different hspacing when border_style == 3Oleg Oshmyan2014-01-082-0/+8
| | | | hspacing affects opaque box borders.
* Fix \fsp: use orig_scale_x, not post-fix_glyph_scaling scale_xOleg Oshmyan2014-01-081-1/+1
|
* Don't try to remove end-of-line \fspOleg Oshmyan2014-01-081-4/+0
| | | | | | | | VSFilter does not do this. The code being removed was already buggy: i > 0 should have been "got any non-skipped glyphs since last_break?", and hspacing should have been taken from glyphs[i-1].
* Fix \pboOleg Oshmyan2014-01-081-7/+5
| | | | | | | | | | | | | | b61d260b attempted to add support for \p scaling to \pbo. However, while it fixed the exact sample originally reported, it broke \pbo with other \p values, including \p1, by confusing the direction of scaling and the units in which \pbo is measured. In addition, the descenders assigned to drawings have always had a wrong sign, causing lines that contain drawings with \pbo to be shifted in the wrong direction: negative \pbo raised bottom- aligned lines, while positive \pbo lowered top-aligned lines. All errors and fixes have been confirmed with VSFilter.
* Scale distance to screen plane like blur radiusOleg Oshmyan2014-01-081-1/+2
| | | | | VSFilter forgets to scale this distance, just like it forgets to scale blur radius.
* Accept colors with arbitrary sequences of leading & and HOleg Oshmyan2014-01-071-1/+5
|
* A whole bunch of parsing and default value fixesOleg Oshmyan2014-01-073-119/+124
| | | | Obtained by reading the xy-VSFilter source code.
* Fix \fs+ and \fs-Oleg Oshmyan2014-01-071-2/+2
| | | | The argument is a relative amount. The unit is: \fs+1 = +10%.
* Stop animating \b and \iOleg Oshmyan2014-01-071-12/+8
| | | | Unlike what the cc635086 message says, VSFilter does not animate them.
* Stop misparsing and add support for \fscOleg Oshmyan2014-01-071-0/+4
|
* Support fractional \org argumentsOleg Oshmyan2014-01-071-4/+4
|
* Parse Angle overrides as floating-point numbersOleg Oshmyan2014-01-071-1/+1
| | | | This complements 5903771e.
* shaper: actually correctly handle @font advanceOleg Oshmyan2014-01-071-6/+11
| | | | | | | | | | The code was confusing glyph index and Unicode codepoint. 256df617 attempted a fix but merely moved the wrong code. Fixes Google Code issue #94. Vertical ligatures are possibly still broken, but horizontal ligatures and non-ligatures are correct now.
* Don't forget to apply \be to the last row/columnOleg Oshmyan2013-12-171-0/+4
|
* Fix mismatched/out-of-bounds accesses in vertical \blurOleg Oshmyan2013-12-171-2/+2
|
* Speed up \blur table generationOleg Oshmyan2013-12-121-7/+11
| | | | Based on xy-VSFilter commit 54391d3a.
* Improve blur quality: use volume 65536 and initialize left columnOleg Oshmyan2013-12-121-36/+34
|
* Fix compilation with VC++ 2013Thomas Goyne2013-12-121-47/+32
| | | | | | | | | | | For whatever reason FT_Vector points[4] = { ... }; needs to come at the beginning of a scope. Since that block was duplicated, just extract it to a function. This does not include buildsystem support, so actually compiling with VC++ requires creating a project and supplying a config.h file. Signed-off-by: wm4 <wm4@nowhere>
* Added ass_font_index_magic to fix char indexes in weird encodings11rcombs2013-12-063-10/+26
|
* Try to make really weird looking macro mess more understandablewm42013-11-261-9/+23
| | | | The "if (0) { // cool ;)" is just mindblowing.
* Add ass_library_version()wm42013-11-252-1/+13
| | | | | | Based on the patch by chadr123. See google code issue #113.
* Reset text origin on \fay changes for VSFilter compatibilitywm42013-10-241-2/+9
| | | | | | | | | | | | | | | | | | | | Comparing this rendering of this line: {\fnTahoma\c&H000000&\fs100\an7\fay0.115\pos(240,250)}——————–>{\fay0.0}——> To this line: {\fnTahoma\c&H000000&\fs100\an7\fay0.0\pos(240,250)}——————–>{\fay0.0}——> The second arrow is in the same place for both lines when using VSFilter, but the origin of the second shear is different when using libass. After every change in \fay or a newline, the vertical offset resets to 0. Fixes issue #80. Bug report and patch by BwackNinja (BwackNi...@gmail.com) (this commit corresponds to the patch issue_80_3.patch)
* Update version infoGrigori Goronzy2013-10-141-1/+1
|
* Don't rely on events being sorted in ass_step_sub()wm42013-10-071-19/+31
| | | | | | | | | | | | ass_step_sub() assumed that the subtitle event list was sorted by event start time, but that is not guaranteed. Making the list sorted is not an option. (At least for now - too many issues are in the way to get such a change being done.) Fix this function so that it works with an unsorted event list. Semantics regarding corner cases might be slightly different, such as what happens if the now parameter coincides with event start/end, or behavior with overlapping subtitles.
* ass_shaper: changing scale_x/y starts a new glyph runwm42013-09-261-0/+2
| | | | | Since font_size is usually normalized to 256, scale_x/y has to be used for this purpose.
* Cosmetics: remove repetitionwm42013-09-261-38/+35
|
* Fix Hinting againwm42013-09-263-29/+49
| | | | | | | | | | | | Commit 05eb520 missed some duplicated bits in ass_shaper.c. <wm4> oh crap <zgreg> oh crap indeed Instead of duplicating the logic in ass_shaper.c, just change the glyphs before they even get into processing. This way, all code reading the font size etc. is affected. This essentially reverts commit c207000c, because it's not needed anymore.
* Skip both newline and carriage return.Reimar Döffinger2013-09-251-3/+5
| | | | | | | | '\r' characters weren't skipped correctly. SKIP_SYMBOL from original patch renamed to IS_SKIP_SYMBOL. Signed-off-by: wm4 <wm4@nowhere>
* Restore hintingwm42013-09-242-3/+17
| | | | | | | | | | | | | | | | | | | This was broken since commit f780146. For reasons why, read the commit message of that commit. To make it short, we set the font size to something large and constant (256), and scale the font outlines returned by freetype to the size we need in order to get smooth animation and accurate positioning. Of course, this obviously breaks hinting. Fix hinting by not using the hack mentioned above if hinting enabled. To mitigate the issues caused by freetype grid fitting and extremely bad ASS scripts (such as setting font size to very small values and scaling them up with \fscx/y), we still adjust the font size such that the font is never scaled in Y direction (only in X direction, because the \fscx/y tags can change aspect ratio). Also see google code issue #46.
* enca: fix memory leakwangkun2013-09-241-0/+5
|
* Fix fribidi include pathwm42013-07-172-3/+1
| | | | | The old include statement works only by coincidence, and will actually break the build on certain setups.
* Document insane (xy-)vsfilter color semanticswm42013-07-061-13/+67
|
* Fix OS/2 usWinDescent/usWinAscent for quirky fontsGrigori Goronzy2013-07-061-3/+4
| | | | | | | | Some fonts stuff a signed, negative value into this unsigned field. This usually causes very small and wrongly positioned rendering. Also handle usWinAscent similarly, just in case. Fixes issue #106.
* Don't mutate input buffer for ass_read_memory()wm42013-06-231-4/+11
| | | | | | | | | | | | | | | Fixes google code issue #88. process_text() garbles the memory as the text is parsed. This also fixes that the user provided buffer implicitly had to be null terminated. This wasn't obvious, because the caller passes in the buffer length. libass ignored the buffer length (unless a codepage was provided and iconv was enabled), and happily read past the end of the buffer. It would be much nicer if the parsing code would be fixed, instead of just copying the input buffer. Maybe one day.
* Remove unused variableswm42013-06-222-7/+1
|
* Allow different ASS_Library for ASS_Track and ASS_Rendererwm42013-06-221-3/+0
| | | | | | | | | | | Remove the explicit check whether the ASS_Track and ASS_Renderer were created from the same ASS_Library object. Logging will not be entirely consistent (some log messages go to the ASS_Track library when rendering), but otherwise it works. ASS_Library also contains embedded fonts added with ass_add_font(). It looks like the renderer will use the fonts from the ASS_Renderer library object.
* Parse style names like VSFilter doesOleg Oshmyan2013-06-222-9/+21
| | | | | | Trim '*' from the start of style name fields of Style and Dialogue lines and normalize the case of "Default" in the style name field of Dialogue lines.
* Fix \r style lookupOleg Oshmyan2013-06-223-1/+22
| | | | | Make \rSTYLENAME with an invalid STYLENAME fall back to line style rather than to Default. This fixes issue #104.
* Fix blur scalingwm42013-06-221-0/+2
| | | | | | | | | Commit 0e1702ad7a6a827d "Add ass_set_storage_size and fix related scaling issues" attempted to fix blur scaling. This breaks blur scaling for players which don't call ass_set_storage_size(). This commit reverts the default behavior to the old behavior. The behavior when ass_set_storage_size() is called should be unchanged.
* Improve font mismatch messagewm42013-06-221-5/+12
| | | | | | | | | | | | | | | | | | | | | | | Example for an old message: [ass] fontconfig: Selected font is not the requested one: 'DejaVu Sans' != 'Wingdings' it was hard to tell which was the selected and the requested font. Also, it's not really clear what's the problem at all. Why would it select a different font? Obviously, the issue is that it can't find the font in the first place. Now it prints: [ass] fontconfig: cannot find glyph U+006C in font 'Wingdings', falling back to 'DejaVu Sans' Or if the code parameter for select_font() is 0: [ass] fontconfig: cannot find font 'Wingdings', falling back to 'DejaVu Sans' I'm not sure if this message is really accurate in all cases. It's possible that there are more reasons for failure. But all things considered, this should be easier to understand.
* Allow building as DLL on Windowswm42013-06-111-1/+1
| | | | Patch by jon_y on IRC.
* fontconfig: remove default "lang" setting from patternsUoti Urpala2013-05-141-0/+8
| | | | | | | | | | | | | | Fontconfig defaults set the "lang" value in patterns, and it then prefers fonts which are listed as supporting this language. The default value may not match actual script language, and even a setting of "en" for English subtitle can cause problems. Remove the "lang" setting from patterns used to find fonts. A file had a normal and an oblique version of the same font attached, with different character set coverage: the normal version lacked some non-ascii characters that fontconfig includes in its list of characters required for English support. As a result, the oblique version was picked for what was supposed to be normal text.
* Clip tag arguments are not optionalwm42013-04-121-2/+2
| | | | | | | | | | | | | | | This fixes: {\clip(1,1,20,20)\clip\alpha&H1E&\c&HC7E5C0&}X libass tries to interpret the second \clip, which has no arguments. Since the parsing code doesn't require a starting '(', the parser will skip over the other tags (treating them as junk) and interpret the numbers that happen to be in the rest of the string. The result is a bogus drawing command, which happens to rasterize an extremely wide glyph, which takes several seconds to finish. Make the '(' required. Neither the aegisub manual nor the vsfilter source code have any indication that \clip without starting '(' is allowed, so this should not break anything.
* Bump LIBASS_VERSIONwm42013-04-121-1/+1
| | | | The ABI was broken and a new API function were introduced.
* Ignore junk in nested \t tagswm42013-03-311-3/+2
| | | | | | | | | | | | | | | | Normally, junk between tags is ignored. But unlike vsfilter, libass doesn't do that inside \t tags. So the following fails and will never actually switch the color: {\t(1000,1000,(\c&HFF0000&))} (The '(' and ')' are junk, and are not covered by any ASS documentation.) Instead expecting that the last parameter to \t (the parameter that takes nested tags) starts with '\', turn it around and assume that the first parameter that's not a number is the last parameter. (This parsing is kind of awkward because we don't do any lookahead.) Likewise, let the nested tag parsing terminate on ')' instead of checking whether a tag is started with '\'. This allows skipping junk in the middle of the nested tag, without terminating too early. (Check '}' and '\0' in case the tag is not properly terminated.)
* Add ass_set_pixel_aspect(), deprecate ass_set_aspect_ratio()wm42013-03-293-11/+58
| | | | | | | | | | | | ass_set_aspect_ratio() is confusing, because it takes a DAR and SAR value, while libass just needs a single pixel aspect ratio. Introduce ass_set_pixel_aspect(), which sets the pixel aspect ratio directly. ass_set_aspect_ratio() is considered deprecated. There's no reason to remove it, but hopefully directing users to ass_set_pixel_aspect() will make for a simpler API. Improve the doxygen and document what ass_set_margins() actually does.
* Don't overwrite user-defined aspect ratio settingswm42013-03-294-19/+28
| | | | | | | | | | | | | | | | | | | | | ass_set_storage_size() overwrote the user-defined aspect ratio set with ass_set_aspect_ratio(). Change it so that if ass_set_aspect_ratio() is used, the ass_set_storage_size() parameters are not used for any aspect ratio calculations. (The storage size is still used for calculating the blur scale.) This simplifies the code as well, because the aspect ratio is now centrally calculated in ass_start_frame(). Update the doxygen. Make it clear that ass_set_storage_size() will be used for aspect ratio calculation, unless ass_set_aspect_ratio() is used. Also mention what libass actually does with the dar and sar parameters: it uses them to calculate a pixel aspect ratio, nothing else. Explicitly allow resetting the storage size with w=h=0. Document that it's allowed to remove the user defined aspect ratio by setting a pixel aspedct ratio of 0. See issue 6.
* Fix crazy VSFilter behavior for \move tagwm42013-03-201-1/+9
| | | | Fixes issue 90 (both cases).
* Add type field to ASS_Image structwm42013-03-202-9/+20
| | | | Patch by chrisburel, posted on Google code issue 31.
* shaper: proper script/language handlingGrigori Goronzy2013-03-043-6/+179
| | | | | | | | | | | | | | | | | | | | | Determine script for each character and use this as an additional property for splitting up the text into runs. Characters of Common or Inherited script assume the script of the preceding character. If that is not possible (First character(s) in a run are Common/Inherited, for instance), a backwards scan is done so they can assume the script of the following character. Additionally, determine default language in case no override is set. This simply maps a language to a script, if a language exists that is mostly representative for a given script. Pango's mapping has been adapted. This helps with fonts that don't have OpenType features set up for default script/language pairs. It's also considered to be right approach by most people, and might help with correct OpenType rendering in some other cases. Fixes issue 85.
* shaper: correctly handle @font advanceGrigori Goronzy2013-03-031-3/+6
| | | | | | The code was confusing glyph index and unicode codepoint index. Fixes issue 94.
* Support reading the YCbCr Matrix headerOleg Oshmyan2013-03-034-0/+58
| | | | | | | | | | | | The value is parsed and stored as an enum constant that the consumer can read from ASS_Track. All output images are still plain RGB, and the consumer is expected to perform its own co