Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
A simple typography engine for CJK languages, especially designed for game rich-text.
活字是 AVG.js 的模块之一,为剧情游戏文字排版设计,兼顾中西混排和纯西文排版。
排版规则
npm install huozi
import huozi from 'huozi';
const canvas = document.getElementById('app');
const context = canvas.getContext('2d');
const textSequence = '需要排版的文字内容'.split('').map(value => {
return {
fontSize: 26,
character: value
}
});
const layoutSequence = huozi(textSequence);
context.clearRect(0, 0, 800, 600);
context.strokeStyle = '#999';
for (const char of layoutSequence) {
context.font = `${char.fontSize}px sans-serif`;
context.textBaseline = 'hanging';
context.fillText(char.character, char.x, char.y);
context.strokeRect(char.x, char.y, char.width, char.height);
}
输入格式:
[{
character: String, // 单个字符
fontSize: Number // 该字符的字号
}]
输出格式:
[{
character: String,
fontSize: Number,
x: Number, // 绝对坐标
y: Number, // 绝对坐标
width: Number, // 字符宽度
height: Number // 字符高度
}]
欢迎任何 Issue 和 Pull Request!
本程序根据使用目的采用双授权的方式,你可以根据如下条款选择适合你的许可协议:
FAQs
A simple typography engine for CJK languages, especially designed for game rich-text.
The npm package huozi receives a total of 1 weekly downloads. As such, huozi popularity was classified as not popular.
We found that huozi 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.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.