Skip to content

Simon-He95/dot-text

Repository files navigation

Dot Text

live demo 可以在线输入,查看效果

功能

一个简单的文字转换为点阵的形式组件

参数

interface DotType {
  text: string /* 文字内容 */
  color?: string /* 颜色 */
  fontWeight?: number /* 粗细 */
  fontSize?: number /* 大小 */
  clear?: Function /* 清空 */
  onload?: Function /* 渲染完成 */
  customShape?: (ctx: CanvasRenderingContext2D, posX: number, posY: number) => void /* 自定义图形 */
}

使用方法

// main.ts
import { DotText } from 'dot-text'
app.component('DotText', DotText)
// .vue
    <dot-text text="Hi,Simon" color="grey" font-size="50" font-weight="10" ma />