]> granicus.if.org Git - libass/log
libass
9 years agodirectwrite: add missing memory release in case of failure
Stephan Vedder [Sun, 24 May 2015 17:31:23 +0000 (19:31 +0200)]
directwrite: add missing memory release in case of failure

9 years agodirectwrite: release localizedStrings
Stephan Vedder [Sat, 23 May 2015 20:43:57 +0000 (22:43 +0200)]
directwrite: release localizedStrings

9 years agodirectwrite: fix error handling in font scanning
Stephan Vedder [Sat, 23 May 2015 12:06:54 +0000 (14:06 +0200)]
directwrite: fix error handling in font scanning

Fix that a single broken font could mess up the entire font scanning.

9 years agodirectwrite: use standard malloc
Grigori Goronzy [Sat, 23 May 2015 11:21:41 +0000 (13:21 +0200)]
directwrite: use standard malloc

9 years agodirectwrite: add 'width' attribute
Grigori Goronzy [Sat, 23 May 2015 11:20:55 +0000 (13:20 +0200)]
directwrite: add 'width' attribute

This is required for proper font matching.

9 years agodirectwrite: wire up destroy callbacks
Grigori Goronzy [Sat, 23 May 2015 11:20:14 +0000 (13:20 +0200)]
directwrite: wire up destroy callbacks

9 years agodirectwrite: cache FontFileStream
Grigori Goronzy [Sat, 23 May 2015 11:12:43 +0000 (13:12 +0200)]
directwrite: cache FontFileStream

Extract a function to set up FontFileStream and store it in a newly
introduced private struct. Fix memory management as well.

9 years agodirectwrite: add initial fontselect implementation
feliwir [Tue, 19 May 2015 09:46:37 +0000 (11:46 +0200)]
directwrite: add initial fontselect implementation

Incomplete, leaks memory, but capable of rendering something.

9 years agoChanged configure.ac to work with c++ files
feliwir [Tue, 19 May 2015 09:47:51 +0000 (11:47 +0200)]
Changed configure.ac to work with c++ files

9 years agoCompile the check with the g++ compiler now
Stephan Vedder [Mon, 18 May 2015 20:55:28 +0000 (22:55 +0200)]
Compile the check with the g++ compiler now

9 years agoAdded directwrite check
Stephan Vedder [Mon, 18 May 2015 20:21:05 +0000 (22:21 +0200)]
Added directwrite check

9 years agofontselect: fix NULL dereference
Stefano Pigozzi [Tue, 29 Apr 2014 19:58:49 +0000 (21:58 +0200)]
fontselect: fix NULL dereference

Apparently on some broken fonts, FreeType can return a NULL family name. Avoid
to crash in these cases.

9 years agoProvisional support for libiconv
Grigori Goronzy [Tue, 25 Feb 2014 01:33:40 +0000 (02:33 +0100)]
Provisional support for libiconv

9 years agoFix compiler compatibility
Grigori Goronzy [Tue, 25 Feb 2014 01:33:04 +0000 (02:33 +0100)]
Fix compiler compatibility

9 years agoFix warnings
Grigori Goronzy [Mon, 24 Feb 2014 19:29:11 +0000 (20:29 +0100)]
Fix warnings

9 years agofontselect: expose a fontprovider listing API
Stefano Pigozzi [Fri, 13 Dec 2013 07:14:43 +0000 (08:14 +0100)]
fontselect: expose a fontprovider listing API

This allows client code to query libass for the font providers it was compiled
with. It can be useful for clients so that they can show selection interfaces
to their users.

9 years agofontselect: expose a fontprovider selection API
Stefano Pigozzi [Tue, 10 Dec 2013 17:45:54 +0000 (18:45 +0100)]
fontselect: expose a fontprovider selection API

Allow the user of libass to select the font provider from ass_set_fonts. This
API change actually doesn't break client code which was passing `fc=1`; now
the same value will autodetect a usable font provider.

Also add an api to list available font providers as that is useful for client
code to show drop down menus with a font provider to choose from.

9 years agofontselect: use fallback fonts when querying font providers
Stefano Pigozzi [Mon, 9 Dec 2013 18:09:09 +0000 (19:09 +0100)]
fontselect: use fallback fonts when querying font providers

