Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simon-he95/dot-text
一个让文字变成点阵的组件
https://github.com/simon-he95/dot-text
canvas dot-text
Last synced: 10 days ago
JSON representation
一个让文字变成点阵的组件
- Host: GitHub
- URL: https://github.com/simon-he95/dot-text
- Owner: Simon-He95
- Created: 2022-06-26T11:48:53.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T17:38:02.000Z (11 months ago)
- Last Synced: 2024-09-14T18:44:36.888Z (about 2 months ago)
- Topics: canvas, dot-text
- Language: TypeScript
- Homepage: https://dot-text.netlify.app/
- Size: 426 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
## Dot Text
[live demo](https://dot-text.netlify.app/)
可以在线输入,查看效果## 功能
一个简单的文字转换为点阵的形式组件## 参数
```typescript
interface DotType {
text: string /* 文字内容 */
color?: string /* 颜色 */
fontWeight?: number /* 粗细 */
fontSize?: number /* 大小 */
clear?: Function /* 清空 */
onload?: Function /* 渲染完成 */
customShape?: (ctx: CanvasRenderingContext2D, posX: number, posY: number) => void /* 自定义图形 */
}
```## 使用方法
```js
// main.ts
import { DotText } from 'dot-text'
app.component('DotText', DotText)
```
```html
// .vue
```