Skip to content
Merged
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
180 changes: 90 additions & 90 deletions Engines/Wine/Verbs/corefonts/script.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const Wine = include("engines.wine.engine.object");
const Resource = include("utils.functions.net.resource");
const {CabExtract} = include("utils.functions.filesystem.extract");
const { CabExtract } = include("utils.functions.filesystem.extract");

include("engines.wine.plugins.register_font");
include("engines.wine.verbs.luna");
Expand All @@ -11,98 +11,94 @@ include("engines.wine.verbs.luna");
* @returns {Wine} Wine object
*/
Wine.prototype.corefonts = function () {
var fontResources =
[
new Resource()
.wizard(this.wizard())
.url("https://mirrors.kernel.org/gentoo/distfiles/arial32.exe")
.checksum("6d75f8436f39ab2da5c31ce651b7443b4ad2916e")
.name("arial32.exe")
.get(),

new Resource()
.wizard(this.wizard())
.url("https://mirrors.kernel.org/gentoo/distfiles/arialb32.exe")
.checksum("d45cdab84b7f4c1efd6d1b369f50ed0390e3d344")
.name("arialb32.exe")
.get(),

new Resource()
.wizard(this.wizard())
.url("https://mirrors.kernel.org/gentoo/distfiles/comic32.exe")
.checksum("2371d0327683dcc5ec1684fe7c275a8de1ef9a51")
.name("comic32.exe")
.get(),

new Resource()
.wizard(this.wizard())
.url("https://mirrors.kernel.org/gentoo/distfiles/courie32.exe")
.checksum("06a745023c034f88b4135f5e294fece1a3c1b057")
.name("courie32.exe")
.get(),

new Resource()
.wizard(this.wizard())
.url("https://mirrors.kernel.org/gentoo/distfiles/georgi32.exe")
.checksum("90e4070cb356f1d811acb943080bf97e419a8f1e")
.name("georgi32.exe")
.get(),

new Resource()
.wizard(this.wizard())
.url("https://mirrors.kernel.org/gentoo/distfiles/impact32.exe")
.checksum("86b34d650cfbbe5d3512d49d2545f7509a55aad2")
.name("impact32.exe")
.get(),

new Resource()
.wizard(this.wizard())
.url("https://mirrors.kernel.org/gentoo/distfiles/times32.exe")
.checksum("20b79e65cdef4e2d7195f84da202499e3aa83060")
.name("times32.exe")
.get(),

new Resource()
.wizard(this.wizard())
.url("https://mirrors.kernel.org/gentoo/distfiles/trebuc32.exe ")
.checksum("50aab0988423efcc9cf21fac7d64d534d6d0a34a")
.name("trebuc32.exe")
.get(),

new Resource()
.wizard(this.wizard())
.url("https://mirrors.kernel.org/gentoo/distfiles/verdan32.exe ")
.checksum("f5b93cedf500edc67502f116578123618c64a42a")
.name("verdan32.exe")
.get(),

new Resource()
.wizard(this.wizard())
.url("https://mirrors.kernel.org/gentoo/distfiles/webdin32.exe ")
.checksum("2fb4a42c53e50bc70707a7b3c57baf62ba58398f")
.name("webdin32.exe")
.get()
];

var progressBar = this.wizard().progressBar(tr("Please wait..."));
const fontResources = [
new Resource()
.wizard(this.wizard())
.url("https://mirrors.kernel.org/gentoo/distfiles/arial32.exe")
.checksum("6d75f8436f39ab2da5c31ce651b7443b4ad2916e")
.name("arial32.exe")
.get(),

new Resource()
.wizard(this.wizard())
.url("https://mirrors.kernel.org/gentoo/distfiles/arialb32.exe")
.checksum("d45cdab84b7f4c1efd6d1b369f50ed0390e3d344")
.name("arialb32.exe")
.get(),

new Resource()
.wizard(this.wizard())
.url("https://mirrors.kernel.org/gentoo/distfiles/comic32.exe")
.checksum("2371d0327683dcc5ec1684fe7c275a8de1ef9a51")
.name("comic32.exe")
.get(),

new Resource()
.wizard(this.wizard())
.url("https://mirrors.kernel.org/gentoo/distfiles/courie32.exe")
.checksum("06a745023c034f88b4135f5e294fece1a3c1b057")
.name("courie32.exe")
.get(),

new Resource()
.wizard(this.wizard())
.url("https://mirrors.kernel.org/gentoo/distfiles/georgi32.exe")
.checksum("90e4070cb356f1d811acb943080bf97e419a8f1e")
.name("georgi32.exe")
.get(),

new Resource()
.wizard(this.wizard())
.url("https://mirrors.kernel.org/gentoo/distfiles/impact32.exe")
.checksum("86b34d650cfbbe5d3512d49d2545f7509a55aad2")
.name("impact32.exe")
.get(),

new Resource()
.wizard(this.wizard())
.url("https://mirrors.kernel.org/gentoo/distfiles/times32.exe")
.checksum("20b79e65cdef4e2d7195f84da202499e3aa83060")
.name("times32.exe")
.get(),

new Resource()
.wizard(this.wizard())
.url("https://mirrors.kernel.org/gentoo/distfiles/trebuc32.exe ")
.checksum("50aab0988423efcc9cf21fac7d64d534d6d0a34a")
.name("trebuc32.exe")
.get(),

new Resource()
.wizard(this.wizard())
.url("https://mirrors.kernel.org/gentoo/distfiles/verdan32.exe ")
.checksum("f5b93cedf500edc67502f116578123618c64a42a")
.name("verdan32.exe")
.get(),

new Resource()
.wizard(this.wizard())
.url("https://mirrors.kernel.org/gentoo/distfiles/webdin32.exe ")
.checksum("2fb4a42c53e50bc70707a7b3c57baf62ba58398f")
.name("webdin32.exe")
.get()
];

const progressBar = this.wizard().progressBar(tr("Please wait..."));
progressBar.setText(tr("Installing {0}...", tr("fonts")));
progressBar.setProgressPercentage(0.);
progressBar.setProgressPercentage(0);

var numInstalledFonts = 0;

var that = this;
fontResources.forEach(function (fontResource) {
fontResources.reduce((numInstalledFonts, fontResource) => {
progressBar.setText(tr("Installing {0}...", tr("fonts")));
progressBar.setProgressPercentage(numInstalledFonts * 100 / fontResources.length);
progressBar.setProgressPercentage((numInstalledFonts * 100) / fontResources.length);

new CabExtract()
.archive(fontResource)
.wizard(null)
.to(that.fontDirectory())
.wizard(this.wizard())
.to(this.fontDirectory())
.extract();

numInstalledFonts++;
});
return numInstalledFonts + 1;
}, 0);

this.registerFont()
.set("Arial", "Arial.TTF")
Expand Down Expand Up @@ -135,24 +131,28 @@ Wine.prototype.corefonts = function () {
.set("Verdana Italic", "Verdanai.TTF")
.set("Webdings", "Webdings.TTF")
.do();

return this;
}
};

/**
* Verb to install corefonts
*/
// eslint-disable-next-line no-unused-vars
module.default = class CorefontsVerb {
constructor() {
// do nothing
}

install(container) {
var wine = new Wine();
const wine = new Wine();

wine.prefix(container);
var wizard = SetupWizard(InstallationType.VERBS, "corefonts", java.util.Optional.empty());

const wizard = SetupWizard(InstallationType.VERBS, "corefonts", java.util.Optional.empty());

wine.wizard(wizard);
wine.corefonts();

wizard.close();
}
}
};