51f9e80b added a MatchFontsFunc callback which allows to lookup font names
directly on the font provider. This approach broke support for font fallback
which worked only with lookups from libass in-memory font database.

This commit moves the font fallback code in the font lookup function, so that
it is available for all font providers.

9 years agocoretext: fix conversion from CFStringRef to utf8 buffer
Stefano Pigozzi [Fri, 6 Dec 2013 17:36:24 +0000 (18:36 +0100)]
coretext: fix conversion from CFStringRef to utf8 buffer

The code incorrectly assumed that the utf8 characters could always be
represented with only one byte. This commit queries CFStringRef instances for
the actual amount of bytes needed.

9 years agocoretext: also lazy load fonts based on Family and PostScript names
Stefano Pigozzi [Thu, 5 Dec 2013 18:07:02 +0000 (19:07 +0100)]
coretext: also lazy load fonts based on Family and PostScript names

Previously, the lazy load of fonts was only using display name. Also use the
other names available through the CoreText API (FamilyName and PostScriptName).

9 years agofontselect: coretext: allow to match fontname using the provider
Stefano Pigozzi [Sat, 2 Nov 2013 21:01:37 +0000 (22:01 +0100)]
fontselect: coretext: allow to match fontname using the provider

Not all APIs cache everything the same way that fontconfig does. This allows
to first perform a match based on the font name and then score the matched
fonts using the common code using and in memory database approach.

The benefit is the application doesn't have to load all of the fonts and
query for weight, slant, width, path and fullnames.

I left both code paths inside ass_coretext.c. This allows to test matching
problems and have a term of comparison with the slower implementation.
To activate it one just has to flip the CT_FONTS_EAGER_LOAD define to 1.

Here are some benchmarks with a pretty typical OS X font library of ~600 fonts
and using Libass's test program to load a script with 'Helvetica Neue':

CT_FONTS_EAGER_LOAD=0
0.04s user 0.02s system 79% cpu 0.081 total

CT_FONTS_EAGER_LOAD=1
0.12s user 0.06s system 44% cpu 0.420 total

9 years agofontselect: coretext: allow selection based on PostScript name
Stefano Pigozzi [Sat, 2 Nov 2013 11:07:07 +0000 (12:07 +0100)]
fontselect: coretext: allow selection based on PostScript name

Up until now fontselect used the face index to identify which font to load
from a font collection. While this pretty convenient when using something
freetype based like fontconfig, it seems to be somewhat freetype specific.

CoreText uses the PostScript name as the unique identifier of a font. This
commit allows to use that instead of the index to decide which face to open
with FT_New_Face. To use the PostScript name the provider must return a -1
index and the PostScript name.

9 years agofontselect: implement a coretext font provider
Stefano Pigozzi [Fri, 1 Nov 2013 14:44:25 +0000 (15:44 +0100)]
fontselect: implement a coretext font provider

Fontconfig is known to be very slow on OS X and Windows, this has to do with
the extremely prohibitive cache times (which are getting even longer with
latest versions of Fontconfig).

This commits starts to address the problem by using CoreText on OS X to load
the font data. The commit uses the simplest possible approach to load all of
the data in memory and then use it to match. This causes a somewhat slow
startup time (around ~400ms on my i7) but it is already better than waiting
*minutes* for Fontconfig to cache the fonts data.

A later commit will improve the speed of the match by using a hybrid approach
that lazy loads in the libass database only the necessary fonts.

9 years agoAdd todo comments
Grigori Goronzy [Tue, 18 Oct 2011 14:28:51 +0000 (16:28 +0200)]
Add todo comments

9 years agoSupport multiple font family names
Grigori Goronzy [Sun, 4 Sep 2011 13:54:38 +0000 (15:54 +0200)]
Support multiple font family names

Some fonts use localized family names, especially CJK fonts, which
often have English and Japanese or Chinese names. Handle these cases
just like full names.

9 years agonit: add width to font_info_dump
Grigori Goronzy [Sun, 4 Sep 2011 13:33:09 +0000 (15:33 +0200)]
nit: add width to font_info_dump

