| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DirectWrite does not provide fast access to the is_postscript flag,
requiring each font to be loaded before its format can be determined.
Eagerly doing this for every installed font can be quite slow,
on the order of seconds.
To improve performance, ask the font provider for this information
only when it is actually needed, i.e. when one of the font's full
names or its PostScript name matches a requested font name and we
need to know whether to accept this match.
The return value of check_postscript is not cached in this commit.
This makes repeated calls slower than accessing is_postscript was.
This should not be a problem, but if it is, the value can be cached
(or precomputed) by font providers in their font private data.
This commit also potentially increases the memory usage of some
font providers by retaining data structures needed to implement
check_postscript in their font private data. This should not be
a problem either, but if it is, the value of check_postscript
can be precomputed by all providers other than DirectWrite.
|
| |
|
|
|
|
|
|
|
| |
Fonts without PostScript outlines (such as TrueType fonts) are unaffected,
and their PostScript names continue to be ignored when searching for fonts.
This matches the behavior of GDI and hence VSFilter.
|
| |
|
|
|
|
| |
index is signed, and psname only overrides it iff index < 0.
|
|
|
|
|
| |
Also fixes the build on OSX under some circumstances (weird and
inconsistent rules for the inline keyword in C).
|
|
|
|
|
| |
This adds simple and sensible substitutions for generic font family
names. A helper function is introduced to reduce code duplication.
|
|
|
|
|
| |
The CoreText backend doesn't like this, and in fact there's no reason to
pass NULL.
|
|
|
|
|
| |
Apparently we only need the font family (and even that isn't used in all
font providers). Drop the others.
|
|
|
|
|
|
| |
Tired of matching the names and order of the callbacks in my head.
While we're at it, also give some of the callbacks better names.
|
|
|
|
|
|
|
|
|
|
| |
We were discussing whether this should be public or private. It could be
public, because the API is potentially useful, and is relatively simple.
On the other hand, the API is not necessarily final, and making it
public would prevent us from improving/fixing it.
Make it private for now - making it public later is much easier than
having to break the public API later.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This is faster in many cases, and more suitable for Windows' GetFontData
function.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Allow memory fonts with the get_face_data callback. This feature is
used for embedded fonts, but can be used by any font provider.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
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.
|