summaryrefslogtreecommitdiffstats
path: root/libass/ass_fontselect.h
Commit message (Collapse)AuthorAgeFilesLines
* fontselect: expose a fontprovider selection APIStefano Pigozzi2015-07-101-1/+2
| | | | | | | | | 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.
* fontselect: coretext: allow selection based on PostScript nameStefano Pigozzi2015-07-101-2/+2
| | | | | | | | | | | 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.
* Use streamed access for memory fontsGrigori Goronzy2015-07-101-2/+2
| | | | | This is faster in many cases, and more suitable for Windows' GetFontData function.
* Export font provider interfaceGrigori Goronzy2015-07-101-37/+0
| | | | | | | 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.
* Memory font supportGrigori Goronzy2015-07-101-2/+3
| | | | | Allow memory fonts with the get_face_data callback. This feature is used for embedded fonts, but can be used by any font provider.
* Add convenience defines for slant valuesGrigori Goronzy2015-07-101-0/+3
| | | | | | | | 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.
* Use TrueType font weight scaleGrigori Goronzy2015-07-101-0/+4
| | | | | | | | | | 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.
* Restore fontconfig runtime configurationGrigori Goronzy2015-07-101-1/+1
| | | | | | | | | | | 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.
* Never add a face twice to an ASS_FontGrigori Goronzy2015-07-101-5/+7
| | | | | | 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.
* Custom font matching and font sourcesGrigori Goronzy2015-07-101-0/+74
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.