9 years agoAdd support for font width property
Grigori Goronzy [Sat, 3 Sep 2011 13:20:00 +0000 (15:20 +0200)]
Add support for font width property

Add a width field to metadata. This is used for sorting fonts as
well. Fixes wrong matches with different width variants in the same
font family.

9 years agoUse streamed access for memory fonts
Grigori Goronzy [Wed, 24 Aug 2011 12:23:01 +0000 (14:23 +0200)]
Use streamed access for memory fonts

This is faster in many cases, and more suitable for Windows' GetFontData
function.

9 years agoPass family name as path for memory fonts
Grigori Goronzy [Mon, 22 Aug 2011 04:30:37 +0000 (06:30 +0200)]
Pass family name as path for memory fonts

This is a bit nicer because we can actually see which physical font
has been selected for a certain logical font.

9 years agoExport font provider interface
Grigori Goronzy [Sat, 20 Aug 2011 16:19:25 +0000 (18:19 +0200)]
Export font provider interface

Add wrapper to the ASS_Renderer to create a font provider from
its internal font selector and shuffle some code around to export
everything that's needed for font providers to the public. Document
font provider functions.

9 years agoMemory font support
Grigori Goronzy [Sat, 20 Aug 2011 15:46:03 +0000 (17:46 +0200)]
Memory font support

Allow memory fonts with the get_face_data callback. This feature is
used for embedded fonts, but can be used by any font provider.

9 years agoMake sure font path is valid
Grigori Goronzy [Fri, 19 Aug 2011 03:23:26 +0000 (05:23 +0200)]
Make sure font path is valid

We do not support memory-based fonts yet, so a path is mandatory.

9 years agoFix weight validity check
Grigori Goronzy [Fri, 19 Aug 2011 03:05:55 +0000 (05:05 +0200)]
Fix weight validity check

9 years agoFree a provider's fonts when it is freed
Grigori Goronzy [Fri, 19 Aug 2011 03:03:45 +0000 (05:03 +0200)]
Free a provider's fonts when it is freed

When a provider is freed, iterate the font database, free all fonts
that belong to that provider and compact the database afterwards.

9 years agoAdd convenience defines for slant values
Grigori Goronzy [Fri, 19 Aug 2011 02:36:05 +0000 (04:36 +0200)]
Add convenience defines for slant values

There is no standard scale for slant. This is almost a boolean
attribute. However, a font can have a real italic variant, and/or a
simple oblique variant. fontconfig's notation supports both of these,
so it makes sense to reuse that notation for the sake of flexibility;
we might need to differentiate between them.

9 years agooops: remove debug output
Grigori Goronzy [Thu, 18 Aug 2011 23:27:21 +0000 (01:27 +0200)]
oops: remove debug output

9 years agoCheck weight and slant validity in font provider
Grigori Goronzy [Thu, 18 Aug 2011 23:24:13 +0000 (01:24 +0200)]
Check weight and slant validity in font provider

When adding a new font, check that weight and slant are valid. If
they're not, use reasonable defaults.

9 years agoUse TrueType font weight scale
Grigori Goronzy [Thu, 18 Aug 2011 23:16:24 +0000 (01:16 +0200)]
Use TrueType font weight scale

fontconfig uses an unusual scale from 0-215 for the font weight. It
looks like it is somewhat derived from the typographic scale some font
families use, but is still rather nonstandard. Nowadays the TrueType
scale from 100-900 seems to be standard. CSS uses it, for example.

However, most importantly, VSFilter also uses the TrueType scale. So
let's use it in libass, too.

9 years agoFix similarity calculations
Grigori Goronzy [Thu, 18 Aug 2011 22:40:40 +0000 (00:40 +0200)]
Fix similarity calculations

9 years agoAdd a fixed set of fallback fonts
Grigori Goronzy [Thu, 18 Aug 2011 05:24:42 +0000 (07:24 +0200)]
Add a fixed set of fallback fonts

Add a small set of fixed fallback fonts, some of them with very wide
glyph coverage.

9 years agoDon't match any font if there's no glyph coverage
Grigori Goronzy [Thu, 18 Aug 2011 04:36:15 +0000 (06:36 +0200)]
Don't match any font if there's no glyph coverage

Do not return a font face at all instead of using the last one. Fixes
fallback to the default font path.

