summaryrefslogtreecommitdiffstats
path: root/libass/ass_fontselect.c
Commit message (Collapse)AuthorAgeFilesLines
* Memory font supportGrigori Goronzy2015-07-101-26/+81
| | | | | Allow memory fonts with the get_face_data callback. This feature is used for embedded fonts, but can be used by any font provider.
* Make sure font path is validGrigori Goronzy2015-07-101-1/+3
| | | | We do not support memory-based fonts yet, so a path is mandatory.
* Fix weight validity checkGrigori Goronzy2015-07-101-1/+1
|
* Free a provider's fonts when it is freedGrigori Goronzy2015-07-101-25/+65
| | | | | When a provider is freed, iterate the font database, free all fonts that belong to that provider and compact the database afterwards.
* oops: remove debug outputGrigori Goronzy2015-07-101-2/+0
|
* Check weight and slant validity in font providerGrigori Goronzy2015-07-101-3/+13
| | | | | When adding a new font, check that weight and slant are valid. If they're not, use reasonable defaults.
* Use TrueType font weight scaleGrigori Goronzy2015-07-101-1/+3
| | | | | | | | | | 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.
* Fix similarity calculationsGrigori Goronzy2015-07-101-2/+2
|
* Add a fixed set of fallback fontsGrigori Goronzy2015-07-101-11/+22
| | | | | Add a small set of fixed fallback fonts, some of them with very wide glyph coverage.
* Don't match any font if there's no glyph coverageGrigori Goronzy2015-07-101-1/+3
| | | | | Do not return a font face at all instead of using the last one. Fixes fallback to the default font path.
* Restore fontconfig runtime configurationGrigori Goronzy2015-07-101-6/+5
| | | | | | | | | | | 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.
* Fix compilation without fontconfigGrigori Goronzy2015-07-101-0/+4
| | | | | | Conditionally add the fontconfig provider. We can actually run without fontconfig now! That is, if embedded fonts or fallbacks are good enough.
* Fix off-by-one bug in font matchingGrigori Goronzy2015-07-101-1/+1
|
* Add reference to font provider in font databaseGrigori Goronzy2015-07-101-13/+20
| | | | | | 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.
* Improve font selector/provider documentationGrigori Goronzy2015-07-101-5/+41
|
* Convert embedded font handling to a real font providerGrigori Goronzy2015-07-101-33/+55
|
* Add glyph coverage map for embedded fontsGrigori Goronzy2015-07-101-4/+81
| | | | | | 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.
* Never add a face twice to an ASS_FontGrigori Goronzy2015-07-101-7/+20
| | | | | | 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.
* Trim spaces of font family stringsGrigori Goronzy2015-07-101-2/+3
| | | | | This adds a trimming utility function that is used for trimming strings of font requests in the font sorter.
* Custom font matching and font sourcesGrigori Goronzy2015-07-101-0/+514
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.