My clang doesn't like the macro defined this way, choking at the callsite on line 195 with "too many arguments provided to function-like macro invocation"
This change matches what is done for STBTT_memset in stb_truetype.h
Someone should double check that that I didn't change
the behavior of any of the code. I'm not using most (if any)
of the code I touched, just wanted it to compile...
* `force_filter` being < 0 means the original behavior (i.e. figure out
the best-performing filter per scanline); any other values 0 <= x <= 4 correspond
to PNG filters (0 = none, 1 = sub, 2 = up, 3 = average, 4 = Paeth).
* `compression_level` being < 0 equals `compression_level` 8 (the previous value).
The higher this is, the better the compression should be (though it will use
more memory).
These new parameters are not (yet) exposed for the higher-level API functions.
...as present in MS TrueType files. Since this table is optional,
the new stbtt_GetFontVMetricsOS2 has a return value and can fail.
This is a replacement for pull request #463.
Fixes#463.
This incorporates #462, but also factors everything into one
function that is shared between 8-bit integer, 16-bit integer, and
float pixels (vertical flip operates on rows of bytes and doesn't
really care), and finally always uses a 2k on-stack buffer without
dynamic memory allocation, doing multiple memcpys per row if
necessary. Not only does this remove an out-of-memory failure mode,
it is also preferable for large images, since it's more
L1-cache-firendly this way.
Fixes#462.
1. const char* for __FILE__ (string literals are const)
2. Use %zd to print size_t where available; the only real problem
here is Visual C++. Use long long on the VC++ vers that support
64-bit targets but not %zd, int on the even older 32-bit-only
VC++ vers that don't support "long long" either.
Fixes#459. I think. (It's hard to be sure since the issue doesn't
state the exact warning message.)