| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
These were missing in several places. Fixes #50.
|
|
|
|
| |
Fixes libass#8.
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The first point in a countour is not allowed to be a cubic control
point, which is sometimes violated by blindly reversing a countour,
producing the following errors:
[ass] FT_Stroker_ParseOutline failed, error: 20
[ass] Failed to rasterize glyph: 1
To avoid this, let the first point remain the first
and only reverse the order of the remaining points.
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is a bit crazy, but for vertical layout the sTypoAscender and
sTypoDescender fields of the OS/2 table are supposed to be used for
determining the size of the ideographic EM box [1], so that glyphs
can be centered on the baseline more neatly.
With this change, vertical layout should be completely equal to
VSFilter.
[1] http://www.microsoft.com/typography/otspec150/os2.htm#sta
|
|
|
|
|
| |
Make sure to use vertical advance under the right conditions -
vertical font selected, requested glyph is non-latin.
|
|
|
|
|
| |
Temporary fix for a crash when a font face doesn't actually contain
the glyph that fontconfig reports. Needs a real solution.
|
|
|
|
|
|
| |
The new revision of the stroker in FreeType doesn't like the way
contours are zero-filled to disable them. It's not particularly clean
anyway, so rewrite the whole outline instead.
|
| |
|
|
|
|
|
| |
Make sure to set the font size for every run, as needed, to get metrics
(advance/offset) for the right size.
|
|
|
|
|
|
| |
Add a new opaque data structure to store shaper-specific font data in
an ASS_Font. At the moment, this is used for caching HarfBuzz fonts,
to reduce allocation and font initialization overhead.
|
|
|
|
|
|
|
|
|
| |
This was introduced with commit e051ab. After re-evaluation, it
seems to be rather wrong. Windows appears to use the same ascender
as horizontal rendering, except for the first line. We don't have this
special handling of the first line, but apart from that, everything is
similar to Windows now. Verified with a couple of popular CJK fonts,
such as MS Mincho, Meiryo, etc.
|
|
|
|
|
|
|
|
| |
Split up text into runs with the same direction, font face and font
size, shape these runs with HarfBuzz and reorder accordingly.
This noticeably improves Arabic shaping and should make shaping for many
other scripts work. HarfBuzz also does kerning for Latin text.
|
|
|
|
|
|
|
|
|
|
|
| |
Split up ass_font_get_glyph into two functions: one function matches
checks the fonts for support of the requested codepoint and returns
a face_index and glyph_index to later load the glyph, with a second
function.
This approach is very useful for shaping, which needs to be done
on runs with the same font face and font size and changes the
glyph_index.
|
| |
|
|
|
|
|
|
|
|
|
| |
This introduces functions to use and copy pointered outline objects
easily and uses these instead of glyphs everywhere.
Previously the glyph cache was abused for caching vector clipping masks,
but this isn't possible anymore (nor desirable), thus vector clipping
cache has been disabled for the moment.
|
| |
|
|
|
|
|
|
|
|
| |
- less code, cleaner
- decoupled from ASS_Library
- better data encapsulation
- simpler interface
- avoids a nasty hack
|
|
|
|
|
|
|
|
| |
After font reselection, loop through all charmaps if no glyph can't be
found until we hopefully find one that works. If we get here at all, the
font is seriously broken, so this is unlikely to harm anything.
This improves the last resort charmap fallback introduced in 96057d.
|
|
|
|
|
|
| |
In hope to make libass as useful as possible, relicense libass to ISC, a
simplified 2-clause BSD license. All contributors who provided
non-trivial changes have granted their permission for this.
|
|
|
|
|
| |
The useless "if (foo) free(foo)" idiom is all over the place, just
get rid of it finally...
|
|
|
|
|
| |
strcasecmp/strncasecmp needs strings.h according to POSIX, so add this
include where these occur.
|
|
|
|
|
|
| |
If we're already after the font reselection stage and a glyph cannot be
found in a font, try again with the first charmap as a last resort.
This is needed for old "symbol" fonts, for example.
|
|
|
|
|
|
|
|
| |
Reverse "outside" contours with wrong winding correction, require
that a contour is "inside" for considering its removal; Move this
hack into ass_font.c, where it belongs.
Initial patch by uau.
|
|
|
|
| |
Partially reverts 162a735b6b2dba13022f96db42a3f153cf28033e.
|
|
|
|
|
|
| |
Extend the charmap selection heuristics to select the first Windows
charmap if no Unicode charmap is found.
Fixes one particular font, FGP楷書体NT-M, and possibly others.
|
|
|
|
|
|
|
|
| |
Store the real font face id instead of using 0 all the time and use the
real font face id for font lookup as well. This makes font attachments
with multiple faces work correctly.
Thanks to ubitux and uau!
|
| |
|
| |
|
|
|
|
| |
Might save a few cycles.
|
|
|
|
|
|
| |
GDI does not use vertical writing for glyphs below a certain unicode
codepoint.
To make this work correctly, refactor glyph transformations a bit.
|
|
|
|
|
| |
Calculate ascender for rotated glyphs from the maximum advance width.
Works OK usually, but screws up with fonts that miss this information.
|
|
|
|
|
|
| |
Do not skip '@' at the start of a font name in styles; detect '@' at
font name start and set a new attribute in ASS_Font accordingly.
Rotate affected glyphs after loading and calculate a suitable advance.
|
|
|
|
|
|
|
|
|
|
| |
Some (arguably) broken CJK fonts claim to have a fixed advance width,
but they actually use two different widths for half-width and full-width
characters. Even worse, some use proportional width.
This can cause problems under certain circumstances. A big project
(Cairo) uses a FreeType load flag to ignore the global advance width
for such fonts, so I assume it can be used safely. Let's do it just
like them.
|
|
|
|
|
| |
Get rid of compatibility #ifdefs and some code to support very old
versions of freetype. libass now requires at least version 2.2.1.
|
|
|
|
|
|
| |
Many fonts don't have a non-breaking space (NBSP) character and this
can cause problems when these glyphs are substituted. Render them
like a regular space.
|
|
|
|
|
|
| |
Exit early if no striking is needed; make sure to strike in reverse
direction for non-truetype font and use the usual return value
convention (0 == no errors).
|
|
|
|
|
|
|
| |
Fallback to embolden manually with FreeType in case a bold face was
requested, but no bold variant is available. The glyphs are slightly
emboldened (much less than FT_GlyphSlot_Embolden would do) and the
metrics are not touched at all.
|
|
|
|
|
|
| |
Rename all typedefs from the convention foo_bar_t, which can possibly
conflict with POSIX types, to FooBar (and ASS_FooBar for public
API typedefs). Fix formatting and stray comments while at it.
|
|
|
|
|
|
|
| |
The shift is not calculated when fetching a glyph anymore. Instead,
it is calculated right before rasterizing a glyph. Remove the
shift vector and make get_outline_glyph, the glyph cache and
ass_font_set_transform work without supplying a shift vector.
|
|
|
|
|
|
|
|
| |
The glyph striker (underline/strike-through) did not check for table
availability, possibly accessing a NULL pointer. Change this to
only strike the glyph if the table with the appropriate information
is available. Currently there is no fallback for fonts without the
required information.
|
|
|
|
|
|
| |
If possible, use ascender/descender from the OS/2 TTF table. This is
another try to get libass to match VSFilter in regard to vertical font
metrics.
|
|
|
|
|
| |
Try to change ascender/descender calculation to be more compatible
with Windows GDI and consequently, VSFilter.
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce functionality for providing a message callback that is used
for passing messages to the controlling application instead of simply
printing them to standard output. The function pointer to the callback
is stored in the ass_library_t instance. ass_msg needs access to it, so
in many places the library instance needs to be passed around now.
The default behavior is the old one: messages of MSGL_INFO or lower
are printed to the standard output, prefixed with "[ass]".
|
|
|
|
|
|
| |
Instead of referencing string defines from help_mp.h, use the strings
directly in ass_msg. Consequently, help_mp.h is useless and can
be deleted.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for the underline (\u) and strikethrough/strikeout (\s)
properties. This is a bit tricky, since FreeType doesn't offer
any method of adding the lines, so you have to draw them yourself.
libass uses various information from TrueType tables to get position
and size of the lines, does a few simple consistency checks (some fonts
might be broken) and if everything is alright, adds new contours for
the lines.
Sometimes, rendering errors can occur:
- Currently, kerning isn't taken into account, which means the lines
can overlap a little, leading to small optical glitches.
- Some (broken) fonts use the wrong winding direction. In this case,
the FreeType stroker will only consider the added lines to be "outside"
and only stroke the line instead of the whole glyph.
|
|
|
|
|
| |
On two occassions strings where strdup()'ed but never freed. Fix these
two small memory leaks.
|
| |
|
|
|
|
|
| |
Fix formatting of a few remaining declarations missed in the first
cleanup.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reindent complete source code (*.c, *.h) with indent, the exact command
line being:
indent -kr -i4 -bap -nut -l76 *.c *.h
From now on, new code should use (more or less) K&R style,
only spaces and no tabs, 4 spaces indent width. Avoid long lines.
Fix function declaration pointer spacing.
Remove spaces that were added to many function declarations by indent,
like some_func(foo_t * bar).
Fix indenting of macros in ass.c
|
|
|
|
| |
that is part of ass_renderer.
|
|
|
|
| |
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29367 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
| |
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
|
|
| |
Patch by Adrian Stutz (adrian sttz ch).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28895 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
|
|
|
| |
Switch them from a HAVE_ to a CONFIG_ prefix.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27425 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
|
|
|
|
| |
We already use LIBASS_ prefixes for the multiple inclusion guards.
Thus libass can be considered separate enough to warrant this.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26770 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
| |
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26755 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
|
|
|
|
|
| |
It was originally a workaround for fonts with bad ascender/descender values,
but it breaks display of some otherwise valid fonts (bugzilla 987), so
reverted.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25688 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
| |
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24856 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
|
|
|
|
|
| |
This fixes segfault when reselecting fonts and the new font could not be
loaded (because of a bad font file, or too many font faces already loaded).
Patch by Glen Nakamura, glen at imodulo dot com.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24855 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
|
|
|
| |
metrics.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24003 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
| |
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24002 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
| |
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24001 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
|
|
|
|
|
| |
Since ass_font_t contains a list of font faces, there is no need to select the
face with maximum charset coverage each time. It is enough to select any face
with the required glyph.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24000 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
| |
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23358 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
| |
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23357 b3059339-0415-0410-9bf9-f77b7e298cf2
|
|
|
|
|
|
|
|
|
| |
|