9 years agoRestore fontconfig runtime configuration
Grigori Goronzy [Thu, 18 Aug 2011 04:19:33 +0000 (06:19 +0200)]
Restore fontconfig runtime configuration

Pass the fontconfig configuration file option and enable switch
through into the font selector. This restores some of the old
functionality related to fontconfig.

However, the functionality to delay the fontconfig database update will
not come back. This is not a big problem. Later it will be possible to
manually add the fontconfig provider, which will delay the update in a
comparable way.

9 years agoFix compilation without fontconfig
Grigori Goronzy [Thu, 18 Aug 2011 03:54:46 +0000 (05:54 +0200)]
Fix compilation without fontconfig

Conditionally add the fontconfig provider. We can actually run
without fontconfig now! That is, if embedded fonts or fallbacks are
good enough.

9 years agoFix off-by-one bug in font matching
Grigori Goronzy [Thu, 18 Aug 2011 03:48:56 +0000 (05:48 +0200)]
Fix off-by-one bug in font matching

9 years agoAdd reference to font provider in font database
Grigori Goronzy [Thu, 18 Aug 2011 03:33:00 +0000 (05:33 +0200)]
Add reference to font provider in font database

This provides more flexibility than just referencing the callbacks:
we can identify the font provider (useful for removing fonts when a
provider is freed) and possibly access the font provider private data.

9 years agoImprove font selector/provider documentation
Grigori Goronzy [Thu, 18 Aug 2011 03:02:51 +0000 (05:02 +0200)]
Improve font selector/provider documentation

9 years agoConvert embedded font handling to a real font provider
Grigori Goronzy [Thu, 18 Aug 2011 02:40:47 +0000 (04:40 +0200)]
Convert embedded font handling to a real font provider

9 years agoAdd glyph coverage map for embedded fonts
Grigori Goronzy [Wed, 17 Aug 2011 22:15:57 +0000 (00:15 +0200)]
Add glyph coverage map for embedded fonts

Introduce a simple glyph coverage map (created when the font is added)
and use it for checking glyph coverage in font selection. This uses a
simple linear search at the moment.

9 years agoNever add a face twice to an ASS_Font
Grigori Goronzy [Wed, 17 Aug 2011 16:59:00 +0000 (18:59 +0200)]
Never add a face twice to an ASS_Font

Introduce a unique ID per font face and check it in add_face to make
sure we never add a font face twice. This is useful in case the glyph
coverage report is unreliable.

9 years agoFix trimming function
Grigori Goronzy [Mon, 15 Aug 2011 22:26:16 +0000 (00:26 +0200)]
Fix trimming function

Did not correctly handle empty strings (only whitespace). Whoops.

9 years agoTrim spaces of font family strings
Grigori Goronzy [Mon, 15 Aug 2011 20:04:02 +0000 (22:04 +0200)]
Trim spaces of font family strings

This adds a trimming utility function that is used for trimming strings
of font requests in the font sorter.

9 years agoCustom font matching and font sources
Grigori Goronzy [Sun, 7 Aug 2011 00:21:09 +0000 (02:21 +0200)]
Custom font matching and font sources

Implement a simple font sorter (FontSelector) and an interface to deal
with multiple font sources (FontProvider). Unfinished business,
but works for the most part. Currently the only implemented FontProvider
uses fontconfig.

9 years agoImplement cascade gaussian blur
Dr.Smile [Sat, 4 Jul 2015 19:39:26 +0000 (22:39 +0300)]
Implement cascade gaussian blur

That's complete version with SSE2/AVX2 assembly.
Should be much faster than old algorithm even in pure C.

Algorithm description can be found in this article (PDF):
https://github.com/MrSmile/CascadeBlur/releases

Close #9

9 years agoFix code path of rasterization through FreeType
Dr.Smile [Wed, 1 Jul 2015 18:21:11 +0000 (21:21 +0300)]
Fix code path of rasterization through FreeType

9 years agoRelease 0.12.3 0.12.3
wm4 [Tue, 30 Jun 2015 10:27:59 +0000 (12:27 +0200)]
Release 0.12.3

