From 4987a6b24cf8edbcd779749de2a24fa8adb974f2 Mon Sep 17 00:00:00 2001 From: Robert Rouhani Date: Fri, 20 Mar 2015 23:51:24 -0400 Subject: [PATCH] Updated SharpFont to 3.0.0, adjusted font rendering code for new fixed-point types. --- OpenRA.Game/Graphics/SpriteFont.cs | 4 ++-- thirdparty/fetch-thirdparty-deps-windows.sh | 14 +++----------- thirdparty/fetch-thirdparty-deps.ps1 | 20 ++++++-------------- thirdparty/fetch-thirdparty-deps.sh | 5 +++-- 4 files changed, 14 insertions(+), 29 deletions(-) diff --git a/OpenRA.Game/Graphics/SpriteFont.cs b/OpenRA.Game/Graphics/SpriteFont.cs index 65a885e189..5f796831e7 100644 --- a/OpenRA.Game/Graphics/SpriteFont.cs +++ b/OpenRA.Game/Graphics/SpriteFont.cs @@ -102,13 +102,13 @@ namespace OpenRA.Graphics face.LoadChar(c.First, LoadFlags.Default, LoadTarget.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 g = new GlyphInfo { Sprite = s, - Advance = (int)face.Glyph.Metrics.HorizontalAdvance / 64f, + Advance = (float)face.Glyph.Metrics.HorizontalAdvance, Offset = new int2(face.Glyph.BitmapLeft, -face.Glyph.BitmapTop) }; diff --git a/thirdparty/fetch-thirdparty-deps-windows.sh b/thirdparty/fetch-thirdparty-deps-windows.sh index 197723dc6c..a8d305516a 100755 --- a/thirdparty/fetch-thirdparty-deps-windows.sh +++ b/thirdparty/fetch-thirdparty-deps-windows.sh @@ -16,10 +16,9 @@ fi if [ ! -f windows/freetype6.dll ]; then echo "Fetching FreeType2 from nuget" - nuget install freetype2.redist -Version 2.4.11.3 -ExcludeVersion - cp ./freetype2.redist/bin/win32/zlib1.dll ./windows/ - cp ./freetype2.redist/bin/win32/freetype6.dll ./windows/ - rm -rf freetype2.redist + nuget install SharpFont.Dependencies -Version 2.5.5.1 -ExcludeVersion + cp ./SharpFont.Dependencies/bin/msvc10/x86/freetype6.dll ./windows/ + rm -rf SharpFont.Dependencies fi if [ ! -f windows/lua51.dll ]; then @@ -29,13 +28,6 @@ if [ ! -f windows/lua51.dll ]; then rm -rf lua.binaries 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 echo "Fetching OpenAL Soft from nuget" nuget install OpenAL-Soft -Version 1.16.0 -ExcludeVersion diff --git a/thirdparty/fetch-thirdparty-deps.ps1 b/thirdparty/fetch-thirdparty-deps.ps1 index 9b85693eb3..2ef1496438 100644 --- a/thirdparty/fetch-thirdparty-deps.ps1 +++ b/thirdparty/fetch-thirdparty-deps.ps1 @@ -50,10 +50,11 @@ if (!(Test-Path "MaxMind.GeoIP2.dll")) if (!(Test-Path "SharpFont.dll")) { 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/Content/SharpFont.dll.config . + cp SharpFont/config/SharpFont.dll.config . rmdir SharpFont -Recurse + rmdir SharpFont.Dependencies -Recurse } if (!(Test-Path "nunit.framework.dll")) @@ -92,18 +93,9 @@ if (!(Test-Path "windows/lua51.dll")) if (!(Test-Path "windows/freetype6.dll")) { echo "Fetching FreeType2 from NuGet." - ./nuget.exe install freetype2.redist -Version 2.4.11.3 -ExcludeVersion - cp freetype2.redist/bin/win32/zlib1.dll ./windows/zlib1.dll - cp freetype2.redist/bin/win32/freetype6.dll ./windows/freetype6.dll - 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 + ./nuget.exe install SharpFont.Dependencies -Version 2.5.5.1 -ExcludeVersion + cp SharpFont.Dependencies/bin/msvc10/x86/freetype6.dll ./windows/freetype6.dll + rmdir SharpFont.Dependencies -Recurse } if (!(Test-Path "windows/soft_oal.dll")) diff --git a/thirdparty/fetch-thirdparty-deps.sh b/thirdparty/fetch-thirdparty-deps.sh index dcd4b9b888..84526579bb 100755 --- a/thirdparty/fetch-thirdparty-deps.sh +++ b/thirdparty/fetch-thirdparty-deps.sh @@ -39,10 +39,11 @@ fi if [ ! -f SharpFont.dll ]; then 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* . - 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.Dependencies fi if [ ! -f nunit.framework.dll ]; then