0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
Commit Graph

63 Commits

Author SHA1 Message Date
Richard Stanway
8f3289fc4d
text-freetype2: Fix a crash if there's insufficient glyph texture space 2016-04-24 20:21:07 +02:00
Richard Stanway
215f2441e2
text-freetype2: Don't create vertex buffer if text is empty 2016-04-23 17:49:04 +02:00
Gol-D-Ace
5ed7081213 Update translations from Crowdin 2016-04-23 10:29:21 +02:00
jp9000
42305f1c98 text-freetype2: Don't draw anything if no text to draw
Under certain circumstances (when there's no text and a filter is
applied for example) the freetype 2 text source would still draw.
2016-04-22 08:23:44 -07:00
jp9000
d8a357e01a image-source: Use os_stat instead of stat
(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.
2016-04-03 18:03:52 -07:00
Jim
32358ba636 Merge pull request #518 from hwdro/TFT-A8
text-freetype2: Use GS_A8 type glyphs texture
2016-03-24 01:23:55 -07:00
Christoph Hohmann
18a2b61b85 image-source: Fix reloading bug when stat fails
(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.

Closes jp9000/obs-studio#520
2016-03-24 01:14:23 -07:00
jp9000
9e15e3d8fd libobs: Remove need for DrawMatrix technique in effects
(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.
2016-03-21 21:22:26 -07:00
jp9000
9a54b61df6 text-freetype2: Mark ft2 text source as custom draw
Fixes a bug where the first effect filter on the freetype2 text source
wouldn't be properly applied
2016-03-20 21:40:37 -07:00
jp9000
69da1151e0 Update translations from Crowdin 2016-03-19 12:08:48 -07:00
hwdro
e0592beab3 text-freetype2: Use GS_A8 type glyphs texture
Since glyphs are rendered by FT as 8-bit gray levels bitmaps, it would
be a waste of memory to cache glyphs in a RGBA texture.
2016-03-10 15:23:42 +02:00
Gol-D-Ace
2ee1d82860 Add latest translations from Crowdin 2015-11-16 21:04:55 +01:00
Richard Stanway
d1fbacd784 text-freetype2: Fix loading from files with unicode names 2015-10-08 00:57:12 +02:00
jp9000
667768b96b text-freetype2: Fix garbled rendering if face changed
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).
2015-10-05 16:31:35 -07:00
Copy Liu
c4f5769df4 text-freetype2: Refresh glype cache after file update
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=336

Closes jp9000/obs-studio#481
2015-10-05 16:00:06 -07:00
jp9000
bdfb52410c text-freetype2: Fix serialized variable size
This variable needs to be the same size for both architectures.  size_t
is 8 on 64bit and 4 on 32bit.
2015-10-05 14:18:56 -07:00
jp9000
e91f5384b4 text-freetype2: Cache data to reduce load time
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).
2015-10-04 21:16:31 -07:00
dodgepong
76c18b079b Latest translations from CrowdIn 2015-09-22 23:33:29 -04:00
jp9000
6285a47726 (API Change) libobs: Pass type data to get_name callbacks
API changed from:
obs_source_info::get_name(void)
obs_output_info::get_name(void)
obs_encoder_info::get_name(void)
obs_service_info::get_name(void)

API changed to:
obs_source_info::get_name(void *type_data)
obs_output_info::get_name(void *type_data)
obs_encoder_info::get_name(void *type_data)
obs_service_info::get_name(void *type_data)

This allows the type data to be used when getting the name of the
object (useful for plugin wrappers primarily).

NOTE: Though a parameter was added, this is backward-compatible with
older plugins due to calling convention.  The new parameter will simply
be ignored by older plugins, and the stack (if used) will be cleaned up
by the caller.
2015-09-16 09:21:12 -07:00
dodgepong
fb679bdd02 Add latest translations from CrowdIn 2015-07-08 14:56:07 -04:00
jp9000
fdcb27230c text-freetype2: Add translation for source name 2015-07-06 21:28:40 -07:00
Palana
78ad3ec132 text-freetype2: Fix undefined behavior for alpha > 127
Found via UBSan, actual (sample) error:
"plugins/text-freetype2/text-functionality.c:284:26: runtime error: left
shift of 194 by 24 places cannot be represented in type 'int'"
2015-05-31 04:45:40 +02:00
jp9000
f3069e3ea5 text-freetype2: Prevent potential null dereference 2015-04-10 07:27:28 -07:00
Manuel Kroeber
8a55f3bda7 text-freetype2: Fix bug 0000151
Fix bug 0000151: File loading not properly handled.

Link to bug: https://obsproject.com/mantis/view.php?id=151

A newly selected font is not loaded properly if "read from file" is
active without a valid file.  Old error handling lead to random memory
being displayed.

Closes Pull Request #390

(message edited by Jim)
2015-03-01 23:39:13 -08:00
dodgepong
eb918d01b4 Add latest translations from CrowdIn 2015-02-09 19:26:17 -05:00
jp9000
4ba293a6d9 text-freetype2: Fix wrong parameter type
These functions expect char*, where as the string is stored as a
unsigned char* (FT_Byte*).
2015-02-09 03:56:13 -08:00
jp9000
8a97199072 text-freetype2: Set font log warning to debug only 2015-01-05 02:45:38 -08:00
Lexsus
a2deddfa77 text-freetype2: Fix CR char. rendering as space
On windows, carriage return characters are used along with line feed
characters. When the carriage return is used, it's rendered as a space.
This removes carriage returns from strings before rendering them via
freetype.
2014-11-18 04:04:54 -08:00
jp9000
ce99829d01 text-freetype2: Remove null pointer dereference 2014-11-17 06:47:49 -08:00
jp9000
f199e2c096 text-freetype2: Do not call wcslen in loop expr.
Doing this in the expression will cause it to execute the function every
time the expression is evaluated, which is needless cycles wasted.
Instead, call wcslen before the loops begin.
2014-11-17 06:47:49 -08:00
jp9000
28ac194257 text-freetype2: Fix null pointer dereference
Somehow, there were fonts with empty face names.  Regardless, it's
always important to check your pointers.  Invalid pointers spell doom.
2014-10-31 20:39:37 -07:00
dodgepong
17804ec12f Add latest translations from CrowdIn 2014-10-31 21:02:47 -04:00
Ben Torell
958b5c12de Latest translations from Crowdin 2014-10-11 18:47:35 -04:00
Palana
94a93abb2b (API Change) Pass data to get_properties when possible 2014-10-01 15:39:57 +02:00
jp9000
c9df41c1e2 (API Change) Remove pointers from all typedefs
Typedef pointers are unsafe.  If you do:
typedef struct bla *bla_t;
then you cannot use it as a constant, such as: const bla_t, because
that constant will be to the pointer itself rather than to the
underlying data.  I admit this was a fundamental mistake that must
be corrected.

All typedefs that were pointer types will now have their pointers
removed from the type itself, and the pointers will be used when they
are actually used as variables/parameters/returns instead.

This does not break ABI though, which is pretty nice.
2014-09-25 21:48:11 -07:00
BtbN
9f8b74b720 Add disable options for optional plugins 2014-09-15 19:34:53 +02:00
jp9000
cabc47c147 Add more null pointer checks to text source 2014-09-02 20:44:50 -07:00
jp9000
8d76f940c6 Add null pointer check for text file
Apparently there was no check for a null pointer file name.
2014-09-02 18:22:44 -07:00
jp9000
e33d567abe text-freetype2: Do not use fontconfig for mac
Originally, I tested the fontconfig code on mac and it was working
swimmingly.  However, it seems to be related to the fact that I am using
the ports/homebrew version of fontconfig.  Most users do not have that
version, and instead use the system built-in version of fontconfig,
which apparently does not find any mac fonts..  at all.  So, this
reverts the mac code to the older mac code we were using to manually
find and associate fonts with font files on the mac.
2014-08-26 12:43:33 -07:00
jp9000
53b0d9d16f text-freetype2: Split find-font-windows.c
This moves font-finding code that can be shared to find-font.c.
2014-08-26 12:41:18 -07:00
jp9000
25fa0c0fd7 text-freetype2: Warn if no font file found 2014-08-26 10:25:49 -07:00
jp9000
ab4efe4dd1 text-freetype2: Fix null poitner dereference 2014-08-26 10:20:13 -07:00
dodgepong
a221fee3d2 Add latest translations from CrowdIn 2014-08-25 14:41:52 -07:00
jp9000
ff9c0528b7 text-freetype2: Check for 2 bytes instead of 1 2014-08-25 09:14:20 -07:00
jp9000
07c46ab468 text-freetype2: Fix GCC fread warnings
GCC marks fread as a function that will throw a warning if you do not
use its return value.  This is most likely done as a measure to ensure
code security.
2014-08-25 09:10:57 -07:00
jp9000
07d099bd1e text-freetype2: Localize text file path filter 2014-08-25 09:10:29 -07:00
jp9000
938b7c4395 text-freetype2: Fix 'text file' property filter
The text file filter accidentally said "All font files (*.txt)" instead
of saying "Text files (*.txt)".  Probably just a mistake from a
copy&paste.
2014-08-25 08:46:47 -07:00
jp9000
d95d20aa46 text-freetype2: Avoid spamming the log
When polling the file for changes, if the file doesn't exist, avoid
repeating the message over and over again that it couldn't find the
file.
2014-08-24 16:59:02 -07:00
jp9000
4ec0861481 text-freetype2: Avoid memory leak
Doing just return could cause it to bypass the font_obj cleanup
2014-08-24 16:58:28 -07:00
jp9000
50b80925e3 text-freetype2: Check if using file with from_file 2014-08-24 16:56:34 -07:00