Skip to content

Commit cf72dc1

Browse files
sebgodclaude
andcommitted
Publish as SharpAstro.FreeType, target .NET 10, bump to 3.2.0
Rename package ID from FreeTypeSharp to SharpAstro.FreeType. Update repository URL, description, and tags for COLRv1 support. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5b82775 commit cf72dc1

File tree

3 files changed

+111
-17
lines changed

3 files changed

+111
-17
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ jobs:
2020
include:
2121
- { os: windows-latest, rid: win-x64, cmake_extra: "-A x64" }
2222
- { os: windows-latest, rid: win-x86, cmake_extra: "-A Win32" }
23-
- { os: windows-latest, rid: win-arm64, cmake_extra: "-A ARM64" }
23+
- { os: windows-11-arm, rid: win-arm64, cmake_extra: "" }
2424
- { os: ubuntu-latest, rid: linux-x64, cmake_extra: "" }
2525
- { os: ubuntu-24.04-arm, rid: linux-arm64, cmake_extra: "" }
26-
- { os: macos-latest, rid: osx, cmake_extra: "-DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' -DFT_DISABLE_PNG=ON" }
26+
- { os: macos-latest, rid: osx-arm64, cmake_extra: "-DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=11" }
27+
- { os: macos-latest, rid: osx-x64, cmake_extra: "-DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET=11 -DFT_DISABLE_PNG=ON" }
2728

2829
runs-on: ${{ matrix.os }}
2930
steps:
@@ -35,6 +36,11 @@ jobs:
3536
if: runner.os == 'Linux'
3637
run: sudo apt-get update && sudo apt-get install -y libpng-dev zlib1g-dev
3738

39+
- name: Apply Win64 patch (FT_Long as int64)
40+
if: runner.os == 'Windows'
41+
shell: bash
42+
run: git apply patches/0001-Win64-FT_Long-as-int64.patch --directory=freetype
43+
3844
- name: Configure FreeType
3945
run: cmake -S freetype -B freetype/build ${{ env.FREETYPE_CMAKE_FLAGS }} ${{ matrix.cmake_extra }}
4046

@@ -86,18 +92,21 @@ jobs:
8692
with:
8793
path: native-artifacts
8894

95+
- name: Create macOS fat library
96+
run: lipo -create native-artifacts/native-osx-arm64/libfreetype.dylib native-artifacts/native-osx-x64/libfreetype.dylib -output native-artifacts/libfreetype.dylib
97+
8998
- name: Place native binaries in runtimes
9099
run: |
91-
cp native-artifacts/native-win-x64/freetype.dll runtimes/FreeType2/win-x64/freetype.dll
92-
cp native-artifacts/native-win-x86/freetype.dll runtimes/FreeType2/win-x86/freetype.dll
93-
cp native-artifacts/native-win-arm64/freetype.dll runtimes/FreeType2/win-arm64/freetype.dll
94-
cp native-artifacts/native-linux-x64/libfreetype.so runtimes/FreeType2/linux-x64/libfreetype.so
100+
cp native-artifacts/native-win-x64/freetype.dll runtimes/FreeType2/win-x64/freetype.dll
101+
cp native-artifacts/native-win-x86/freetype.dll runtimes/FreeType2/win-x86/freetype.dll
102+
cp native-artifacts/native-win-arm64/freetype.dll runtimes/FreeType2/win-arm64/freetype.dll
103+
cp native-artifacts/native-linux-x64/libfreetype.so runtimes/FreeType2/linux-x64/libfreetype.so
95104
cp native-artifacts/native-linux-arm64/libfreetype.so runtimes/FreeType2/linux-arm64/libfreetype.so
96-
cp native-artifacts/native-osx/libfreetype.dylib runtimes/FreeType2/osx/libfreetype.dylib
105+
cp native-artifacts/libfreetype.dylib runtimes/FreeType2/osx/libfreetype.dylib
97106
# Also copy to win10 runtimes
98-
cp native-artifacts/native-win-x64/freetype.dll runtimes/FreeType2/win10-x64/freetype.dll
99-
cp native-artifacts/native-win-x86/freetype.dll runtimes/FreeType2/win10-x86/freetype.dll
100-
cp native-artifacts/native-win-arm64/freetype.dll runtimes/FreeType2/win10-arm64/freetype.dll
107+
cp native-artifacts/native-win-x64/freetype.dll runtimes/FreeType2/win10-x64/freetype.dll
108+
cp native-artifacts/native-win-x86/freetype.dll runtimes/FreeType2/win10-x86/freetype.dll
109+
cp native-artifacts/native-win-arm64/freetype.dll runtimes/FreeType2/win10-arm64/freetype.dll
101110
102111
- name: Pack NuGet
103112
run: dotnet pack FreeTypeSharp/FreeTypeSharp.csproj -c $BUILD_CONF -p:PackageVersion=$VERSION_PREFIX

FreeTypeSharp/FreeTypeSharp.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@
2626
</PropertyGroup>
2727

