MCPcopy Create free account
hub / github.com/027xiguapi/code-box / textWriter

Function textWriter

utils/makerQRPost.ts:84–104  ·  view source on GitHub ↗
(
    textArr: string[],
    Style: string,
    align: CanvasTextAlign,
    color: string,
    borderColor: string,
    fontSize: number,
    lineHeight: number,
    pos: Position,
    ctx: CanvasRenderingContext2D
  )

Source from the content-addressed store, hash-verified

82
83 // 绘制文本
84 const textWriter = (
85 textArr: string[],
86 Style: string,
87 align: CanvasTextAlign,
88 color: string,
89 borderColor: string,
90 fontSize: number,
91 lineHeight: number,
92 pos: Position,
93 ctx: CanvasRenderingContext2D
94 ): Position => {
95 ctx.font = Style
96 ctx.textAlign = align
97 ctx.fillStyle = color
98 ctx.strokeStyle = borderColor
99 for (const text of textArr) {
100 pos.y += fontSize * lineHeight
101 ctx.fillText(text, pos.x, pos.y)
102 }
103 return pos
104 }
105
106 // 生成海报
107 const makerQRPost = (): void => {

Callers 1

makerQRPostFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected