| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
This avoids an extra trip to FreeType.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
- Convert tabs to spaces
- Ensure one space between keywords and parenthesis
- Ensure space between ')' and '{'
- Trim trailing whitespace
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
WINBOOL is MingW-specific.
|
|
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.
|