koishi-plugin-to-image-service-font-jetbrains-mono 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fonts/JetBrainsMonoNL-Bold.ttf +0 -0
- package/fonts/JetBrainsMonoNL-BoldItalic.ttf +0 -0
- package/fonts/JetBrainsMonoNL-ExtraBold.ttf +0 -0
- package/fonts/JetBrainsMonoNL-ExtraBoldItalic.ttf +0 -0
- package/fonts/JetBrainsMonoNL-ExtraLight.ttf +0 -0
- package/fonts/JetBrainsMonoNL-ExtraLightItalic.ttf +0 -0
- package/fonts/JetBrainsMonoNL-Italic.ttf +0 -0
- package/fonts/JetBrainsMonoNL-Light.ttf +0 -0
- package/fonts/JetBrainsMonoNL-LightItalic.ttf +0 -0
- package/fonts/JetBrainsMonoNL-Medium.ttf +0 -0
- package/fonts/JetBrainsMonoNL-MediumItalic.ttf +0 -0
- package/fonts/JetBrainsMonoNL-Regular.ttf +0 -0
- package/fonts/JetBrainsMonoNL-SemiBold.ttf +0 -0
- package/fonts/JetBrainsMonoNL-SemiBoldItalic.ttf +0 -0
- package/fonts/JetBrainsMonoNL-Thin.ttf +0 -0
- package/fonts/JetBrainsMonoNL-ThinItalic.ttf +0 -0
- package/lib/index.d.ts +16 -0
- package/lib/index.js +88 -0
- package/package.json +54 -0
- package/readme.md +11 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Context, Schema, Service } from "koishi";
|
|
2
|
+
declare class ToImageServiceFontJetbrainsMono extends Service {
|
|
3
|
+
private _ctx;
|
|
4
|
+
constructor(ctx: Context, config: ToImageServiceFontJetbrainsMono.Config);
|
|
5
|
+
protected start(): Promise<void>;
|
|
6
|
+
private initFonts;
|
|
7
|
+
private fontNames;
|
|
8
|
+
}
|
|
9
|
+
declare namespace ToImageServiceFontJetbrainsMono {
|
|
10
|
+
const inject: string[];
|
|
11
|
+
const usage = "<a target=\"_blank\" href=\"https://www.jetbrains.com/lp/mono/\">JetBrains Mono</a>";
|
|
12
|
+
interface Config {
|
|
13
|
+
}
|
|
14
|
+
const Config: Schema<Config>;
|
|
15
|
+
}
|
|
16
|
+
export default ToImageServiceFontJetbrainsMono;
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var src_exports = {};
|
|
32
|
+
__export(src_exports, {
|
|
33
|
+
default: () => src_default
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(src_exports);
|
|
36
|
+
var import_koishi = require("koishi");
|
|
37
|
+
var import_promises = __toESM(require("node:fs/promises"));
|
|
38
|
+
var import_node_path = __toESM(require("node:path"));
|
|
39
|
+
var serviceName = "toImageServiceFontJetbrainsMono";
|
|
40
|
+
var ToImageServiceFontJetbrainsMono = class extends import_koishi.Service {
|
|
41
|
+
static {
|
|
42
|
+
__name(this, "ToImageServiceFontJetbrainsMono");
|
|
43
|
+
}
|
|
44
|
+
_ctx;
|
|
45
|
+
constructor(ctx, config) {
|
|
46
|
+
super(ctx, serviceName);
|
|
47
|
+
this._ctx = ctx;
|
|
48
|
+
}
|
|
49
|
+
async start() {
|
|
50
|
+
await this.initFonts();
|
|
51
|
+
}
|
|
52
|
+
async initFonts() {
|
|
53
|
+
const fonts = [];
|
|
54
|
+
for (let i = 0; i < this.fontNames.length; i++) {
|
|
55
|
+
const fontName = this.fontNames[i];
|
|
56
|
+
for (let j = 0; j < 2; j++) {
|
|
57
|
+
fonts.push({
|
|
58
|
+
name: "JetBrains Mono",
|
|
59
|
+
weight: (i + 1) * 100,
|
|
60
|
+
style: ["normal", "italic"][j],
|
|
61
|
+
data: await import_promises.default.readFile(
|
|
62
|
+
import_node_path.default.join(
|
|
63
|
+
__dirname,
|
|
64
|
+
`../fonts/JetBrainsMonoNL-${j === 0 || fontName !== "Regular" ? fontName : ""}${["", "Italic"][j]}.ttf`
|
|
65
|
+
)
|
|
66
|
+
)
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
this._ctx.toImageService.addFont(fonts);
|
|
71
|
+
}
|
|
72
|
+
fontNames = [
|
|
73
|
+
"Thin",
|
|
74
|
+
"ExtraLight",
|
|
75
|
+
"Light",
|
|
76
|
+
"Regular",
|
|
77
|
+
"Medium",
|
|
78
|
+
"SemiBold",
|
|
79
|
+
"Bold",
|
|
80
|
+
"ExtraBold"
|
|
81
|
+
];
|
|
82
|
+
};
|
|
83
|
+
((ToImageServiceFontJetbrainsMono2) => {
|
|
84
|
+
ToImageServiceFontJetbrainsMono2.inject = ["toImageService"];
|
|
85
|
+
ToImageServiceFontJetbrainsMono2.usage = '<a target="_blank" href="https://www.jetbrains.com/lp/mono/">JetBrains Mono</a>';
|
|
86
|
+
ToImageServiceFontJetbrainsMono2.Config = import_koishi.Schema.object({});
|
|
87
|
+
})(ToImageServiceFontJetbrainsMono || (ToImageServiceFontJetbrainsMono = {}));
|
|
88
|
+
var src_default = ToImageServiceFontJetbrainsMono;
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "koishi-plugin-to-image-service-font-jetbrains-mono",
|
|
3
|
+
"description": "Provide JetBrains Mono fonts for the to-image-service",
|
|
4
|
+
"version": "0.0.3",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"typings": "lib/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "cd ../../ && yarn build to-image-service-font-jetbrains-mono",
|
|
9
|
+
"pub": "cd ../../ && yarn pub to-image-service-font-jetbrains-mono",
|
|
10
|
+
"fastPub": "cd ../../ && yarn bump -3 to-image-service-font-jetbrains-mono && yarn build to-image-service-font-jetbrains-mono && yarn pub to-image-service-font-jetbrains-mono",
|
|
11
|
+
"test": "node ./test/test.js"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"lib",
|
|
15
|
+
"dist",
|
|
16
|
+
"fonts"
|
|
17
|
+
],
|
|
18
|
+
"contributors": [
|
|
19
|
+
"pgnqukezrdxmhjso"
|
|
20
|
+
],
|
|
21
|
+
"homepage": "https://github.com/pgnqukezrdxmhjso/koishi-plugin-to-image-service-font-jetbrains-mono",
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/pgnqukezrdxmhjso/koishi-plugin-to-image-service-font-jetbrains-mono/issues"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/pgnqukezrdxmhjso/koishi-plugin-to-image-service-font-jetbrains-mono.git"
|
|
28
|
+
},
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"keywords": [
|
|
31
|
+
"chatbot",
|
|
32
|
+
"koishi",
|
|
33
|
+
"plugin",
|
|
34
|
+
"to-image-service",
|
|
35
|
+
"font",
|
|
36
|
+
"JetBrains Mono"
|
|
37
|
+
],
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"koishi": "^4.18.10"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"koishi-plugin-to-image-service": "^0.0.1"
|
|
43
|
+
},
|
|
44
|
+
"koishi": {
|
|
45
|
+
"service": {
|
|
46
|
+
"required": [
|
|
47
|
+
"toImageService"
|
|
48
|
+
],
|
|
49
|
+
"implements": [
|
|
50
|
+
"toImageServiceFontJetbrainsMono"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# koishi-plugin-to-image-service-font-jetbrains-mono
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/koishi-plugin-to-image-service-font-jetbrains-mono)
|
|
4
|
+
|
|
5
|
+
Provide JetBrains Mono fonts for the to-image-service
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
[JetBrains Mono](https://www.jetbrains.com/lp/mono/)
|
|
10
|
+
|
|
11
|
+

|