| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
Also, remove the ass_coretext.c conditional compilation hack, and fix
Makefile.am instead.
|
|
|
|
|
| |
Add callbacks to introduce more sane fallback handling and font
alias substitutions.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Previously, the lazy load of fonts was only using display name. Also use the
other names available through the CoreText API (FamilyName and PostScriptName).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
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.
|