Commit Graph

1390 Commits

Author SHA1 Message Date
Josh Tynjala
97466c6360 png 1.6.46
Upgrading required to compile with latest Xcode and macOS SDK
2025-04-14 15:28:01 -07:00
Josh Tynjala
241edd9d10 efsw 1.4.1
Upgrading required to compile with latest Xcode and macOS SDK
2025-04-14 15:27:24 -07:00
Chris Speciale
236e143a8e [fix] Extract values before locking to avoid deadlock with GC
Attempts to fix reported freezes/crashes related to possible gc contention related to: https://github.com/openfl/lime/issues/1943
2025-04-10 11:20:12 -04:00
Barış Yıldırım
12d3ee5916 curl encoding support added 2025-03-21 10:56:23 -04:00
Tobiasz Laskowski
52072d1f21 Apply -std=c++11 to openal-soft build on android
openal-soft assumes that aligned_alloc is available with c++17. Newer
android ndks set c++17 by default, however they do not expose
aligned_alloc without setting min sdk version to 28.

We can avoid this issue by forcing openal to be compiled with c++11.

Also note, we have HXCPP_CPP11 defined, however, hxcpp ignores this for
the android toolchain.  This means we must set it explicitly

See:
f5e0eef34d/common/almalloc.cpp (L15)
2025-03-14 10:04:25 +00:00
Chris Speciale
20c9bec3bc Update Build.xml
Hxcpp doesn't respect HXCPP_CPP11 for android. We can avoid this issue just by adding -std=c++11 here. This resolves a conflict with openal soft 1.20.1 for android builds. This works because the library assumes c++17 and invokes a function that isn't available in android sdk below 28.
2025-03-14 05:29:18 -04:00
Chris Speciale
63b9a88e34 Merge pull request #1921 from tobil4sk/fix/get_glyphs_infinite_loop
Fix Font.getGlyphs returning zeros and looping
2025-03-11 01:34:41 -04:00
Tobiasz Laskowski
23b90dff3f Fix loop in GetGlyphIndices with invalid input
If the text is invalid, then readNextChar returns -1 and does not
progress to the next character. This previously meant that we got stuck
and looped indefinitely.
2025-03-11 01:23:29 +00:00
Tobiasz Laskowski
f495b777ab Remove old comment for hl GetGlyphIndices
The array size is already determined by the first loop
2025-03-11 01:19:58 +00:00
Tobiasz Laskowski
6283017adb Fix GetGlyphIndices returning array of 0 on hl
Previously, the first for loop would reach the end of the characters, so
no further characters were read in the second loop. This meant that the
array remained filled with 0 values.
2025-03-11 01:19:43 +00:00
Tobiasz Laskowski
70e55b1fa5 Fix rebuild warning about unknown option on msvc
cl : Command line warning D9002 : ignoring unknown option '-std=c11'
2025-03-10 14:20:55 -07:00
Tobiasz Laskowski
0ca7c392e0 Fix length for hl_hb_buffer_add_utf8
This function wants the utf8 length, but text->length does not give
this. We can instead use -1 to tell harfbuzz to treat it as null-
terminating, which is the case with all hashlink strings anyway.
2025-03-10 01:45:37 +00:00
Tobiasz Laskowski
504df5e0d0 Add missing utf8 conversion for hb_buffer_add_utf8
A HxString is not guaranteed to be utf8 on hxcpp, so we need to use
hxs_utf8 to convert it otherwise it incorrectly displays any utf16
encoded string.

Unfortunately, hxs_utf8 doesn't give us the length of the utf8 string.
The best thing we can do is to tell harfbuzz it is null terminated. This
isn't perfect because technically hxcpp strings are allowed to contain
NULL, but it's better than all utf16 strings being broken.
2025-03-10 01:17:41 +00:00
Tobiasz Laskowski
00edf47529 Add support for linking mbedtls on latest hxcpp
The latest hxcpp makes it easier to link against the internal mbedtls,
however we still need backwards compatibility.

https://github.com/HaxeFoundation/hxcpp/pull/1133
2025-02-10 09:24:47 -08:00
Tobiasz Laskowski
c9ad850578 Update curl submodule
Hxcpp's mbedtls has MBEDTLS_NET_C disabled, which meant that older
versions of curl which use this feature cannot be linked against it.
This version of curl no longer requires this feature, which avoids the
issue.
2025-02-10 09:24:47 -08:00
Tobiasz Laskowski
7df96b53d7 Support hxcpp older than 4.3.0 for mbedtls linking
Hxcpp 4.3.0 has an mbedtls_config.h file in ${HXCPP}/src/hx/libs/ssl,
which we have to ensure is included, but older versions do not.

