Commit Graph

1363 Commits

Author SHA1 Message Date
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
Chris Speciale
a8939e9951 Merge pull request #1834 from gepatto/8.2.0-Dev
set correct paths for ndll for linxuarm and linuxarm64 (raspberrypi)
2024-10-22 07:17:56 -04:00
Josh Tynjala
a1dcad42df harfbuzz: update to 6.0.0
Needed for macOS when using Xcode 16 and clang 16. This version of clang produces errors like this when compiling harfbuzz:

cast from 'void (*)(FT_Face)' (aka 'void (*)(FT_FaceRec_ *)') to 'FT_Generic_Finalizer' (aka 'void (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]

This is the minimum version of harfbuzz that fixes the errors. We could certainly consider upgrading further (current release is 10.0.1 at the time of this commit).
2024-10-07 10:13:03 -07:00
Patrick Gutlich
40764acbf3 set correct paths for ndll for linxuarm and linuxarm64 (raspberrypi)
and remove conflicting legacy includepaths in build.xml
2024-08-18 17:12:47 +02:00
Joshua Granick
656c761cb0 Fix broken JPEG decoding (tested on Windows) 2024-07-09 13:27:54 -07:00
Josh Tynjala
8f3ea8d271 Merge branch 'develop' into 8.2.0-Dev 2024-07-08 14:31:23 -07:00
Josh Tynjala
84d7f39605 Revert "MacPlatform: use install_name_tool to add /usr/local/lib and /opt/hombrew/lib to rpath of lime.ndll"
This reverts commit 47936494ac.

Didn't work with Haxe/Neko installed from Apple Silicon Homebrew because Lime tools couldn't link to Neko.
2024-07-08 14:27:15 -07:00
tobil4sk
0ef949f865 Merge pull request #1472 from nixbody/cffi-unicode-fixes
UNICODE fixes (clipboard, window title, file dialogs, paths, font glyphs, ...)
2024-07-07 23:10:43 +01:00
Josh Tynjala
e257b7ebe4 Merge branch 'develop' into 8.2.0-Dev 2024-07-01 08:53:48 -07:00
Josh Tynjala
47936494ac MacPlatform: use install_name_tool to add /usr/local/lib and /opt/hombrew/lib to rpath of lime.ndll
Previously, we added these rpaths to lime.ndll when it was built in commits c70ec9f and 333d093, but it's actually necessary only for Neko, so now I made it happen specfically after calling `nekotools boot` to create the Neko executable.

I've tested cpp and hl, and I've confirmed that the executables still launch successfully when these rpaths are omitted. It's better for their security to use fewer rpaths.

As noted commit c70ec9f, adding these rpaths is necessary due to a change in Xcode 15 where /usr/local/lib used to be available on the rpath automatically, but now it isn't, which affects the executable's ability to find the libneko dylib.
2024-06-19 14:39:17 -07:00
player-03
c0ca857fa6 Merge pull request #1791 from player-03/CairoMatrix3
Create a placeholder object to send `Matrix3`s to C++ code.
2024-05-30 12:20:25 -04:00
tobil4sk
54d6b72390 Fix pixman build for m1 2024-05-30 09:18:09 -07:00
tobil4sk
1a1beff531 Remove no longer used defines
See cf5b033bbc
2024-05-30 09:18:09 -07:00
tobil4sk
f116b57c8e Adding missing RESTRICT define for openal
See e027811906
2024-05-30 09:18:09 -07:00
tobil4sk
53c9b52562 Apply openal build fixes for m1
https://github.com/openfl/libopenal/pull/1
2024-05-30 09:18:09 -07:00
Joseph Cloutier
43b56eb86d Fix potential uninitialized values. 2024-05-29 19:50:52 -04:00
Joseph Cloutier
d3d476a1f5 Merge branch 'develop' into 8.2.0-Dev 2024-05-27 16:04:31 -04:00
Tobi Laskowski
333d093df0 Build.xml: Add /opt/homebrew/lib as rpath on arm64 macos
This is where arm64 homebrew installs `libneko.dylib`. However, it may still be in `/usr/local/lib` if installed via the haxe .pkg installer, so we add both.
2024-05-15 09:18:39 -07:00
Josh Tynjala
c70ec9fbe0 Build.xml: on macOS, add /usr/local/lib to rpath when building lime.ndll
This seems to be required with Xcode 15, but was not required previously
2024-05-09 15:07:12 -07:00
Josh Tynjala
237c8c6357 update pixman to 0.42.2 to fix macOS builds
was running into this issue: https://issuetracker.google.com/issues/249834910
2024-04-19 09:26:10 -07:00
Joseph Cloutier
657ad24682 Merge branch 'develop' into 8.2.0-Dev 2024-04-13 03:09:20 -04:00
Tobi Laskowski
fc6b90538a Downgrade mbedtls to 2.28.7
On ios, we build statically linked executables. This means that if lime uses mbedtls 3, hxcpp is also forced to use it which can cause crashes and other problems, as hxcpp is currently written for 2.28
2024-03-11 12:41:07 -07:00
Joseph Cloutier
4819ff3b27 Make C++ mutex methods constant.
Closes #1729.

Co-authored-by: Diego Fonseca <fonseca.diego.feeshy@gmail.com>
2024-02-05 15:11:33 -05:00
player-03
7c50f6e9e9 Remove another unnecessary buffer copy.
Also, use `hxs_utf8()` for consistency.
2024-01-31 14:02:50 -05:00
player-03
590be2bbe6 Remove unnecessary string copy.
Casting `const char*` → `char*` is bad form, and we'd rather copy the string than do that. However, `GetGlyphIndex()` now takes a const, so neither workaround is needed.
2024-01-31 13:46:09 -05:00
Josh Tynjala
c3170a0577 Merge branch '8.2.0-Dev' into feature/hlc 2024-01-30 09:16:34 -08:00
Tobi Laskowski
1517bb3557 Clean up 2024-01-05 11:26:17 +00:00
player-03
79c4b05c06 Merge branch 'develop' into cffi-unicode-fixes 2024-01-05 00:03:31 -05:00