Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
hanzi-writer-miniprogram
Advanced tools
[![CircleCI](https://img.shields.io/circleci/project/github/chanind/hanzi-writer-miniprogram/master.svg)](https://circleci.com/gh/chanind/hanzi-writer-miniprogram/tree/master) [![npm](https://img.shields.io/npm/v/hanzi-writer-miniprogram.svg)](https://www
This component can be used in a Wechat miniprogram to add Hanzi Writer for character stroke animations and quizzing.
npm install hanzi-writer-miniprogram
In your page.json
, first add the following to enable the hanzi-writer-view
component:
{
"usingComponents": {
"hanzi-writer-view": "hanzi-writer-miniprogram/hanzi-writer-view"
}
}
Then, add a hanzi-writer-view
component to your page. You must add an id
, width
, and height
, like below:
<hanzi-writer-view id="hz-writer" width="300" height="300" />
Then in your page, you can control the view via createHanziWriterContext(options)
, like below:
import createHanziWriterContext from 'hanzi-writer-miniprogram';
Page({
onLoad: function() {
this.writerCtx = createHanziWriterContext({
id: 'hz-writer',
character: '你',
page: this,
});
// You can call any normal HanziWriter method here
this.writerCtx.loopCharacterAnimation();
}
});
This method requires the id
from the hanzi-writer-view
component in wxml, and the current page
.
By default, character data is loaded from the hanzi-writer CDN, so you'll need to add https://cdn.jsdelivr.net to your list of approved domain names. Otherwise, you can provide your own charDataLoader
function and load character data however you like. You can read more about loading character data here.
You can also pass any other normal Hanzi Writer options to createHanziWriterContext
, except for width
and height
which are set in the hanzi-writer-view
component. You can see a full list of options here.
For more info and docs on Hanzi Writer check out https://chanind.github.io/hanzi-writer
The chinese character svg and stroke order data used by Hanzi Writer is derived from the Make me a Hanzi project with some slight tweaks. The data can be found in the Hanzi Writer Data repo. There's a visualizer for this data here.
Pull requests are welcome! If you would like to contribute code, you'll need to be able to build the project locally. After cloning the Hanzi Writer repo, you can get it set up by running:
yarn install
Hanzi Writer is released under an MIT license.
The Hanzi Writer data comes from the Make Me A Hanzi project, which extracted the data from fonts by Arphic Technology, a Taiwanese font forge that released their work under a permissive license in 1999. You can redistribute and/or modify this data under the terms of the Arphic Public License as published by Arphic Technology Co., Ltd. A copy of this license can be found in ARPHICPL.TXT.
FAQs
[![CircleCI](https://img.shields.io/circleci/project/github/chanind/hanzi-writer-miniprogram/master.svg)](https://circleci.com/gh/chanind/hanzi-writer-miniprogram/tree/master) [![npm](https://img.shields.io/npm/v/hanzi-writer-miniprogram.svg)](https://www
The npm package hanzi-writer-miniprogram receives a total of 1 weekly downloads. As such, hanzi-writer-miniprogram popularity was classified as not popular.
We found that hanzi-writer-miniprogram demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.