Commit Graph

200 Commits

Author SHA1 Message Date
Ron Tseytlin 7e34e0ad21 Improve justified text alignment 2024-12-16 21:46:22 +02:00
Sasha Szpakowski af35953fc1 improve text rendering consistency when using fractional DPI scales. 2024-07-08 22:55:48 -03:00
Sasha Szpakowski 7a4380514e Improve letter spacing and line heights of high dpi text.
resolves #1918
2024-07-07 16:54:18 -03:00
Labrium 85cd98ffe5 Fix mono and sdf rendermode conflicts 2024-06-22 18:13:47 -06:00
Labrium c52763d369 Remove stash artefacts 2024-06-22 17:10:52 -06:00
Labrium b98aced38d Move sdf option to settings table 2024-06-22 17:07:06 -06:00
Labrium 2eb8892ddf Merge branch 'love2d:main' into sdf-font-hintingmode 2024-06-22 13:20:46 -06:00
Sasha Szpakowski 1e97e09b28 Rework internal module registration to happen in constructors. 2024-02-24 15:21:38 -04:00
Sasha Szpakowski 007090af14 ImageData: remove automatic mutex locks. 2024-02-18 17:06:40 -04:00
Sasha Szpakowski 64a30f177f Merge branch 'main' into 12.0-development 2024-02-10 12:24:48 -04:00
Sasha Szpakowski 94d5864144 update year for copyright notice 2024-02-10 12:13:22 -04:00
Sasha Szpakowski 6aaf0b22bf Address some compiler warnings 2023-10-21 13:55:43 -03:00
Sasha Szpakowski 5a0a6a1a27 All constructors for making a TrueType font take an optional settings table.
This supersedes the existing optional hinting and dpi scale parameters. The table's fields are:
{
  hinting = "normal",
  dpiscale = 1, -- nil will default to the current window DPI scale.
}
2023-10-20 20:19:30 -03:00
Sasha Szpakowski 37b9d7db11 Merge branch 'main' into 12.0-development 2023-10-11 22:05:55 -03:00
Sasha Szpakowski ba693500c4 Fix love.font.newBMFontRasterizer when it's given a single file param. 2023-10-11 22:05:33 -03:00
Labrium f06ba8b926 Merge branch 'sdf-font-hintingmode' of https://github.com/Labrium/love into sdf-font-hintingmode 2023-10-05 20:12:28 -06:00
Labrium c3814bc66f Fix glyph rendering error for empty characters 2023-10-05 20:12:14 -06:00
Sasha Szpakowski 48e23a048d Improve text wrapping when multiple characters are combined into one glyph.
#1923
2023-09-08 22:38:17 -03:00
Labrium ee9e567e66 Merge branch '12.0-development' into sdf-font-hintingmode 2023-09-01 18:43:18 -06:00
Labrium 25c2a0ef72 Small tweak 2023-09-01 18:32:55 -06:00
Labrium fee3bf1a6c Fix build errors 2023-09-01 18:32:05 -06:00
Labrium 0abff326f9 Add SDF HintingMode 2023-09-01 15:33:28 -06:00
Sasha Szpakowski 8efcf27a6e Fix RTL text when fallback fonts are used.
Fixes #1937.
2023-06-03 18:08:22 -03:00
Sasha Szpakowski ee96b6fa68 Fix a crash when printing an empty string. 2023-02-11 15:55:49 -04:00
Sasha Szpakowski bb82a448be Fix another compile error with some compilers. 2023-01-03 20:35:31 -04:00
Sasha Szpakowski de2b986787 Code style fixes 2023-01-01 15:07:37 -04:00
Sasha Szpakowski 616ed0e7f8 Fix compile errors with some compilers. 2023-01-01 12:52:38 -04:00
Sasha Szpakowski 6f14a18da0 Update copyright year in TextShaper files 2023-01-01 12:20:01 -04: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 0b75f6cfa5 Missed some files... 2022-12-31 22:36:48 -04:00
Sasha Szpakowski c823dbca96 Update copyright year for 2023 2022-12-31 22:25:49 -04:00
Sasha Szpakowski 4ace4bc3b6 Initial fallback font support for Harfbuzz text shaping. 2022-12-31 21:45:12 -04:00
Sasha Szpakowski 9502942b7b font rendering: reimplement tab-as-spaces support. 2022-12-28 19:46:48 -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
Alex Szpakowski 7f3538d2ba Merge branch 'main' into 12.0-development 2022-01-05 21:10:27 -04:00
Alex Szpakowski 8e7fd10b6f Update copyright year for 2022 2021-12-31 18:33:40 -04:00
Alex Szpakowski 9b4aea8f17 Missed some copyright date updates 2021-04-07 20:34:24 -03:00
Alex Szpakowski 21f5ba86d3 Merge branch 'master' into 12.0-development 2021-04-07 20:33:44 -03:00
Alex Szpakowski f89aabb0bb Update copyright year for 2021 2021-04-04 16:14:45 -03:00
Alex Szpakowski ac524e681a Change the default font from Vera size 12 to Noto Sans size 13.
Resolves issue #1075.
2020-02-17 01:55:49 -04:00
Alex Szpakowski 12c90b3dca Merge Image and Canvas GL backend classes into new common Texture class. 2020-02-07 20:29:21 -04:00
Alex Szpakowski 5f9b5a21d0 Merge default into minor
--HG--
branch : minor
2020-01-03 22:45:36 -04:00
Alex Szpakowski fc4847c69d Update copyright for the new year 2020-01-03 22:40:36 -04:00
Alex Szpakowski f3b52f66fe Update the internal naming convention for pixel formats.
--HG--
branch : minor
2019-12-23 23:38:04 -04:00
Alex Szpakowski 9ab2a94037 Rename internal C++ Color struct to Color32 to help differentiate it from Colorf. 2019-09-14 23:13:40 -03:00
Alex Szpakowski cb4b45dcf1 Add Data:getFFIPointer. Similar to Data:getPointer but returns a cdata pointer directly (or nil if the FFI isn't available).
It should be preferred instead of Data:getPointer because the latter uses lightuserdata which can't store more all possible memory addresses on some new arm64 architectures, when LuaJIT is used.
2019-07-20 10:47:58 -03:00
Alex Szpakowski 0752f27bdf Update copyright year for 2019 2019-01-03 21:09:05 -04:00
Bart van Strien e80247c191 Happy new year! 2018-01-03 19:47:35 +01:00
Bart van Strien 9e4374935d Show (short) list of possible enum values when an invalid value is encountered (resolves #1318)
All enum errors have (hopefully) been changed to a luax_enumerror, which has a
fixed error message. If additionally a list of valid options is passed, it
lists that in the error message. For every enum error with few options I've
implemented this using a getConstants call.

This solution has been designed specifically to reduce the number of template
instantiations (as I've been told that was a concern). All new template code
happens in places where there already was an instantiation of the relevant
StringMap. Of course there is still std::vector<std::string>...

--HG--
branch : minor
2017-10-02 17:11:53 +02:00