Updated SharpFont to 3.0.0, adjusted font rendering code for new fixed-point types.
This commit is contained in:
@@ -102,13 +102,13 @@ namespace OpenRA.Graphics
|
|||||||
face.LoadChar(c.First, LoadFlags.Default, LoadTarget.Normal);
|
face.LoadChar(c.First, LoadFlags.Default, LoadTarget.Normal);
|
||||||
face.Glyph.RenderGlyph(RenderMode.Normal);
|
face.Glyph.RenderGlyph(RenderMode.Normal);
|
||||||
|
|
||||||
var size = new Size((int)face.Glyph.Metrics.Width >> 6, (int)face.Glyph.Metrics.Height >> 6);
|
var size = new Size((int)face.Glyph.Metrics.Width, (int)face.Glyph.Metrics.Height);
|
||||||
var s = builder.Allocate(size);
|
var s = builder.Allocate(size);
|
||||||
|
|
||||||
var g = new GlyphInfo
|
var g = new GlyphInfo
|
||||||
{
|
{
|
||||||
Sprite = s,
|
Sprite = s,
|
||||||
Advance = (int)face.Glyph.Metrics.HorizontalAdvance / 64f,
|
Advance = (float)face.Glyph.Metrics.HorizontalAdvance,
|
||||||
Offset = new int2(face.Glyph.BitmapLeft, -face.Glyph.BitmapTop)
|
Offset = new int2(face.Glyph.BitmapLeft, -face.Glyph.BitmapTop)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
14
thirdparty/fetch-thirdparty-deps-windows.sh
vendored
14
thirdparty/fetch-thirdparty-deps-windows.sh
vendored
@@ -16,10 +16,9 @@ fi
|
|||||||
|
|
||||||
if [ ! -f windows/freetype6.dll ]; then
|
if [ ! -f windows/freetype6.dll ]; then
|
||||||
echo "Fetching FreeType2 from nuget"
|
echo "Fetching FreeType2 from nuget"
|
||||||
nuget install freetype2.redist -Version 2.4.11.3 -ExcludeVersion
|
nuget install SharpFont.Dependencies -Version 2.5.5.1 -ExcludeVersion
|
||||||
cp ./freetype2.redist/bin/win32/zlib1.dll ./windows/
|
cp ./SharpFont.Dependencies/bin/msvc10/x86/freetype6.dll ./windows/
|
||||||
cp ./freetype2.redist/bin/win32/freetype6.dll ./windows/
|
rm -rf SharpFont.Dependencies
|
||||||
rm -rf freetype2.redist
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f windows/lua51.dll ]; then
|
if [ ! -f windows/lua51.dll ]; then
|
||||||
@@ -29,13 +28,6 @@ if [ ! -f windows/lua51.dll ]; then
|
|||||||
rm -rf lua.binaries
|
rm -rf lua.binaries
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f windows/zlib1.dll ]; then
|
|
||||||
echo "Fetching ZLib from nuget"
|
|
||||||
nuget install freetype2.redist -Version 2.4.11.3 -ExcludeVersion
|
|
||||||
cp ./freetype2.redist/bin/win32/zlib1.dll ./windows/
|
|
||||||
rm -rf freetype2.redist
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f windows/soft_oal.dll ]; then
|
if [ ! -f windows/soft_oal.dll ]; then
|
||||||
echo "Fetching OpenAL Soft from nuget"
|
echo "Fetching OpenAL Soft from nuget"
|
||||||
nuget install OpenAL-Soft -Version 1.16.0 -ExcludeVersion
|
nuget install OpenAL-Soft -Version 1.16.0 -ExcludeVersion
|
||||||
|
|||||||
20
thirdparty/fetch-thirdparty-deps.ps1
vendored
20
thirdparty/fetch-thirdparty-deps.ps1
vendored
@@ -50,10 +50,11 @@ if (!(Test-Path "MaxMind.GeoIP2.dll"))
|
|||||||
if (!(Test-Path "SharpFont.dll"))
|
if (!(Test-Path "SharpFont.dll"))
|
||||||
{
|
{
|
||||||
echo "Fetching SharpFont from NuGet."
|
echo "Fetching SharpFont from NuGet."
|
||||||
./nuget.exe install SharpFont -Version 2.5.0.1 -ExcludeVersion
|
./nuget.exe install SharpFont -Version 3.0.0 -ExcludeVersion
|
||||||
cp SharpFont/lib/net20/SharpFont* .
|
cp SharpFont/lib/net20/SharpFont* .
|
||||||
cp SharpFont/Content/SharpFont.dll.config .
|
cp SharpFont/config/SharpFont.dll.config .
|
||||||
rmdir SharpFont -Recurse
|
rmdir SharpFont -Recurse
|
||||||
|
rmdir SharpFont.Dependencies -Recurse
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(Test-Path "nunit.framework.dll"))
|
if (!(Test-Path "nunit.framework.dll"))
|
||||||
@@ -92,18 +93,9 @@ if (!(Test-Path "windows/lua51.dll"))
|
|||||||
if (!(Test-Path "windows/freetype6.dll"))
|
if (!(Test-Path "windows/freetype6.dll"))
|
||||||
{
|
{
|
||||||
echo "Fetching FreeType2 from NuGet."
|
echo "Fetching FreeType2 from NuGet."
|
||||||
./nuget.exe install freetype2.redist -Version 2.4.11.3 -ExcludeVersion
|
./nuget.exe install SharpFont.Dependencies -Version 2.5.5.1 -ExcludeVersion
|
||||||
cp freetype2.redist/bin/win32/zlib1.dll ./windows/zlib1.dll
|
cp SharpFont.Dependencies/bin/msvc10/x86/freetype6.dll ./windows/freetype6.dll
|
||||||
cp freetype2.redist/bin/win32/freetype6.dll ./windows/freetype6.dll
|
rmdir SharpFont.Dependencies -Recurse
|
||||||
rmdir freetype2.redist -Recurse
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(Test-Path "windows/zlib1.dll"))
|
|
||||||
{
|
|
||||||
echo "Fetching ZLib from NuGet."
|
|
||||||
./nuget.exe install freetype2.redist -Version 2.4.11.3 -ExcludeVersion
|
|
||||||
cp freetype2.redist/bin/win32/zlib1.dll ./windows/zlib1.dll
|
|
||||||
rmdir freetype2.redist -Recurse
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(Test-Path "windows/soft_oal.dll"))
|
if (!(Test-Path "windows/soft_oal.dll"))
|
||||||
|
|||||||
5
thirdparty/fetch-thirdparty-deps.sh
vendored
5
thirdparty/fetch-thirdparty-deps.sh
vendored
@@ -39,10 +39,11 @@ fi
|
|||||||
|
|
||||||
if [ ! -f SharpFont.dll ]; then
|
if [ ! -f SharpFont.dll ]; then
|
||||||
echo "Fetching SharpFont from nuget"
|
echo "Fetching SharpFont from nuget"
|
||||||
nuget install SharpFont -Version 2.5.0.1 -ExcludeVersion
|
nuget install SharpFont -Version 3.0.1 -ExcludeVersion
|
||||||
cp ./SharpFont/lib/net20/SharpFont* .
|
cp ./SharpFont/lib/net20/SharpFont* .
|
||||||
sed '/osx/s@\(dll="\)[^"]*\(" />\)@\1/Library/Frameworks/Mono.framework/Libraries/libfreetype.6.dylib\2@' ./SharpFont/Content/SharpFont.dll.config > SharpFont.dll.config
|
cp ./SharpFont/config/SharpFont.dll.config .
|
||||||
rm -rf SharpFont
|
rm -rf SharpFont
|
||||||
|
rm -rf SharpFont.Dependencies
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f nunit.framework.dll ]; then
|
if [ ! -f nunit.framework.dll ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user