Commit Graph

14 Commits

Author SHA1 Message Date
Sasha Szpakowski 52c6b886cf TextBatch:getWidth/getHeight can return fractional numbers 2026-06-21 20:38:25 -03:00
John Doe fc5eeb11a3 Fix copyright notice date 2026-01-21 18:49:11 +00:00
Sasha Szpakowski 4e266c15a0 Fix TextBatch:add erasing old data when the internal buffer is recreated.
Fixes #2243.
2025-11-27 21:07:12 -04:00
John Doe 6f08eb94c6 Update copyright notice with correct year 2025-07-12 23:19:22 +01:00
Sasha Szpakowski bd6c90b65d Fix a memory leak in TextBatch:add when the internal buffer is resized 2024-12-09 18:32:17 -04:00
Sasha Szpakowski 50ff1e4d2b use location numbers for vertex input attributes, instead of name-based binding.
- add 'location' named field to buffer and mesh vertex format tables, replaces 'name' field.
- location numbers are expected to match 'layout (location = #)' qualifiers in vertex inputs in shader code.
- deprecate vertex inputs in shader code that don't have layout location qualifiers.
- love's default vertex attributes use location 0 for position, 1 for texcoord, and 2 for color.
- add new variants of Mesh:attachAttribute, setAttributeEnabled, and isAttributeEnabled which take location numbers instead of names.

Improves draw performance in vulkan and metal backends.
2024-09-07 18:06:03 -03:00
Sasha Szpakowski 5112345893 Fix the first TextBatch:set call uploading vertices twice. 2024-06-18 22:19:40 -03:00
Sasha Szpakowski 64a30f177f Merge branch 'main' into 12.0-development 2024-02-10 12:24:48 -04:00
Sasha Szpakowski 8872497561 graphics: handle default textures in high level code.
Previously each backend had to set up default textures with its own code, which needs some care for it to be robust.
2023-12-27 21:28:02 +01:00
Sasha Szpakowski 90b22f7d42 Fix love.graphics.draw(TextBatch) accessing an invalid pointer.
Fixes #1922.
Fixes #1914.
2023-04-22 21:59:15 -03:00
Sasha Szpakowski d085f44e6a Merge branch '12.0-development' into text-shaping 2023-01-01 12:18:54 -04:00
Sasha Szpakowski f6cdbdc868 Merge branch 'main' into 12.0-development 2022-12-31 22:46:34 -04:00
Sasha Szpakowski 7a0f6621e7 Initial (WIP) Harfbuzz text shaping integration.
This a significant refactor / rewrite of much of the love.graphics Font code.
Text positioning is now split into TextShaper classes in the love.font module. This isn't exposed to users yet.
BMFonts and ImageFonts use the same text shaping as before (in the new TextShaper API). Fonts loaded via FreeType now use Harfbuzz for text shaping.

The new code isn't at feature-parity with the old code yet. Harfbuzz-based text shaping enables kerning support in more fonts, character combining into ligature glyphs, and directions other than left-to-right (this isn't supported in love yet).
2022-12-26 19:06:08 -04:00
Sasha Szpakowski f17d3d94f1 Rename love.graphics Text objects to TextBatch.
The name Text is too generic compared to what they're designed for, it made people unnecessarily confused about their purpose.
2022-12-08 18:46:44 -04:00