soccer-jersey-fork 1.0.104 → 1.0.105

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.
@@ -20,7 +20,18 @@ export const Default = {
20
20
  sleeveStyleDirection: "horizontal",
21
21
  sleeveCuffColor: "",
22
22
  images: [],
23
- texts: [],
23
+ texts: [
24
+ {
25
+ text: "10",
26
+ size: 20,
27
+ x: 50,
28
+ y: 45,
29
+ color: "#fff",
30
+ fontFamily: "Impact",
31
+ weight: 900,
32
+ style: "normal",
33
+ },
34
+ ],
24
35
  shortsColor: "#DA000C",
25
36
  shortsCuffColor: "",
26
37
  shirtSideColor: "",
@@ -3,6 +3,7 @@
3
3
  * Original source: https://github.com/nadchif/soccer-jersey/tree/master
4
4
  * Modifications Copyright 2025 Lau Kai Chung
5
5
  */
6
+ import { CSSProperties } from "react";
6
7
  export interface DrawSoccerJerseyProps {
7
8
  shirtColor: string;
8
9
  shirtSideColor?: string;
@@ -27,6 +28,9 @@ export interface DrawSoccerJerseyProps {
27
28
  outlineColor?: string;
28
29
  backgroundColor?: string;
29
30
  backgroundShape?: "ellipse" | "square";
31
+ fontFamily: string;
32
+ weight?: number;
33
+ style?: CSSProperties["fontStyle"];
30
34
  }[];
31
35
  images: {
32
36
  src: string;
@@ -14,7 +14,6 @@ export default function drawSoccerJersey({ shirtColor = "plain", shirtStyle, shi
14
14
  const pathRightSleeve = "m83 8.1c4 3 6.1 7.7 8.9 12 3.1 4.9 6 9.9 8.8 15-6 4-12 8.2-19 10-4.1.38-4.3-5.3-3.8-8.2.3-9.7 3-19 5-29z";
15
15
  const pathMainBody = "m83 8c-6.4-2.3-13-5.3-19-8 1.4 5.4-5.4 8.2-10 8.7-5.8.68-13-.075-17-5-1.2-2.1.62-5.1-2.8-2.6-5.6 2.6-11 5.5-17 7.9 5.6 21 3.3 17 6.2 40-.14 15 .16 30-.79 45 1.6 4.7 9.5 4 14 5.2 13 1.8 26 1.2 39-2.3 5.7-1.5 1.5-8.1 2.5-12-.32-15-.32-29-.32-44 5.5-37 1.6-12 4.9-33z";
16
16
  const pathNeck = "m63 .064c-3.8.47-7.5 1.9-11 1.9-5 .31-11-.47-16-1.9-1.7.6-.78 2.8-1.8 4.1-3 5.1-6 10-9 15h50c-3.8-6.4-7.6-13-11-19z";
17
- const pathNeckBack = "m63 .064C 60.12,5.3 53.35,6.6 49.86 6.6 44.86 7 40.4 4 36 .064c-1.7.6-.78 2.8-1.8 4.1-3 5.1-6 10-9 15h50c-3.8-6.4-7.6-13-11-19z";
18
17
  // eslint-disable-next-line new-cap
19
18
  const page = SVG();
20
19
  shirtStyleColor = shirtStyleColor || "#eee";
@@ -151,15 +150,17 @@ export default function drawSoccerJersey({ shirtColor = "plain", shirtStyle, shi
151
150
  */
152
151
  if (texts && texts.length > 0) {
153
152
  for (const textItem of texts) {
154
- const { text, color, size, outlineColor, backgroundColor, backgroundShape, x, y, } = textItem;
153
+ const { text, color, size, outlineColor, backgroundColor, backgroundShape, fontFamily = "Impact", style, weight, x, y, } = textItem;
155
154
  const drawText = (elem) => {
156
155
  return elem
157
156
  .text(text)
158
157
  .fill(color || "#eee")
159
158
  .font({
160
- family: "Monospace",
159
+ family: fontFamily,
161
160
  size,
162
- style: "bold",
161
+ style,
162
+ weight,
163
+ anchor: "middle",
163
164
  })
164
165
  .stroke({
165
166
  color: outlineColor || color,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "soccer-jersey-fork",
3
- "version": "1.0.104",
3
+ "version": "1.0.105",
4
4
  "description": "Generate soccer jerseys in SVG format",
5
5
  "main": "lib/index.js",
6
6
  "author": "nadchif (https://github.com/nadchif)",