9 years agoMakefile.am: add missing ass_func_template.h to list of sources
wm4 [Tue, 30 Jun 2015 10:27:19 +0000 (12:27 +0200)]
Makefile.am: add missing ass_func_template.h to list of sources

9 years agoSwitch to virtual function table
Dr.Smile [Thu, 25 Jun 2015 23:14:21 +0000 (02:14 +0300)]
Switch to virtual function table

Use one pointer to table of functions instead of scattered
bunch of function pointers. Different versions of these tables
can be constructed in compile time.

Also, bitmap memory alignment now depends only on SSE2/AVX2 support
and is constant for every width. That simplifies code without
noticeable performance penalty.

9 years agoImprove rasterizer comments
Dr.Smile [Thu, 21 May 2015 23:25:23 +0000 (02:25 +0300)]
Improve rasterizer comments

9 years agoMerge pull request #160 from astiob/be
Grigori Goronzy [Tue, 23 Jun 2015 20:36:16 +0000 (22:36 +0200)]
Merge pull request #160 from astiob/be

\be fixes including clipping and value range

9 years agoFix crash when stroked outline overflows SHRT_MAX
Dr.Smile [Sun, 14 Jun 2015 15:55:41 +0000 (18:55 +0300)]
Fix crash when stroked outline overflows SHRT_MAX

9 years agoDo not apply ass_set_line_position() to positioned events
wm4 [Thu, 11 Jun 2015 20:01:51 +0000 (22:01 +0200)]
Do not apply ass_set_line_position() to positioned events

Even if we wanted this, the result would be inconsistent if e.g. \clip
is used.

9 years agostring2timecode: don't truncate to int
Oleg Oshmyan [Sun, 24 May 2015 22:00:38 +0000 (01:00 +0300)]
string2timecode: don't truncate to int

The timecode is a long long, but it is computed as a product whose
all multiplicands are (unsigned) ints and so effectively has the value
of an (unsigned) int. Fix this, and use the full long long range,
by explicitly making one of the first two multiplicands a long long.

Found by Coverity Scan.

9 years agoMerge pull request #181 from grigorig/clang-static-analysis
Grigori Goronzy [Mon, 8 Jun 2015 20:39:08 +0000 (22:39 +0200)]
Merge pull request #181 from grigorig/clang-static-analysis

Fix some issues reported by clang scan-build

9 years agoRemove several dead stores
Grigori Goronzy [Sun, 7 Jun 2015 19:48:36 +0000 (21:48 +0200)]
Remove several dead stores

Reported by clang scan-build static analysis.

9 years agoCheck possible NULL dereference
Grigori Goronzy [Sun, 7 Jun 2015 19:42:42 +0000 (21:42 +0200)]
Check possible NULL dereference

Reported by clang scan-build static analysis. This cannot happen with
the current code, but the check might make this more robust in case
anything changes.

9 years agoFix minor memory leak in ass_read_styles
Grigori Goronzy [Sun, 7 Jun 2015 19:30:41 +0000 (21:30 +0200)]
Fix minor memory leak in ass_read_styles

Reported by clang scan-build static analysis. Also fix incorrect
return value in case of error.

9 years agoStrictly clip non-dialog events against the video rectangle
wm4 [Mon, 25 May 2015 15:58:48 +0000 (17:58 +0200)]
Strictly clip non-dialog events against the video rectangle

Only normal dialog lines are allowed to appear outside.

Fixes #177.

9 years agoSimplify change_alpha and change_color
Oleg Oshmyan [Sun, 24 May 2015 11:47:37 +0000 (14:47 +0300)]
Simplify change_alpha and change_color

9 years agoApply fade only when the fade alpha is positive (like VSFilter)
Oleg Oshmyan [Fri, 22 May 2015 23:35:21 +0000 (02:35 +0300)]
Apply fade only when the fade alpha is positive (like VSFilter)

9 years agoparse_tag: split \[1-4][ac]
Oleg Oshmyan [Fri, 22 May 2015 21:21:35 +0000 (00:21 +0300)]
parse_tag: split \[1-4][ac]

9 years agoParse and animate all colors and alpha values like VSFilter
Oleg Oshmyan [Fri, 22 May 2015 21:06:40 +0000 (00:06 +0300)]
Parse and animate all colors and alpha values like VSFilter