To support both 4.3.0 and older versions, we can add an empty
mbedtls_config.h and add the include path at the end. This way it will
only be used if it does not exist in the previous include paths.
2025-02-10 09:24:47 -08:00
Tobiasz Laskowski
22fb016d95 Link against hxcpp's mbedtls in static builds
This avoids lime's mbedtls overwriting hxcpp's, which has caused issues
in the past.
2025-02-10 09:24:47 -08:00
Tobiasz Laskowski
5fd2b560c4 Add missing harfbuzz hb-face-builder file 2025-01-29 01:28:22 +00:00
Tobiasz Laskowski
a9347de8ce Update hb-coretext to hb-coretext-shape
The name of this file was changed, see:
064b24177b
2025-01-28 13:04:18 -08:00
Tobiasz Laskowski
077ba7e5ca Update harfbuzz to 10.2.0 2025-01-28 13:04:18 -08:00
Chris Speciale
8af219fb54 Merge pull request #1899 from tobil4sk/fix/update-cairo
Update cairo to 1.18.2
2025-01-28 01:41:24 -05:00
Tobiasz Laskowski
65e2c6ba45 Add missing files to freetype build
These are required by newer versions of cairo
2025-01-27 19:12:06 +00:00
Tobiasz Laskowski
9bda9ecb32 Update cairo to 1.18.2
The previous version 1.17.6 was an unstable snapshot release. Updating
to 1.18.2 seems to resolve some font size bugs on windows.
2025-01-27 19:12:06 +00:00
Josh Tynjala
44dd331801 libjpeg: fix rendering on 32-bit platforms
Fixes SIZEOF_SIZE_T on 32-bit platforms that should be 4 instead of 8

Tested on Windows x86_32 and Android armv7
2025-01-07 09:43:21 -08:00
ACrazyTown
45505f433a Fix ImageDataUtil.copyPixels crash on Hashlink (#1875)
* Fix copyPixels crash on Hashlink

* Move nullcheck to C++

* Simplify further

* Avoid unneccessary object allocation

* Formatting

* Simplify by using an if statement
2024-12-16 07:41:37 -08:00
Josh Tynjala
9c4fa35361 Font: a little extra null safety for hhea and os2 font data, just to be safe
Followup to 62ab8eb6fc
2024-12-13 14:46:58 -08:00
Josh Tynjala
0db3c7c095 Font: experimental LIME_FREETYPE_SWF_METRICS define that more closely matches SWF behavior for font metrics like ascent/descent
We're currently using freetype 2.9.1's algorithm for choosing font metrics, but it's not exactly the same as SWF (but it is closer than freetype 2.10's new algorithm).

This algorithm should more closely match the font metrics used by AS3 compilers when embedding fonts with [Embed] metadata in AS3.
2024-12-13 14:26:38 -08:00
Josh Tynjala
62ab8eb6fc Font: fall back to using freetype's 2.9.1 algorithm for calculating font metrics like ascent/descent
This allows us to upgrade freetype beyond 2.9.1 (actually, 2.8.1 due to a bug in freetype 2.9) without wildly different font metrics. The reason that we don't want to change font metrics algorithms is that freetype's new algorithm is very different than the algorithm used for SWF fonts. The older freetype algorithm is closer to SWF, so we want to stick with it.

Thankfully, freetype supports accessing various metrics stored in font files in a more raw form, so we can provide our own custom algorithm in a way that is fully supported by freetype. I just copied the existing algorithm straight from 2.9.1 to restore our preferred behavior.

I confirmed that, after this change, OpenFL renders metrics like Lime 8.1.3. But we have the same upgraded freetype as Lime 8.2.0 that we had to revert for 8.2.1.

