Commit Graph

155 Commits

Author SHA1 Message Date
Sean Barrett c0c982601f stb_truetype 1.26: fix rendering glitches 2021-08-28 04:52:41 -07:00
Sean Barrett be901954b2 stb_truetype: fix sample code drawing characters upside-down 2021-07-12 23:47:20 -07:00
Sean Barrett c4ef8e1fdc fix version date 2021-07-12 01:23:29 -07:00
Sean Barrett 1ee679ca2e update version numbers 2021-07-11 17:07:54 -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
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
Fabian Giesen 315e979f34 stb_truetype: Add protoype for stbtt_FindSVGDoc
Fixes issue #979.
2021-07-07 04:10:52 -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 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
Sean Barrett fc5b791228 stb_truetype: fix SDF handling of multiple move_to commands in a row 2021-07-07 01:21:37 -07:00
Fabian Giesen b691fc4305 stb_truetype: Remove dead assignments
Confirmed from the OpenType spec that there's nothing missing
here. (These were just annotations listing the total sizes of
the tables, but this is not used for anything here.)

Fixes issue #704.
2021-07-06 20:39:35 -07:00
Fabian Giesen ba5cc43d33 stb_truetype: Fix stbtt__solve_cubic comment 2021-07-06 20:10:22 -07:00
Fabian Giesen a5d989c358 stb_truetype: Tabs->spaces
Whitespace only.
2021-07-06 20:07:12 -07:00
Fabian Giesen 0afc39f59a stb_truetype: Turn codepoint assert into error check
Fixes the bug covered by PR #1066, but with a slightly different
fix that's hopefully a bit clearer.
2021-07-04 01:38:24 -07:00
Jan CW Kroeze 04007a071c Note GL blend state for stb_truetype 2021-07-04 01:38:24 -07:00
Sean Barrett e140649ccf remove trailign whitespace 2020-07-13 04:40:31 -07:00
Sean Barrett cd742941e6 stb_truetype: fix warning 2020-02-05 03:40:17 -08:00
Sean Barrett 2bb4a0accd Fix trailing whitespace 2020-02-02 11:30:27 -08:00
Sean Barrett 7a69424f15 update version numbers 2020-02-02 11:26:50 -08:00
Sean Barrett 17c301817b Merge branch 'working' 2020-02-02 11:16:16 -08:00
Sean Barrett 8ee3beabba Merge branch 'master' of https://github.com/BSVino/stb into working 2020-02-02 11:16:06 -08:00
Sean Barrett 5e4a0617b7 udpate version numbers 2020-02-02 11:12:13 -08:00
Sean Barrett 770e4dbe50 Merge branch 'patch-2' of https://github.com/Brotcrunsher/stb into work2 2020-02-02 08:16:26 -08:00
Sean Barrett fe6bef2307 stb_truetype: clean up svg support 2020-02-02 08:14:00 -08:00
Sean Barrett ade80f4609 Merge branch 'svg' of https://github.com/chris-y/stb into work2 2020-02-02 08:07:01 -08:00
Sean Barrett 787f1d646a Update version numbers 2019-08-11 05:38:37 -07:00
Sean Barrett a5071ad702 Merge branch 'master' of https://github.com/rgriege/stb into working 2019-08-11 04:32:14 -07:00
Brotcrunsher f7d1cd581e
Allowing Compound Glyphs with `numberOfContours < -1`
While it is recommended that the numberOfContours are set to -1 for compound glyphs, it is allowed to have any negative value. Source: https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6glyf.html

However, I don't know if this happens in practice.
2019-04-30 16:30:03 +02:00
Chris Young 0a1016331c Add functions to extract SVG glyphs from font.
The fucntions are:
stbtt_GetCodepointSVG - provides a pointer to the SVG data in the supplied argument, and returns the length of this data
stbtt_GetGlyphSVG - As above but takes the glyph index instead of the codepoint
Note that the returned data may be deflate compressed.
2019-04-14 18:22:04 +01:00
rgriege a5b663f1b0 stb_truetype: update contributors list 2019-03-07 19:48:23 -06:00
rgriege 8ac257b00f stb_truetype: limit to 1 missing glyph in texture
When calling stbtt_PackFontRanges, multiple missing glyphs in the range
of codepoints will create multiple copies of the font's missing glyph to
be added to the pixel buffer.  Instead, the first codepoint that maps to the missing glyph will add it to the pixel buffer, and all subsequent glyphs will simply copy the stbtt_packedchar data to reference the same region of the buffer.

This does NOT prevent duplication in multiple calls to stbtt_PackFontRange(s) - that would require modifying the packing context, which could be nice but is a bit more intrusive.
2019-03-07 19:32:19 -06:00
kaesve f3ca0dd5ae Remove redundant scale check in stbtt_GetGlyphSDF 2019-03-06 18:34:31 +01:00
Sean Barrett c963e40972 update version numbers 2019-02-25 11:48:42 -08:00
Sean Barrett 5fe7fb52f2 various fixes for clang
also fix a comment typo
2019-02-25 11:10:54 -08:00
Fabian Giesen af43e6b006 stb_truetype: Fix warning in comment.
Replace ASCII art with slightly crappier ASCII art that is not
going to make compilers complain about trailing backslashes.

Fixes issue #707.
2019-02-23 05:33:20 -08:00
Sean Barrett 63b59b46b0 update version numbers 2019-02-07 10:03:00 -08:00
Sean Barrett 6244febf5f stb_truetype: tweaks to codepoint-missing packing 2019-02-07 09:33:54 -08:00
Sean Barrett 8cf07e85c8 rename stbtt_PackSetSkipMissingGlyphs to stbtt_PackSetSkipMissingCodepoints 2019-02-07 09:21:17 -08:00
Sean Barrett c35d1dd8ad stb_truetype: runtime selection of skipping missing codepoints 2019-02-07 09:20:11 -08:00
Sean Barrett eaf78c10b6 Merge branch 'truetype-skip_missing_glyphs' of https://github.com/ocornut/stb into working 2019-02-07 09:04:23 -08:00
Sean Barrett 09998eb596 Merge branch 'truetype-comment' of https://github.com/ocornut/stb into working 2019-02-07 06:05:47 -08:00
Sean Barrett 94f93a86e7 Merge branch 'truetype-warnings' of https://github.com/ocornut/stb into working 2019-02-07 06:02:51 -08:00
Sean Barrett 3005bcfe87 Merge branch 'misc-typos' of https://github.com/luzpaz/stb into working 2019-02-07 05:00:12 -08:00
Sean Barrett 27460c23a6 stb_truetype: allow getting font metrics without explicitly opening file 2019-02-07 04:41:26 -08:00
Omar 886cca8f15 stb_truetype: stbtt_PackFontRanges skip missing glyphs. 2018-05-07 16:29:36 +02:00
Omar Cornut cc99df4b48 stb_truetype: added comment about stbtt_FindGlyphIndex() return value. 2018-03-08 17:14:31 +01:00