* Allow exactly one of these prefixes in header values:
  0x, 0X, &h, &H. Note that "0x0xFFFFFF" is a correct value,
  as the first 0x is consumed by the parser and the second by
  the string-to-number conversion following strtol semantics.

* Allow arbitrary numbers of leading & and H
 (and not h) in any order in override tag values.

* Reduce header values modulo 2**32 instead
  of saturating them to LLONG_MIN/MAX.

* Saturate override tag values to INT32_MIN/MAX
  rather than to LLONG_MIN/MAX.

* Don't fiddle with bytes in alpha override tag values.
 (They can be outside of the 0..255 range.)

Also change the byte swapping code to be more sensible.

Fixes #80.
Fixes #145.
Fixes #178.

Also fixes our behavior in the case described in
https://code.google.com/p/xy-vsfilter/issues/detail?id=80.

9 years agoshaper: purge outdated comment
Grigori Goronzy [Thu, 29 May 2014 02:13:37 +0000 (04:13 +0200)]
shaper: purge outdated comment

HarfBuzz has been able to disable fallback kerning since commit
038c98f6. Add some more useful docstrings instead.

9 years agoFix a wrong comment
Oleg Oshmyan [Fri, 22 May 2015 21:23:17 +0000 (00:23 +0300)]
Fix a wrong comment

9 years agoAdd libjass to Other ASS/SSA implementations in README
Rodger Combs [Tue, 12 May 2015 11:11:11 +0000 (06:11 -0500)]
Add libjass to Other ASS/SSA implementations in README

Sure why not?
Closes #176.

9 years agoFix memory leak with drawings
wm4 [Sun, 10 May 2015 20:28:23 +0000 (22:28 +0200)]
Fix memory leak with drawings

What.

Closes #175.

9 years agoRemove RenderContext.drawing
wm4 [Sun, 10 May 2015 20:28:08 +0000 (22:28 +0200)]
Remove RenderContext.drawing

This really didn't make a lot of sense. This is a simplification, and
should not affect actual program behavior.

9 years agoRelease 0.12.2 0.12.2
wm4 [Thu, 7 May 2015 19:32:44 +0000 (21:32 +0200)]
Release 0.12.2

9 years agogg rcombs (fix README typo)
Rodger Combs [Tue, 21 Apr 2015 15:12:01 +0000 (10:12 -0500)]
gg rcombs (fix README typo)

9 years agoFix GStreamer link in README
Rodger Combs [Tue, 21 Apr 2015 02:30:18 +0000 (21:30 -0500)]
Fix GStreamer link in README

Closes #174

9 years agoDon't use margins for events that should not be overridden
wm4 [Mon, 16 Mar 2015 20:02:47 +0000 (21:02 +0100)]
Don't use margins for events that should not be overridden

libass already does not use the margins for events using \pos. This is
not quite complete: there are other tags that we consider as "not
dialogue", and which should not be overridden. These tags do not use
EVENT_POSITIONED, and thus use the margins, which can mess up rendering.

9 years agoReorder functions
wm4 [Mon, 16 Mar 2015 19:58:03 +0000 (20:58 +0100)]
Reorder functions

Just move the *_pos ones about the variants without this postfix.

9 years agoFix range in rot_key
Rodger Combs [Thu, 12 Mar 2015 20:30:26 +0000 (15:30 -0500)]
Fix range in rot_key

Oops, trig is hard. We output from -pi to +pi now.

9 years agoFix degrees/radians cache confusion; avoid a fixed-point overflow
Rodger Combs [Thu, 12 Mar 2015 09:45:00 +0000 (04:45 -0500)]
Fix degrees/radians cache confusion; avoid a fixed-point overflow

Also fix an incorrect comment

9 years agoIgnore extra coordinates in drawings
wm4 [Mon, 9 Mar 2015 21:19:38 +0000 (22:19 +0100)]
Ignore extra coordinates in drawings

If there's an odd number of values, ignore the extra value, instead
of shifting all values after the next command. While such drawings are
boken strictly speaking, VSFilter handles them gracefully, and what
libass did before this commit made no sense anyway.

Test case:

