[v1.1.0] Add OSX builds.
This commit is contained in:
parent
1d9f7d2ae6
commit
b077e06765
@ -2,7 +2,9 @@ cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
project(quik_stbi LANGUAGES C VERSION 1.0)
|
||||
|
||||
if (NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin"))
|
||||
add_compile_options(-static-libgcc)
|
||||
endif()
|
||||
|
||||
add_library(stbi SHARED "quik_stbi.c")
|
||||
install(
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit d9c98b5cdc37b2ba1855c8fa9ce0fac8266b0f89
|
||||
Subproject commit fdfac9d95134fb5637bb2a9ec98ee11fe188230e
|
@ -1,72 +0,0 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using Quik.Stb;
|
||||
|
||||
namespace Quik.Stb
|
||||
{
|
||||
[TestClass]
|
||||
[TestCategory("Load Font")]
|
||||
public class LoadFont
|
||||
{
|
||||
StbFont? font;
|
||||
|
||||
[TestInitialize]
|
||||
public void Initialize()
|
||||
{
|
||||
using (Stream? str = GetType().Assembly.GetManifestResourceStream("Quik.Stb.Tests.res.Varicka.ttf"))
|
||||
{
|
||||
Assert.IsNotNull(str, "Test font file not packed.");
|
||||
font = StbFont.Load(str);
|
||||
}
|
||||
}
|
||||
|
||||
[TestCleanup]
|
||||
public void Deinitialize()
|
||||
{
|
||||
font?.Dispose();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void AscendIsValid()
|
||||
{
|
||||
Assert.AreNotEqual(-1, font!.Ascend);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void DescendIsValid()
|
||||
{
|
||||
Assert.AreNotEqual(-1, font!.Descend);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void VLineGapIsValid()
|
||||
{
|
||||
Assert.AreNotEqual(-1, font!.VerticalLineGap);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void BBoxIsValid()
|
||||
{
|
||||
Assert.AreNotEqual(default, font!.BoundingBox);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void KerningTableIsValid()
|
||||
{
|
||||
Assert.IsNotNull(font!.KerningTable);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void GetGlyphsForAscii()
|
||||
{
|
||||
for (int i = 0; i < 128; i++)
|
||||
{
|
||||
int glyph = font!.FindGlyphIndex(i);
|
||||
|
||||
Assert.AreNotEqual(-1, glyph);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System.IO;
|
||||
|
||||
namespace Quik.Stb.Tests
|
||||
{
|
||||
[TestClass]
|
||||
[TestCategory("Load Image")]
|
||||
public class LoadImage
|
||||
{
|
||||
[TestMethod("Set Global Options")]
|
||||
public void SetGlobals()
|
||||
{
|
||||
Quik.Stb.StbImage.FlipVerticallyOnLoad = true;
|
||||
Quik.Stb.StbImage.UnpremultiplyOnLoad = true;
|
||||
}
|
||||
|
||||
private Stream GetImage(string path)
|
||||
{
|
||||
Stream? str = GetType().Assembly.GetManifestResourceStream(path);
|
||||
Assert.IsNotNull(str, $"Could not find test image resource {path}.");
|
||||
return str;
|
||||
}
|
||||
|
||||
private unsafe void TestImage(string path, int width, int height)
|
||||
{
|
||||
StbImage image = StbImage.Load(GetImage(path));
|
||||
|
||||
Assert.IsNotNull(image);
|
||||
|
||||
Assert.AreEqual(width, image.Width, "Width does not match.");
|
||||
Assert.AreEqual(height, image.Height, "Height does not match.");
|
||||
|
||||
image.Dispose();
|
||||
}
|
||||
|
||||
const int WIDTH = 768;
|
||||
const int HEIGHT = 512;
|
||||
|
||||
[TestMethod("Load a single frame GIF")]
|
||||
public unsafe void LoadGif() => TestImage("Quik.Stb.Tests.res.kodim.kodim23.gif", WIDTH, HEIGHT);
|
||||
[TestMethod("Load a JPEG")]
|
||||
public unsafe void LoadJpg() => TestImage("Quik.Stb.Tests.res.kodim.kodim23.jpg", WIDTH, HEIGHT);
|
||||
[TestMethod("Load a PNG")] public unsafe void LoadPng() => TestImage("Quik.Stb.Tests.res.kodim.kodim23.png", WIDTH, HEIGHT);
|
||||
}
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="res/**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="LoadFont.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
|
||||
<PackageReference Include="coverlet.collector" Version="3.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!--<ProjectReference Include="..\..\Quik.StbTrueType\Quik.StbTrueType.csproj" />-->
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
Binary file not shown.
@ -1,12 +0,0 @@
|
||||
Varicka (Truetype and Opentype with no OT features)
|
||||
|
||||
Based on 'Varick', from "Decorative Condensed Alphabets", by Dan Solo, Page 94.
|
||||
|
||||
Letter spacing is set to balance the letterforms themselves; the space between most adjacent letters is identical to the horizontal space inside such letters as 'O' and 'H'. Kerning is supplied as needed for certain letter combinations, particularly those that have a letter with a projection on the left, such as A, E, F, H, K, P, and R.
|
||||
|
||||
Varicka is superficially similar to Red Rooster's Triple Gothic Condensed, but the Solo book's font has different features and some very different letterforms.
|
||||
|
||||
This font is free and available for all use, personal and commercial, with no restrictions.
|
||||
|
||||
Character
|
||||
February 13, 2010
|
@ -1,3 +0,0 @@
|
||||
Kodak Image Suite Test Images owned by Kodak. Image 23 was taken by Steve Kelly.
|
||||
The original image file kodim23.png and its derivatives are only included for
|
||||
test purposes only and should not be redistributed with the software.
|
Binary file not shown.
Before Width: | Height: | Size: 156 KiB |
Binary file not shown.
Before Width: | Height: | Size: 97 KiB |
Binary file not shown.
Before Width: | Height: | Size: 544 KiB |
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 55 KiB |
@ -12,7 +12,7 @@
|
||||
<!-- Nuget Properties. -->
|
||||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
||||
<PackageId>Quik.StbImage</PackageId>
|
||||
<Version>1.0.0</Version>
|
||||
<Version>1.1.0</Version>
|
||||
<Authors>STBI Authors, H. Utku Maden</Authors>
|
||||
<Description>
|
||||
A C# wrapper for the ubiquitous Stb Image library.
|
||||
@ -56,6 +56,16 @@
|
||||
<Pack>true</Pack>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="runtimes/osx-x64/native/*.dll">
|
||||
<PackagePath>runtimes/osx-x64/native/</PackagePath>
|
||||
<Pack>true</Pack>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="runtimes/osx-arm64/native/*.dll">
|
||||
<PackagePath>runtimes/osx-arm64/native/</PackagePath>
|
||||
<Pack>true</Pack>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -5,8 +5,6 @@ VisualStudioVersion = 17.5.002.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Quik.StbImage", "Quik.StbImage.csproj", "{C808B4BC-C3AF-4682-8EDA-EAAC780800C3}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Quik.StbImage.Tests", "Quik.StbImage.Tests\Quik.StbImage.Tests.csproj", "{6FC081AA-93EA-468C-8C23-C1D7AC459321}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@ -17,10 +15,6 @@ Global
|
||||
{C808B4BC-C3AF-4682-8EDA-EAAC780800C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C808B4BC-C3AF-4682-8EDA-EAAC780800C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C808B4BC-C3AF-4682-8EDA-EAAC780800C3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6FC081AA-93EA-468C-8C23-C1D7AC459321}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6FC081AA-93EA-468C-8C23-C1D7AC459321}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6FC081AA-93EA-468C-8C23-C1D7AC459321}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6FC081AA-93EA-468C-8C23-C1D7AC459321}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -19,7 +19,8 @@ namespace Quik.Stb
|
||||
"runtimes/linux-arm/native/libstbi.so",
|
||||
"runtimes/linux-arm64/native/libstbi.so",
|
||||
"runtimes/linux-x64/native/libstbi.so",
|
||||
"runtimes/native/libstbi.dylib",
|
||||
"runtimes/osx-arm64/libstbi.dylib",
|
||||
"runtimes/osx-x64/libstbi.dylib",
|
||||
"libstbi.dll",
|
||||
"libstbi.so",
|
||||
"libstbi.dylib",
|
||||
|
Loading…
Reference in New Issue
Block a user