10Create the DWriteCore asset. DWriteCore is now part of the WindowsAppSDK
11which is distrubuted as a nuget package. To update, go to
12https://www.nuget.org/packages/Microsoft.WindowsAppSDK and pick a version.
13The URL below should match that of the "Download package" link.
15The asset this creates contains just the DWriteCore headers and dll. In
16particular the lib is not bundled as Skia does not link directly against
25VERSION =
"1.4.230822000"
27SHA256 =
"7f20ada4989afb3efd885f3c26ad2b63c1b01f4b1d7bb183f5f1a7f859c566df"
28URL =
"https://www.nuget.org/api/v2/package/Microsoft.WindowsAppSDK/%s"
32 """Create the asset."""
33 subprocess.check_call([
"mkdir",
"%s/tmp" % target_dir])
35 subprocess.check_call([
"curl",
"-L", URL % VERSION,
"-o",
"%s/tmp/windowsappsdk.zip" % target_dir])
36 output = subprocess.check_output([
"sha256sum",
"%s/tmp/windowsappsdk.zip" % target_dir], encoding=
"utf-8")
37 actual_hash = output.split(
" ")[0]
38 if actual_hash != SHA256:
39 raise Exception(
"SHA256 does not match (%s != %s)" % (actual_hash, SHA256))
41 subprocess.check_call([
"unzip",
"%s/tmp/windowsappsdk.zip" % target_dir,
"-d",
"%s/tmp/sdk" % target_dir])
42 subprocess.check_call([
"unzip",
"%s/tmp/sdk/tools/MSIX/win10-x64/Microsoft.WindowsAppRuntime.%s.msix" % (target_dir, SHORT_VERSION),
"-d",
"%s/tmp/runtime" % target_dir])
44 subprocess.check_call([
"mkdir",
"%s/include" % target_dir])
45 subprocess.check_call([
"mkdir",
"%s/bin" % target_dir])
46 subprocess.check_call([
"cp",
"%s/tmp/sdk/include/dwrite.h" % target_dir,
"%s/include" % target_dir])
47 subprocess.check_call([
"cp",
"%s/tmp/sdk/include/dwrite_1.h" % target_dir,
"%s/include" % target_dir])
48 subprocess.check_call([
"cp",
"%s/tmp/sdk/include/dwrite_2.h" % target_dir,
"%s/include" % target_dir])
49 subprocess.check_call([
"cp",
"%s/tmp/sdk/include/dwrite_3.h" % target_dir,
"%s/include" % target_dir])
50 subprocess.check_call([
"cp",
"%s/tmp/sdk/include/dwrite_core.h" % target_dir,
"%s/include" % target_dir])
51 subprocess.check_call([
"cp",
"%s/tmp/runtime/DWriteCore.dll" % target_dir,
"%s/bin" % target_dir])
53 subprocess.check_call([
"rm",
"-rf",
"%s/tmp" % target_dir])
57 parser = argparse.ArgumentParser()
58 parser.add_argument(
'--target_dir',
'-t', required=
True)
59 args = parser.parse_args()
63if __name__ ==
'__main__':
def create_asset(target_dir)