WHOLE_TEXT_LAYOUT bidi: fix buffer overread on soft-wrapped events
See commit cc54eea644db29bc64bdaa9305576d4d18cae9ed, which introduced this:
we have a base direction for each *paragraph* delimited by an explicit
line break (allocated and filled in ass_shaper_shape), not for each
display line (which the current ass_shaper_reorder code attempts to read).
Hurd too uses ELF and 16-byte stack alignment
just like Linux and many other Unix-likes.
Supposedly its host triplet can include a version number at the end.
Without getting more specific about how a version number is allowed to
look like, checking for *-gnu* overlaps with X32's -gnux32 suffix which
is present on non-Hurd systems.
Linux is the only X32 platform I know about and it uses an identical
configuration to GNU Hurd, so this shouldn't be a problem. Though to be
safe, let's move the case with *-gnu* at the end, to ensure if there's
a "-gnux32"-like suffix on any non-Linux, non-Hurd system it will match
the proper host regex before seeing Hurd's *-gnu* pattern.
Thanks to youpi1 for advice about Hurd and testing.
Cherry-picked from (with rebase changes): a943ef542e72e849dc0c1047465e0506781374b5
This release’s major feature is the addition of a new ASS ScriptInfo
header pair: LayoutResX and LayoutResY. The introduction has been
coordinated with active VSFilters and will soon be available in
xy-VSFilter and XySubFilter as well.
Since the beginning, many features in ASS scale relative to or are
otherwise affected by the storage resolution of the video file the
subs are bundled with. Adjusting subs for different video resolutions
traditionally took non-trivial effort. Of course this behavior must be
kept by default to preserve compatibility with existing files. But now,
setting both of the new headers to a positive, non-zero value will
replace the video storage resolution with the specified resolution for
the whole file, allowing easy reuse across all encodes of the same
display aspect ratio. This includes PAR effects, so reuse across
anamorphic and non-anamorphic releases is possible too.
Apart from that, some notes for package maintainers:
* for ASS_FEATURE_WRAP_UNICODE to be usable at runtime, libass must be
linked against the new optional dependency libunibreak whose source
currently resides at https://github.com/adah1972/libunibreak
* switching to a non-recursive build means it is no longer possible to
invoke make in subdirectories. However this wasn’t really useful
anyway and everything else, including uninstalled binary locations,
was kept unchanged.
* reminder: as announced last release more keys are now authorized for
signing release tags and tarballs; a signature of any one of those
keys is sufficient. See the MAINTAINERS file in the last or this
release’s tarball for a complete list and more details.
The original text always used "color" and I tried to keep it this way
when rewording, but two instances of "colour" slipped in.
The mentioned hypothetical "Use ColourMangling" header continues to use
British spelling for consistency with the rest of the SSA/ASS format.
Prior to 0.16.0 none of our tarballs included any README.md. With
0.16.0 both the toplevel README.md and comapre/README.md were
automatically included by the newer automake version used to generate
the tarballs, since they were next to a (recursive) Makefile.am.
With the switch to a non-recursive build, only the
toplevel README.md still gets added automatically.
Since this file explains how to use compare it makes sense to ship it
and it doesn’t require the example test directory. Thus, explicitly
add compare’s README.
Rendering ASS depends on the video’s storage resolution
for several tags. Thus transferring a subtitle file to a
different version of a video, with e.g. higher resolution
or anamorphic squeezing undone, requires adjusting all those
tags.
Affected are \be, \blur, \frx, \fry and if ScaledBorderAndShadow
is not set to "yes", also all tags related to border and shadow.
This locks all but simple subtitle files to a specific video
storage resolution. If one wants to release several different resolution
simultaneously, the same source is reencoded to undo anamorphic
squeezing, or a new higher resolution source appears, it is required
to manually adjust affected tags and each video version needs a
different subtitle file.
This is a pain point, and resulted in some releases just
relying on user overrides of players, or incompatibly patched
renderers to avoid the required manual adjustments.
By adding new headers, which will replace the original video storage
resolution in all calculations, authors will be able to create files
which can be reused across different resolutions as long as the display
aspect ratio stays the same. Hopefully this will also halt the spread of
incomapatible patches and overrides, which just result in broken files
and further ASS fragmentation.
For simplicity and to avoid surprises, LayoutRes* headers
only take effect if both are present and set to values larger
than zero.
If LayoutRes{X,Y} is set to corresponds to the actual storage resolution
of the video the subs are authored and initially released with, at least
the initial/main version will also be effectively compatible to older
renderers, which do not understand the new headers yet. This will grant
users some time to upgrade and minimise friction from this retroactive
format addition.
The header concept is also approved by some VSFilters and patches
for Cyberbeing/xy-VSFilter’s xy-VSFilter and XySubFilter are pending
with only implementation details being still up for discussion.
Integration into active Aegisub forks and possibly other common editors
will be pursued at a later date.
libass-specific:
Since API-users can initialise PAR, we must recalcute even existing
values when LayoutRes{X,Y} is set to ensure the sub-author-provided
values take precedence.