Commit Graph

2173 Commits

Author SHA1 Message Date
Sean Barrett b1826c9894 Update issue templates 2021-09-10 00:41:32 -07:00
Sean Barrett c0c982601f stb_truetype 1.26: fix rendering glitches 2021-08-28 04:52:41 -07:00
Sean Barrett ef861421e2 stb.h: stb_splitpath correctly handles relative paths with explicit drive specifiers 2021-08-28 03:20:04 -07:00
Sean Barrett 59e7dec3e8 delete file covered by patents 2021-08-13 13:57:23 -07:00
Sean Barrett 08e89524f6 Merge branch 'dev' of https://github.com/nothings/stb into dev 2021-08-13 13:57:07 -07:00
Fabian Giesen 5ba0baaa26 stb_image: Reject fractional JPEG component subsampling ratios
The component resamplers are not written to support this and I've
never seen it happen in a real (non-crafted) JPEG file so I'm
fine rejecting this as outright corrupt.

Fixes issue #1178.
2021-07-25 20:24:10 -07:00
Sean Barrett c404b789ca stb_truetype: fix sample code drawing characters upside-down 2021-07-25 19:22:47 -07:00
Sean Barrett 1401f2257d clean up project file 2021-07-25 19:22:47 -07:00
Sean Barrett 7c65d5621f fix compiling with NO_HDR NO_LINEAR 2021-07-25 19:22:47 -07:00
Sean Barrett be901954b2 stb_truetype: fix sample code drawing characters upside-down 2021-07-12 23:47:20 -07:00
Sean Barrett 7de8f7999b Merge branch 'master' into dev 2021-07-12 23:47:13 -07:00
Sean Barrett 3a1174060a opengl stb_truetype demo app 2021-07-12 21:27:12 -07:00
Sean Barrett 4adb57af42 clean up project file 2021-07-12 15:58:08 -07:00
Sean Barrett cd6b6f70ec fix compiling with NO_HDR NO_LINEAR 2021-07-12 15:57:39 -07:00
Sean Barrett a0a939058c update README 2021-07-12 01:50:47 -07:00
Sean Barrett 5a0bb8b1c1 update readme 2021-07-12 01:39:27 -07:00
Sean Barrett c4ef8e1fdc fix version date 2021-07-12 01:23:29 -07:00
Sean Barrett 7023e273f1 fix stb_dxt version 2021-07-11 18:06:46 -07:00
Fabian Giesen 5324597dcb README: update stb_dxt version for fix 2021-07-11 17:58:19 -07:00
Fabian Giesen 3cfb892cf3 stb_dxt: Fix bug in table generator
Forgot to put the *100 back, oops.
2021-07-11 17:58:00 -07:00
Sean Barrett 1ee679ca2e update version numbers 2021-07-11 17:07:54 -07:00
Sean Barrett fd7807e92d stb_c_lexer: allow including stb_c_lexer.h without defining overrides (all tokens are always defined; token values have changed) 2021-07-11 16:37:34 -07:00
Sean Barrett 0be82e4814 stb_truetype: fix incorrect antialiasing computation in v2 rasterizer, and handle certain cases where math blew up 2021-07-11 16:26:02 -07:00
Sean Barrett e05ecc05ee Fix compiling-as-C-pre-C99 issues 2021-07-11 15:26:16 -07:00
Sean Barrett 38c15ee7cf
Merge pull request #1165 from randy408/dev-fix
Fix CIFuzz integration
2021-07-11 13:28:24 -07:00
Randy af4c673174 change directory for seed corpus downloads 2021-07-10 15:51:11 +02:00
Randy a0a8653a7d attempt to fix issue with CIFuzz 2021-07-10 15:29:39 +02:00
ocornut 818ac26785 stb_rect_pack: making functions cdecl for msvc qsort 2021-07-09 19:26:36 -07:00
Fabian Giesen c8e3d3086d stb_truetype: Small tweaks to make PVS Studio happy
No actual bugs as far as I can tell.

Fixes issue #1162.
2021-07-09 18:49:15 -07:00
Sean Barrett 5bf78b8f23 stb_truetype: fix bad declaration 2021-07-09 05:37:56 -07:00
Sean Barrett 99e13217ce Merge branch 'dev' of https://github.com/nothings/stb into dev 2021-07-09 05:37:19 -07:00
Sean Barrett 4bb337ddf0 test including stb_c_lexer header independnet of implementation 2021-07-09 05:36:53 -07:00
Fabian Giesen 2b667e4d30 stb_rect_pack: Several minor fixes
1. Always use large rects mode to avoid definition of stbrp_coord
   in header file depending on implementation #defines