{\an7\pos(0.01,0.7)\c&H5A493D&\p1\iclip(11,m 857379 -744112 l 517759 -744112 517759 -942768 857379 -942768 m 851235 -422238 l 689105 -422238 689105 -620546 851235 -620546 m 679889 -421552 l 517411 -421552 517411 -620894 679889 -620894 -55984 m 860113 425634 l 519459 425634 519459 226640 860113 226640 m 868305 992080 l 465361 992080 465361 793936 868305 793936 m 841343 1317200 l 520145 1317200 520145 1118206 841343 1118206 m 411662 -245762 b 411662 -242373 408918 -239618 405518 -239618 l 342931 -239618 b 339532 -239618 336787 -242373 336787 -245762 l 336787 -308226 b 336787 -311626 339532 -314370 342931 -314370 l 405518 -314370 b 408918 -314370 411662 -311626 411662 -308226 m 414929 -907440 b 414929 -904051 412174 -901296 408785 -901296 l 346198 -901296 b 342798 -901296 340054 -904051 340054 -907440 l 340054 -969904 b 340054 -973294 342798 -976048 346198 -976048 l 408785 -976048 b 412174 -976048 414929 -973294 414929 -969904 m 414417 -585904 b 414417 -582515 411652 -579760 408252 -579760 l 345450 -579760 b 342041 -579760 339286 -582515 339286 -585904 l 339286 -648368 b 339286 -651758 342041 -654512 345450 -654512 l 408252 -654512 b 411652 -654512 414417 -651758 414417 -648368 m 414929 -44997 b 414929 -41597 412174 -38832 408785 -38832 l 346198 -38832 b 342798 -38832 340054 -41597 340054 -44997 l 340054 -107676 b 340054 -111075 342798 -113840 346198 -113840 l 408785 -113840 b 412174 -113840 414929 -111075 414929 -107676 m 415932 261456 b 415932 264845 413178 267600 409788 267600 l 347191 267600 b 343802 267600 341047 264845 341047 261456 l 341047 198992 b 341047 195602 343802 192848 347191 192848 l 409788 192848 b 413178 192848 415932 195602 415932 198992 m 414929 564048 b 414929 567437 412174 570192 408785 570192 l 346198 570192 b 342798 570192 340054 567437 340054 564048 l 340054 501584 b 340054 498194 342798 495440 346198 495440 l 408785 495440 b 412174 495440 414929 498194 414929 501584 m 414929 781136 b 414929 784525 412174 787280 408785 787280 l 346198 787280 b 342798 787280 340054 784525 340054 781136 l 340054 718672 b 340054 715282 342798 712528 346198 712528 l 408785 712528 b 412174 712528 414929 715282 414929 718672 m 414929 1133525 b 414929 1136914 412174 1139669 408785 1139669 l 346198 1139669 b 342798 1139669 340054 1136914 340054 1133525 l 340054 1071061 b 340054 1067661 342798 1064917 346198 1064917 l 408785 1064917 b 412174 1064917 414929 1067661 414929 1071061)}m 0 0 l 1280 0 1280 720 0 720 0 0{\p0}

9 years agoFix BorderStyle=3 with zero Outline and Shadow
Dr.Smile [Fri, 6 Mar 2015 15:21:43 +0000 (18:21 +0300)]
Fix BorderStyle=3 with zero Outline and Shadow

9 years agoMake timestamp parsing more lenient
wm4 [Fri, 6 Mar 2015 12:28:48 +0000 (13:28 +0100)]
Make timestamp parsing more lenient

Fixes "[ARR] Musashi no Ken - 01 [AVC][5697986B].ssa", which has
timestamps like "00:02:30.85". It starts with 2 zeros instead of one,
which probably means it's an invalid file, but it's accepted by various
other parsers (VSFilter, MPlayer, vlc, ffmpeg).

9 years agoPrevent selective style overrides with scrolling
wm4 [Fri, 6 Mar 2015 12:15:13 +0000 (13:15 +0100)]
Prevent selective style overrides with scrolling

Similar to xy-VSFilter.

9 years agoRefine list of tags that prevent selective style overrides
wm4 [Fri, 6 Mar 2015 12:14:39 +0000 (13:14 +0100)]
Refine list of tags that prevent selective style overrides

