summaryrefslogtreecommitdiffstats
path: root/libass/dwrite_c.h
Commit message (Collapse)AuthorAgeFilesLines
* directwrite: read metadata from IDWriteFontFace3 if possibleOleg Oshmyan2021-07-101-1/+102
| | | | This avoids an extra trip to FreeType.
* directwrite: better match_fonts via GDI or IDWriteFontSetOleg Oshmyan2021-07-101-0/+234
| | | | | | | | | | | | | | | | | | | | | | | | | | CreateFontFromLOGFONT does not actually use GDI's font lookup logic and fails to emulate it faithfully. In particular: it fails to find CFF-outline fonts by PostScript name; it fails to find TrueType fonts by full name on older versions of Windows; it fails to find at least some fonts installed on demand by font managers. When GDI is available, invoke GDI directly. This commit uses EnumFontFamilies, which is almost perfect, except that if the user has two different fonts such that one font's family name equals another's full/PostScript name, this will find only the family name match. To fix this case as well, we'd need to invoke CreateFontIndirect separately for each font request, complete with its weight and slant. This requires larger changes in our fontselect, which this commit does not attempt yet. GDI is not available in WinRT/UWP. On UWP (Windows 10), use the new IDWriteFontSet API to emulate GDI's font lookup as well as we can. In WinRT (Windows 8), we have no choice but to keep using CreateFontFromLOGFONT (unless we go back to loading all fonts eagerly, which we stopped doing for performance reasons). It is the builder's responsibility to avoid linking in Gdi32.lib in WinRT/UWP builds, just as it is to link in Dwrite.lib.
* dwrite_c: remove unused GUIDOleg Oshmyan2021-07-101-1/+0
|
* dwrite_c: fix incorrect macro parameter namesOleg Oshmyan2021-07-101-1/+1
|
* directwrite: remove arbitrary 256-char name length limitOleg Oshmyan2021-07-101-1/+4
|
* directwrite: request font on demandApache5532021-05-011-1/+31
| | | | | | | | | | | | scan_fonts can be very slow when many fonts were installed in the system. Use IDWriteGdiInterop to create a font by its name when needed instead of scanning all installed fonts during the initializing stage to get better performance. In case of a non-existent font, the fallback mechanism should do its work. Fixes https://github.com/libass/libass/issues/334. Signed-off-by: Oleg Oshmyan <chortos@inbox.lv>
* Style-Nit: Adjust whitespacesOneric2020-07-051-4/+4
| | | | | | | - Convert tabs to spaces - Ensure one space between keywords and parenthesis - Ensure space between ')' and '{' - Trim trailing whitespace
* directwrite: fix font collectionsGrigori Goronzy2017-06-011-0/+3
| | | | | | | | | | | | | | | | DirectWrite's FontFileStream does not actually use the data of a specific font in a collection, which was an expectation of the existing code. It simply returns a stream to the underlying file, collection or not. So we need to get the index of the font. This needs to be done lazily as this information is only available in a FontFace, which is expensive to initialize. Add a new optional font provider function for lazy initialization of the index and use it. This is similar to the check_postscript callback. Fixes libass#275. v2: fix type of returned value.
* Fix Windows buildGrigori Goronzy2015-10-291-1/+3
| | | | | | | Some parts used in fontselect weren't properly defined. v2: RAW_CFF face type was added later, so it's at the end of the enum list.
* fontselect: find fonts with PostScript outlines by PostScript nameOleg Oshmyan2015-10-231-1/+10
| | | | | | | 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.
* directwrite: change WINBOOL to BOOL.torque2015-09-171-9/+9
| | | | WINBOOL is MingW-specific.
* Rename dwrite.h, minor cleanupswm42015-08-051-0/+673
Rename dwrite.h to dwrite_c.h to make the difference between the official header and ours clearer. Also apply minor cleanups to it. Remove the patch against upstream MinGW; it's pointless now.