2. Expose STBRP__MAXVAL to users
3. Fix value of STBRP__MAXVAL for large rect mode (stbrp_coord
   is a 32-bit int, so needs to be <=0x7fffffff, 0xffffffff
   doesn't work)
4. Add comment at the top about which #define to set to get the
   implementation.

Fixes issue #1143, or rather, replaces that pull request.
2021-07-08 00:32:38 -07:00
Fabian Giesen 1e1efbdc75 stb_image_write: Make globals extern "C" in C++
Fixes issue #921
2021-07-08 00:24:00 -07:00
Fabian Giesen d2476c3845 stb_sprintf: GCC compilation fix
Fixes issue #1010.
2021-07-08 00:21:08 -07:00
Fabian Giesen 06b6009e3b stb_sprintf: Fix unused variable warning with STB_SPRINTF_NOFLOAT
Fixes issue #986.
2021-07-07 15:51:56 -07:00
Fabian Giesen 3be65f1c0c stb_sprintf: Small simplification
This was intentional but we might as well just set cs=0
directly here.

Fixes issue #997.
2021-07-07 15:43:47 -07:00
Fabian Giesen 013884b53b stb_sprintf: Fix string length calc
Factor out string length computation into helper func, comment
it a bit more, always use a limit to avoid 32b unsigned overflow,
and avoid reading past the bounds of non-0-terminated strings given
with specified precision.

Fixes issue #966.
2021-07-07 15:38:42 -07:00
Fabian Giesen 2af2e69219 stb_ds: Fix addn when n=0
In this case, the array pointer may still be 0 even after the
maybegrow.

Fixes issue #1015.
2021-07-07 14:59:13 -07:00
Fabian Giesen b14a80784c stb_image_write: Support writing BMPs with alpha
Fixes issue #1159.
2021-07-07 14:35:46 -07:00
Fabian Giesen 315e979f34 stb_truetype: Add protoype for stbtt_FindSVGDoc
Fixes issue #979.
2021-07-07 04:10:52 -07:00
Fabian Giesen 8af4d40950 stb_c_lexer: Move token enum defn to header portion
Required some tinkering, hope I didn't mess the logic up.

This now requires the config section to be set for the header
file, and different sites that include it should agree on what
the values are. This is kind of iffy but hard to avoid.

Fixes issue #647.
2021-07-07 04:02:32 -07:00
Fabian Giesen afc9c16bfd stb_truetype: Change spelling of fallthrough comment
To pacify GCC warnings at -Wimplicit-fallthrough=4. Why the
all-caps version works and the others don't, I'm not sure; the
GCC manual page lists regular expressions that GCC is checking for
but does not say which regular expression syntax variant it's using,
whether it's looking for a substring match or a full match for
the comment, and what exactly the text being matched against is
for a single-line comment. Sigh.

Fixes issue #507.
2021-07-07 03:43:15 -07:00
Fabian Giesen 46c259ff90 stb_sprintf: PUBLICDEC on declarations, as intended
The code was using PUBLICDEF on both declarations and
definitions.

Fixes issue #458.
2021-07-07 03:32:04 -07:00
Fabian Giesen 9fe3b4bb52 stb_truetype: GPOS handling formatting changes
Was using 4-character spaces and otherwise formatted unlike the
rest of the code, fix this. Also get rid of the outer switch in
GetGlyphGPOSInfoAdvance with just one case; just use an if.
No behavioral changes.
2021-07-07 03:12:33 -07:00
Fabian Giesen 1252a3e641 stb_truetype: GPOS parsing fixes
Glyphs not assigned a glyph class should default to class 0 as
per the OpenType spec. Also, change the code to treat malformed
data as an error to be handled, not an assert, and change the
way the version checking works.

Fixes the issue mentioned in PR #1035. Also, this part of the
code is indented incorrectly; will fix that in a subsequent
commit.
2021-07-07 02:58:28 -07:00
Fabian Giesen e590505492 stb_truetype: GCC warning fix
GCC warns about a potentially uninitialized variable here. It's
not (or at least I don't see how), but fix it anyway.
2021-07-07 02:45:41 -07:00
Andrew Kensler db6e91b7d8 Store uncompressed if compression was worse
If the data was uncompressible and this deflate implementation expanded
by more than the overhead of simply storing it uncompressed, fall back
to deflate's uncompressed storage mode.  This bounds the maximum deflated
size at the original size plus an overhead of 6 fixed bytes with another
5 bytes per 32767 byte block.

Fixes issue #948.
2021-07-07 02:32:46 -07:00
Fabian Giesen 14c224c84e stb_image_resize: Remove ill-advised asserts.
These mostly add very little and have caused problems for people,
nor does it make sense to require this when the underlying
computations are performed in floating-point arithmetic depending
on ratios of user-passed in image dimensions.

Arbitrary absolute epsilons here would just be garbage; we could
try and compute desired relative error bounds based on the
determined scale values, but this still leaves the questions of
what purpose this would even serve, which is unclear.

Leave the filter kernel asserts as comment for documentation
of what the behavior would be with exact math, but don't actually
bother asserting here.

Fixes issue #736.
2021-07-07 01:45:29 -07:00
Fabian Giesen e7f9f92c9d stb_divide: Update changelog 2021-07-07 01:33:35 -07:00