Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Build/PackageRestore.targets
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
<!-- Scheherazade New: deterministic Arabic font for the render-snapshot tests; download from
GitHub release (https://github.com/silnrsi/font-scheherazade/releases). -->
<ScheherazadeNewVersion>4.500</ScheherazadeNewVersion>
<!-- Charis SIL: test font for the Views Uniscribe/Graphite shaping tests; download from
GitHub release (https://github.com/silnrsi/font-charis/releases). v6.x keeps the
"Charis SIL" family name (v7 renames it to "Charis"). -->
<CharisSilVersion>6.200</CharisSilVersion>
<!-- PackagesDir: Use local packages folder. -->
<PackagesDir>$(fwrt)/packages</PackagesDir>
</PropertyGroup>
Expand Down Expand Up @@ -291,6 +295,20 @@
DownloadsDir="$(DownloadsDir)"
Condition="'$(OS)'=='Windows_NT' AND !Exists('$(DownloadsDir)/TonePars64.exe')"
/>
<!-- Charis SIL font: test font for the Views shaping tests (TestViews). Downloaded once into
Downloads/ and unzipped there; TestViews.vcxproj copies the regular face into its output.
Pinned to a release rather than committed to the repo. -->
<DownloadFile
Address="https://github.com/silnrsi/font-charis/releases/download/v$(CharisSilVersion)/CharisSIL-$(CharisSilVersion).zip"
LocalFilename="CharisSIL-$(CharisSilVersion).zip"
DownloadsDir="$(DownloadsDir)"
Condition="'$(OS)'=='Windows_NT' AND !Exists('$(DownloadsDir)/CharisSIL-$(CharisSilVersion).zip')"
/>
<Unzip
ZipFilename="$(DownloadsDir)/CharisSIL-$(CharisSilVersion).zip"
ToDir="$(DownloadsDir)/CharisSIL"
Condition="'$(OS)'=='Windows_NT' AND Exists('$(DownloadsDir)/CharisSIL-$(CharisSilVersion).zip') AND !Exists('$(DownloadsDir)/CharisSIL/CharisSIL-$(CharisSilVersion)/CharisSIL-Regular.ttf')"
/>
<!-- Scheherazade New font: deterministic Arabic glyph source for the render-snapshot tests
(RootSiteTests). Downloaded once into Downloads/ and unzipped there; RootSiteTests copies
the regular face into its test output. Pinned to a release so all machines/CI render
Expand Down
18 changes: 10 additions & 8 deletions Src/Common/RootSite/RootSiteTests/RootSiteTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,18 @@
</ItemGroup>
<!-- Deterministic Arabic font for the render-snapshot tests. Downloaded (not committed) by
Build/PackageRestore.targets into Downloads/ScheherazadeNew; copied into the test output so
RenderTestAssemblySetup can load it privately. The ItemGroup is inside the target so the glob
resolves at execution time (after the download), and the recursive glob avoids hard-coding the
pinned version folder. -->
RenderTestAssemblySetup can load it privately. Tied to the exact pinned version (keep
ScheherazadeNewTestFontVersion in sync with ScheherazadeNewVersion in
Build/PackageRestore.targets) so the copied test font is deterministic, even if Downloads/
holds more than one extracted version. -->
<PropertyGroup>
<ScheherazadeNewTestFontVersion>4.500</ScheherazadeNewTestFontVersion>
<ScheherazadeNewTestFontPath>$(OutDir)..\..\Downloads\ScheherazadeNew\ScheherazadeNew-$(ScheherazadeNewTestFontVersion)\ScheherazadeNew-Regular.ttf</ScheherazadeNewTestFontPath>
</PropertyGroup>
<Target Name="CopyArabicRenderFont" AfterTargets="Build">
<ItemGroup>
<_ArabicRenderFont Include="$(OutDir)..\..\Downloads\ScheherazadeNew\**\ScheherazadeNew-Regular.ttf" />
</ItemGroup>
<Copy SourceFiles="@(_ArabicRenderFont)"
<Copy SourceFiles="$(ScheherazadeNewTestFontPath)"
DestinationFolder="$(OutDir)TestData\Fonts"
SkipUnchangedFiles="true"
Condition="'@(_ArabicRenderFont)' != ''" />
Condition="Exists('$(ScheherazadeNewTestFontPath)')" />
</Target>
</Project>
Binary file not shown.
94 changes: 0 additions & 94 deletions Src/views/Test/TestData/Fonts/CharisSIL-5.000/OFL.txt

This file was deleted.

81 changes: 0 additions & 81 deletions Src/views/Test/TestData/Fonts/CharisSIL-5.000/README.txt

This file was deleted.

18 changes: 11 additions & 7 deletions Src/views/Test/TestUniscribeEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ namespace TestViews
pchLastSlash != NULL);
*(pchLastSlash + 1) = 0;
wcscat_s(rgchPath, _countof(rgchPath),
L"TestData\\Fonts\\CharisSIL-5.000\\CharisSIL-R.ttf");
L"TestData\\Fonts\\CharisSIL\\CharisSIL-Regular.ttf");