2828
<PropertyGroup>
29-
<PackageProjectUrl>https://github.com/ryancheung/FreeTypeSharp</PackageProjectUrl>
30-
<RepositoryUrl>https://github.com/ryancheung/FreeTypeSharp</RepositoryUrl>
31-
<Authors>ryancheung</Authors>
29+
<PackageProjectUrl>https://github.com/SharpAstro/FreeType</PackageProjectUrl>
30+
<RepositoryUrl>https://github.com/SharpAstro/FreeType.git</RepositoryUrl>
31+
<Authors>ryancheung;SharpAstro</Authors>
3232
<PackageReadmeFile>README.md</PackageReadmeFile>
3333
<PackageLicenseExpression>MIT</PackageLicenseExpression>
34-
<Description>A modern cross-platform managed FreeType2 library.</Description>
35-
<PackageTags>freetype2;netstandard2.0;.net10.0;</PackageTags>
36-
<PackageId>FreeTypeSharp</PackageId>
37-
<Copyright>Copyright 2024 ryancheung</Copyright>
34+
<Description>Cross-platform managed FreeType2 library with COLRv1 color glyph support. Fork of FreeTypeSharp with FreeType 2.14.2.</Description>
35+
<PackageTags>freetype2;netstandard2.0;.net10.0;colrv1;color-emoji</PackageTags>
36+
<PackageId>SharpAstro.FreeType</PackageId>
37+
<Copyright>Copyright 2024 ryancheung, 2026 SharpAstro</Copyright>
3838
</PropertyGroup>
3939

4040
<ItemGroup>
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
From 92900076c55cd35cd8a327bf009cd1f8beebb479 Mon Sep 17 00:00:00 2001
2+
From: ryancheung <ryancheung.go@gmail.com>
3+
Date: Fri, 20 Mar 2020 18:23:38 +0800
4+
Subject: [PATCH] Win64 patch
5+
6+
---
7+
include/freetype/ftimage.h | 6 +++++-
8+
include/freetype/fttypes.h | 24 ++++++++++++++++++++----
9+
2 files changed, 25 insertions(+), 5 deletions(-)
10+
11+
diff --git a/include/freetype/ftimage.h b/include/freetype/ftimage.h
12+
index face34f..96a76a4 100644
13+
--- a/include/freetype/ftimage.h
14+
+++ b/include/freetype/ftimage.h
15+
@@ -55,7 +55,11 @@ FT_BEGIN_HEADER
16+
* the context, these can represent distances in integer font units, or
17+
* 16.16, or 26.6 fixed-point pixel coordinates.
18+
*/
19+
- typedef signed long FT_Pos;
20+
+#if _WIN64
21+
+ typedef signed __int64 FT_Pos;
22+
+#else
23+
+ typedef signed long FT_Pos;
24+
+#endif
25+
26+
27+
/**************************************************************************
28+
diff --git a/include/freetype/fttypes.h b/include/freetype/fttypes.h
29+
index 1057150..3c2906a 100644
30+
--- a/include/freetype/fttypes.h
31+
+++ b/include/freetype/fttypes.h
32+
@@ -239,7 +239,11 @@ FT_BEGIN_HEADER
33+
* @description:
34+
* A typedef for signed long.
35+
*/
36+
- typedef signed long FT_Long;
37+
+#if _WIN64
38+
+ typedef signed __int64 FT_Long;
39+
+#else
40+
+ typedef signed long FT_Long;
41+
+#endif
42+
43+
44+
/**************************************************************************
45+
@@ -250,7 +254,11 @@ FT_BEGIN_HEADER
46+
* @description:
47+
* A typedef for unsigned long.
48+
*/
49+
- typedef unsigned long FT_ULong;
50+
+#if _WIN64
51+
+ typedef unsigned __int64 FT_ULong;
52+
+#else
53+
+ typedef unsigned long FT_ULong;
54+
+#endif
55+
56+
57+
/**************************************************************************
58+
@@ -272,7 +280,11 @@ FT_BEGIN_HEADER
59+
* @description:
60+
* A signed 26.6 fixed-point type used for vectorial pixel coordinates.
61+
*/
62+
- typedef signed long FT_F26Dot6;
63+
+#if _WIN64
64+
+ typedef signed __int64 FT_F26Dot6;
65+
+#else
66+
+ typedef unsigned long FT_F26Dot6;
67+
+#endif
68+
69+
70+
/**************************************************************************
71+
@@ -284,7 +296,11 @@ FT_BEGIN_HEADER
72+
* This type is used to store 16.16 fixed-point values, like scaling
73+
* values or matrix coefficients.
74+
*/
75+
- typedef signed long FT_Fixed;
76+
+#if _WIN64
77+
+ typedef signed __int64 FT_Fixed;
78+
+#else
79+
+ typedef unsigned long FT_Fixed;
80+
+#endif
81+
82+
83+
/**************************************************************************
84+
--
85+
2.19.0.windows.1

0 commit comments

Comments
 (0)