Somewhat stolen from:

https://github.com/Cyberbeing/xy-VSFilter/blob/xy_sub_filter_rc3/src/subtitles/RTS.cpp#L2004
(xy-VSFilter started work on this in commit 014da6d9766417d7886eb867c9f2c14038f2a226)

9 years agoAllow more fine grained control over style overrides
wm4 [Thu, 26 Feb 2015 19:49:18 +0000 (20:49 +0100)]
Allow more fine grained control over style overrides

Add tons of ASS_OVERRIDE_ flags, which control whether certain ASS_Style
fields are copied when doing selective style overrides with
ass_set_selective_style_override_enabled().

This comes with some cleanup. It should be fully backwards-compatible.

9 years agoChange what fields are overridden with style override
wm4 [Thu, 26 Feb 2015 19:49:15 +0000 (20:49 +0100)]
Change what fields are overridden with style override

"Bold" should obviously be taken from the script's style, like it's done
with StrikeOut and Underline.

treat_fontname_as_pattern is specific to the font, and thus should be
taken from the same style as the font (the override style).

9 years agoAlways use the new style with \r and style overrides
wm4 [Thu, 26 Feb 2015 19:49:10 +0000 (20:49 +0100)]
Always use the new style with \r and style overrides

I don't know why it was done this way, but some fields were always taken
from the event's style, instead of the (possibly different) \r style.
Undo this, as it seems like an unnecessary complication.

9 years agoDefine _GNU_SOURCE
Rodger Combs [Tue, 17 Feb 2015 17:44:52 +0000 (11:44 -0600)]
Define _GNU_SOURCE

Fixes #161

9 years agoMake sure the synth tmp buffer is large enough for be_blur
Oleg Oshmyan [Mon, 9 Feb 2015 22:37:41 +0000 (00:37 +0200)]
Make sure the synth tmp buffer is large enough for be_blur

9 years agoUse correct types in be_blur_c
Oleg Oshmyan [Mon, 9 Feb 2015 22:26:59 +0000 (00:26 +0200)]
Use correct types in be_blur_c

Also fix a related sort-of-bug: a multiple of sizeof(uint16_t)
was being added to a pointer that already pointed to uint16_t.
This was not causing any harm given enough space in the buffer.

Fixing the above also lets us combine the two memsets.

9 years agoAdd enough padding for \be to avoid clipping
Oleg Oshmyan [Mon, 9 Feb 2015 13:18:44 +0000 (15:18 +0200)]
Add enough padding for \be to avoid clipping

To avoid making bitmaps unnecessarily large, use just
the necessary amount of padding for the given \be value.

9 years agoCalculate \be using [0..64] value range (like VSFilter)
Oleg Oshmyan [Thu, 13 Mar 2014 03:15:18 +0000 (03:15 +0000)]
Calculate \be using [0..64] value range (like VSFilter)

To avoid banding in the output, the full [0..255] value range
is restored before the last \be pass, which then uses the full
range and hides the bands by virtue of being a blur.

With this, our \be finally closely matches VSFilter's.

The only visible difference (other than the lack of banding) is
in clipping: we add proper padding and output the whole blurred
image, while VSFilter does not add any padding and hence clips
the blurred image too early.

9 years agoApply \be after \blur (like VSFilter)
Oleg Oshmyan [Thu, 13 Mar 2014 03:05:11 +0000 (03:05 +0000)]
Apply \be after \blur (like VSFilter)

9 years agoDon't forget to apply \be to the first/last row/column (again)
Oleg Oshmyan [Wed, 12 Mar 2014 22:25:52 +0000 (22:25 +0000)]
Don't forget to apply \be to the first/last row/column (again)

The implementation of \be was changed to xy-VSFilter's, which (like
VSFilter's) reads but does not write out the first/last row/column.

9 years agoSkip memset() when using internal rasterizer
Dr.Smile [Mon, 9 Feb 2015 02:01:55 +0000 (05:01 +0300)]
Skip memset() when using internal rasterizer

9 years agoFix incorrect memset
Dr.Smile [Thu, 29 Jan 2015 20:50:38 +0000 (23:50 +0300)]
Fix incorrect memset