(This also modifies image-source, obs-text, text-freetype2, and UI)
This improves source definition versioning. To do this, it now stores
two identifier names. One "unversioned" which is the original name, and
one "versioned" with the version number appended.
This fixes both backward compatibility with older OBS versions, and
fixes the inability to use "add existing" in OBS itself on sources
created from older version definitions.
Code submissions have continually suffered from formatting
inconsistencies that constantly have to be addressed. Using
clang-format simplifies this by making code formatting more consistent,
and allows automation of the code formatting so that maintainers can
focus more on the code itself instead of code formatting.
On macs, some fonts can be in sub-folders of the font folder, and may
not properly be found. This fixes that to detect directories and make
the lookup recursive.
(Note: This commit also modified text-freetype2)
Prevents issues from being able to update files that may not be using
the current system encoding on windows.
(Note: This commit also modified text-freetype2)
The implementation of get_modified_timestamp() did not check the return
value of stat(), so in case the check fails the values in the stats
structure can be any garbage on the stack and the value of
stats.st_mtime can change on every call. This can trigger a reload of
the image every second, even if the file was not actually modified.
Closesjp9000/obs-studio#520
(Note: This commit also modifies obs-filters and text-freetype2)
This simplifies writing of effects. DrawMatrix is no longer necessary
because there are no sources that require drawing with a color matrix
other than async sources, and async sources are automatically processed
and don't defer their initial render stage to filters.
When using a text file with the source and the font face is changed, it
would cause it to fail to update the glyphs and text accordingly. It
would trigger an error jump at line 392 of text-freetype2.c, ultimately
resulting in the text to render garbled after that.
How to reproduce:
Set the source to get text from a file, then just change the font face
(but not the size or anything else).
When updating text from file periodically, newer glyphs that weren't
already cached would not end up being rendered. This fixes the issue by
calling cache_glyphs after the file has been updated.
How to reproduce the original issue:
Set a text-freetype2 source to load an english-only text file. Then
overwrite the text in the file with non-english characters. The
non-english characters will then fail to render.
Reported at https://obsproject.com/mantis/view.php?id=336Closesjp9000/obs-studio#481
This caches the font list data to a file to minimize load times. Font
data will be refreshed when any font files are added/removed, based upon
a checksum of the font file names and dates (if available).