DWORD dwAttributes = ::GetFileAttributesW(rgchPath);
unitpp::assert_true("Charis SIL test font should be copied beside TestViews.exe",
Expand Down Expand Up @@ -324,15 +324,19 @@ namespace TestViews
unitpp::assert_true("Charis SIL test font should load", font.Loaded());
SetDefaultFontForTest(L"Charis SIL");

int dxWithoutLigatures = MeasureTextWithFeatures(L"office official affinity", L"liga=0");
int dxWithLigatures = MeasureTextWithFeatures(L"office official affinity", L"liga=1");
// Small caps replace lowercase letters with glyphs of different advance widths, so the
// measured segment width changes. (The liga feature was previously used here, but in
// Charis SIL 6.x the fi/ffi ligatures keep the component advance widths, so liga changes
// the rendered glyphs without changing segment metrics.)
int dxWithoutSmallCaps = MeasureTextWithFeatures(L"small caps verify", L"smcp=0");
int dxWithSmallCaps = MeasureTextWithFeatures(L"small caps verify", L"smcp=1");

unitpp::assert_true("OpenType feature-off segment width should be positive",
dxWithoutLigatures > 0);
dxWithoutSmallCaps > 0);
unitpp::assert_true("OpenType feature-on segment width should be positive",
dxWithLigatures > 0);
unitpp::assert_true("Charis SIL liga feature should change segment metrics",
dxWithoutLigatures != dxWithLigatures);
dxWithSmallCaps > 0);
unitpp::assert_true("Charis SIL smcp feature should change segment metrics",
dxWithoutSmallCaps != dxWithSmallCaps);
#endif
}

Expand Down
25 changes: 13 additions & 12 deletions Src/views/Test/TestViews.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,6 @@
<ItemGroup>
<None Include="testViews.mak" />
<None Include="NiceGuy.bmp" />
<None Include="TestData\Fonts\CharisSIL-5.000\CharisSIL-R.ttf" />
<None Include="TestData\Fonts\CharisSIL-5.000\OFL.txt" />
<None Include="TestData\Fonts\CharisSIL-5.000\README.txt" />
</ItemGroup>

<!-- Resource file -->
Expand All @@ -442,16 +439,20 @@
WorkingDirectory="$(ProjectDir)" />
</Target>

<ItemGroup>
<CharisSilTestFont Include="$(ProjectDir)TestData\Fonts\CharisSIL-5.000\CharisSIL-R.ttf" />
<CharisSilTestFont Include="$(ProjectDir)TestData\Fonts\CharisSIL-5.000\OFL.txt" />
<CharisSilTestFont Include="$(ProjectDir)TestData\Fonts\CharisSIL-5.000\README.txt" />
</ItemGroup>

<!-- Charis SIL test font: downloaded (not committed) by Build/PackageRestore.targets into
Downloads/CharisSIL; copied beside TestViews.exe so the shaping tests can load it privately.
Tied to the exact pinned version (keep CharisSilTestFontVersion in sync with CharisSilVersion
in Build/PackageRestore.targets) so the copied test font is deterministic, even if Downloads/
holds more than one extracted version. -->
<PropertyGroup>
<CharisSilTestFontVersion>6.200</CharisSilTestFontVersion>
<CharisSilTestFontPath>$(FwRoot)\Downloads\CharisSIL\CharisSIL-$(CharisSilTestFontVersion)\CharisSIL-Regular.ttf</CharisSilTestFontPath>
</PropertyGroup>
<Target Name="CopyCharisSilTestFont" AfterTargets="Build">
<Copy SourceFiles="@(CharisSilTestFont)"
DestinationFolder="$(OutDir)TestData\Fonts\CharisSIL-5.000"
SkipUnchangedFiles="true" />
<Copy SourceFiles="$(CharisSilTestFontPath)"
DestinationFolder="$(OutDir)TestData\Fonts\CharisSIL"
SkipUnchangedFiles="true"
Condition="Exists('$(CharisSilTestFontPath)')" />
</Target>

<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
9 changes: 0 additions & 9 deletions Src/views/Test/TestViews.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,6 @@
<None Include="NiceGuy.bmp">
<Filter>Resource Files</Filter>
</None>
<None Include="TestData\Fonts\CharisSIL-5.000\CharisSIL-R.ttf">
<Filter>Resource Files</Filter>
</None>
<None Include="TestData\Fonts\CharisSIL-5.000\OFL.txt">
<Filter>Resource Files</Filter>
</None>
<None Include="TestData\Fonts\CharisSIL-5.000\README.txt">
<Filter>Resource Files</Filter>
</None>
<None Include="testViews.mak" />
<None Include="Makefile" />
</ItemGroup>
Expand Down
Loading