I plan to experiment with a mode that matches SWF even more closely, now that I have a better understanding of how fonts and freetype work.
2024-12-13 13:47:19 -08:00
Josh Tynjala
27d1d8b9d4 Revert "freetype: roll back to freetype version 2.9.1"
This reverts commit c4faf58ff0.
2024-12-13 13:37:16 -08:00
Josh Tynjala
90b2b1fa80 Revert "freetype: roll back to 2.8.1 to fix issues with character spacing"
This reverts commit ac3040c1ed.
2024-12-13 13:36:56 -08:00
Josh Tynjala
ac3040c1ed freetype: roll back to 2.8.1 to fix issues with character spacing 2024-12-12 10:41:08 -08:00
Joseph Cloutier
a03c0c31f3 Fix whitespace. 2024-11-19 20:09:22 -05:00
win11
c0e1a1b4a4 Clean up PNG and JPEG encoding properly 2024-11-19 14:45:25 -08:00
Josh Tynjala
68f531eaba openal: custom version.h was not updated when switching to new version 2024-11-11 14:20:55 -08:00
Chris Speciale
6de4b67620 CFFI fix
Accept 3 values instead of 2. Incidentally, I thought this was going to be a rather simple straightforward change, but I suppose not.
2024-10-30 13:23:37 -04:00
Chris Speciale
d2562997bf Update CairoBindings to use a default of 72 dpi for fonts
We use a default of 72 for now to ensure text is formatted correctly. Not entirely sure why we are stuck on 72 but that is an investigation for the future.
2024-10-30 13:14:32 -04:00
Chris Speciale
579efa5351 Font: Allow setting dpi internally
This fixes some unexpected changes in text rendering for OpenFL which rely on a private function in Lime. Previously we defaulted at 72 dpi, which apparently is expected to layout the text properly. Most displays are 96 dpi or higher today, so we should probably look into this. For RenderGlyph, which was previously broken over several versions, we will now use a dpi of 96 for now. In the next version of lime, we absolutely should alter the function signature to allow for renderGlyph to accept a dpi argument.
2024-10-30 12:49:30 -04:00
Chris Speciale
dbfd6615c0 Merge branch 'develop' of https://github.com/openfl/lime into develop 2024-10-30 12:20:14 -04:00
Chris Speciale
e6fa4e73d4 Revert "SetSize should use 96 dpi for now"
This reverts commit 9cbdc83605.
2024-10-30 12:12:58 -04:00
Josh Tynjala
c4faf58ff0 freetype: roll back to freetype version 2.9.1
tag VER-2-9-1

Starting with freetype 2.10.0, the sum of the ascent and descent values seem to be more likely to be less than the baseline-to-baseline measurement (called the font's height), which is the font designer's recommend distance between baselines. However, OpenFL doesn't account for the full baseline-to-baseline height at all, so with smaller ascent and descent values, lines render with smaller gaps between them. OpenFL needs to update its TextEngine algorithm to use the height of the line instead of adding ascent and descent together alone, and then we can update freetype. Updating TextEngine is not a trivial change, and may likely require time to discover bugs and stabilize, so it's better to roll back the freetype update for now, and apply it again later after OpenFL can handle it properly.
2024-10-29 15:48:38 -07:00
Chris Speciale
e65e863918 Native RenderGylph should handle alpha properly 2024-10-28 23:38:18 -04:00
Chris Speciale
9cbdc83605 SetSize should use 96 dpi for now
I think it should probably use 96 dpi instead of 72.... In the next minor version of Lime I think we should change the function sig to allow a dpi argument.
2024-10-28 23:02:28 -04:00
Chris Speciale
4673b91c65 Fix RenderGlyph
We change the way RenderGlyph populates the binary data here. It's a little heavier than the 8-bit method used previously but I was having issues getting that to work properly with `Image`.
2024-10-28 22:51:15 -04:00
Chris Speciale
6a4099861e OpenALBindings: Avoid deadlock when Sys.exit() is called
This change eliminates the cleanup attempt of the current OpenAL context and associated system resources. A change in OpenAL 1.20.0 made it unlikely that we will be able to clean up things in this way moving forward. We should steer users toward using `lime.system.System.exit()` or petition a change in the haxe stdlib to allow us to hook into Sys.exit(). 

I am not 100% satisfied with this, so perhaps we will find another solution. In the end, I think the benefit of updating OpenAL supersedes any inconvenience here.

Closes https://github.com/openfl/lime/issues/1803
2024-10-25 11:08:15 -04:00
Chris Speciale
e24ab07125 Revert "Downgrade to OpenAL 1.20.0"
This reverts commit 54f7734d7f.
2024-10-23 23:39:25 -04:00
Chris Speciale
a5d980cf75 Revert "Remove missing file path"
This reverts commit f60d8a75c5.
2024-10-23 23:39:20 -04:00
Chris Speciale
2ae713d180 Revert "Downgrade OpenAL to 1.19.1"
This reverts commit 583e742734.
2024-10-23 23:39:11 -04:00
Chris Speciale
583e742734 Downgrade OpenAL to 1.19.1
This still solves https://github.com/kcat/openal-soft/pull/227 which seems to be fixed in 1.19.1
2024-10-23 22:31:09 -04:00
Chris Speciale
f60d8a75c5 Remove missing file path
Removes an expected file introduced in 1.20.1
2024-10-23 21:25:05 -04:00
Chris Speciale
54f7734d7f Downgrade to OpenAL 1.20.0 2024-10-23 21:22:56 -04:00