From 4987a6b24cf8edbcd779749de2a24fa8adb974f2 Mon Sep 17 00:00:00 2001 From: Robert Rouhani Date: Fri, 20 Mar 2015 23:51:24 -0400 Subject: [PATCH 1/4] 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 From 7ccd5521e0f3c5cfefea4179f60b4b9c2eef6054 Mon Sep 17 00:00:00 2001 From: Robert Rouhani Date: Sun, 19 Apr 2015 13:24:23 -0400 Subject: [PATCH 2/4] Removed zlib dependency and chose a specific version of SharpFont.Dependencies. --- thirdparty/fetch-thirdparty-deps.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/fetch-thirdparty-deps.ps1 b/thirdparty/fetch-thirdparty-deps.ps1 index 2ef1496438..0f9eff630a 100644 --- a/thirdparty/fetch-thirdparty-deps.ps1 +++ b/thirdparty/fetch-thirdparty-deps.ps1 @@ -54,7 +54,7 @@ if (!(Test-Path "SharpFont.dll")) cp SharpFont/lib/net20/SharpFont* . cp SharpFont/config/SharpFont.dll.config . rmdir SharpFont -Recurse - rmdir SharpFont.Dependencies -Recurse + rmdir SharpFont.Dependencies -Recurse } if (!(Test-Path "nunit.framework.dll")) From d3528d6ed841d3d3eef4ca68d503b3281632eb67 Mon Sep 17 00:00:00 2001 From: Robert Rouhani Date: Sun, 19 Apr 2015 14:38:05 -0400 Subject: [PATCH 3/4] Removed zlib from NSIS script --- packaging/windows/OpenRA.nsi | 2 -- 1 file changed, 2 deletions(-) diff --git a/packaging/windows/OpenRA.nsi b/packaging/windows/OpenRA.nsi index 7fd120b7d0..05b38ae128 100644 --- a/packaging/windows/OpenRA.nsi +++ b/packaging/windows/OpenRA.nsi @@ -93,7 +93,6 @@ Section "Game" GAME File "${DEPSDIR}\soft_oal.dll" File "${DEPSDIR}\SDL2.dll" File "${DEPSDIR}\freetype6.dll" - File "${DEPSDIR}\zlib1.dll" File "${DEPSDIR}\lua51.dll" !insertmacro MUI_STARTMENU_WRITE_BEGIN Application @@ -211,7 +210,6 @@ Function ${UN}Clean Delete $INSTDIR\lua51.dll Delete $INSTDIR\eluant.dll Delete $INSTDIR\freetype6.dll - Delete $INSTDIR\zlib1.dll Delete $INSTDIR\SDL2-CS.dll RMDir /r $INSTDIR\Support DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenRA" From 5d4ca1d52ffe1832b6f0df303fb55c58dccf3189 Mon Sep 17 00:00:00 2001 From: Robert Rouhani Date: Sat, 25 Apr 2015 10:33:20 -0400 Subject: [PATCH 4/4] Fixed bug where the SDL2 directory wouldn't be deleted --- thirdparty/fetch-thirdparty-deps-windows.sh | 2 +- thirdparty/fetch-thirdparty-deps.sh | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/thirdparty/fetch-thirdparty-deps-windows.sh b/thirdparty/fetch-thirdparty-deps-windows.sh index a8d305516a..2d81bdc02e 100755 --- a/thirdparty/fetch-thirdparty-deps-windows.sh +++ b/thirdparty/fetch-thirdparty-deps-windows.sh @@ -11,7 +11,7 @@ if [ ! -f windows/SDL2.dll ]; then echo "Fetching SDL2 from nuget" nuget install sdl2 -Version 2.0.3 -ExcludeVersion cp ./sdl2.redist/build/native/bin/Win32/dynamic/SDL2.dll ./windows/ - rm -rf sdl2.2.0.3 sdl2.redist + rm -rf sdl2 sdl2.redist fi if [ ! -f windows/freetype6.dll ]; then diff --git a/thirdparty/fetch-thirdparty-deps.sh b/thirdparty/fetch-thirdparty-deps.sh index 84526579bb..639f6688dd 100755 --- a/thirdparty/fetch-thirdparty-deps.sh +++ b/thirdparty/fetch-thirdparty-deps.sh @@ -42,8 +42,7 @@ if [ ! -f SharpFont.dll ]; then nuget install SharpFont -Version 3.0.1 -ExcludeVersion cp ./SharpFont/lib/net20/SharpFont* . cp ./SharpFont/config/SharpFont.dll.config . - rm -rf SharpFont - rm -rf SharpFont.Dependencies + rm -rf SharpFont SharpFont.Dependencies fi if [ ! -f nunit.framework.dll ]; then