alias-rahil / handwritten.js Goto Github PK
View Code? Open in Web Editor NEWConvert typed text to realistic handwriting!
Home Page: https://alias-rahil.github.io/handwritten.js/
License: MIT License
Convert typed text to realistic handwriting!
Home Page: https://alias-rahil.github.io/handwritten.js/
License: MIT License
It would be really great if we get an option to choose handwriting related to our, just common 5-6 types would be really great!
E:\handwriting>node index.js
E:\handwriting\node_modules\handwriting.js\index.js:14429
window.HandWriting = HandWriting;
^
ReferenceError: window is not defined
at Object. ←[90m(E:\handwriting\←[39mnode_modules\←[4mhandwriting.js←[24m\index.js:14429:1←[90m)←[39m
at webpack_require ←[90m(E:\handwriting\←[39mnode_modules\←[4mhandwriting.js←[24m\index.js:20:30←[90m)←[39m
at ←[90mE:\handwriting\←[39mnode_modules\←[4mhandwriting.js←[24m\index.js:66:18
at Object. ←[90m(E:\handwriting\←[39mnode_modules\←[4mhandwriting.js←[24m\index.js:69:10←[90m)←[39m
←[90m at Module._compile (node:internal/modules/cjs/loader:1275:14)←[39m
←[90m at Module._extensions..js (node:internal/modules/cjs/loader:1329:10)←[39m
←[90m at Module.load (node:internal/modules/cjs/loader:1133:32)←[39m
←[90m at Module._load (node:internal/modules/cjs/loader:972:12)←[39m
←[90m at Module.require (node:internal/modules/cjs/loader:1157:19)←[39m
←[90m at require (node:internal/modules/helpers:119:18)←[39m
Node.js v19.9.0
Russian text is transcribed using latin letters it is extremely strange:
fro example:
Привет
is transcribed
as:
Privet
Describe the bug
The outputtype
option doesn't work because when validating with Joi in checkArgType
function in src/index
, the option validated is outputType
but in main
, outputtype
is used.
To Reproduce
Steps to reproduce the behavior:
import handwritten from "handwritten.js";
async function handwrite() {
const result = await handwritten("some sample text", {
outputtype: "png/b64",
});
}
The above throws an error that outputtype
is not allowed.
import handwritten from "handwritten.js";
async function handwrite() {
const result = await handwritten("some sample text", {
outputType: "png/b64",
});
}
The above works but the output type will still end up being a PDF/PDFKit instance
Expected behavior
import handwritten from "handwritten.js";
async function handwrite() {
const result = await handwritten("some sample text", {
outputType: "png/b64",
});
}
The above should output a png base64
Screenshots
Desktop (please complete the following information):
Additional context
Is your feature request related to a problem? Please describe.
Currently we can't change the styling of the text
Describe the solution you'd like
Adding a markdown in the text area so that we can convert the text to bold, italic, etc and can also change the color of the text
It has proble with french language: all accentuetés character are rendered without accents
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
would be great if it can output image data in the format of jpeg/png in base64 or buffer, so it could be used in the browser
Hi I can't find a demo website showing off handwritten.js ; should be easy with github pages?
Currently we have no proper checks for code formatting and functional tests.
To-do:
UI improvement needed to the current website.
Feature requested : Better UI for the site
Submit your proposed design screenshot first..
Do it such that it wont break the code. :)
proposed changes: a minimalistic approroach to the website
Is your feature request related to a problem? Please describe.
Currently there is no option to change ink color
Describe the solution you'd like
Pass hex value or use predefined constants to change ink color
Additional context
I went through the source code and found a way to implement this feature, I would like to contribute it 🚀
I have attached the results below
handwritten(rawtext, { ruled: true, inkColor: '#0000FF' }).then((converted) => {
converted.pipe(fs.createWriteStream('output.pdf'))
})
Is your feature request related to a problem? Please describe.
Currently the outline of the text area, when active, doesn't align properly with the element's border curves.
Describe the solution you'd like
would like to work on it and align the outline with the border properly according to the border-radius
Somehow it looks weird, as in stretched/skewed, especially compared to the example. The code I', using is just the hello world example with another text.
OS: MacOS 10.15.5
Node: 12.16.1 LTS
Hi
This library looks really awesome. I have a Rails application and want to use handwritten.js.
Can you please improve your docs to installation/setup for webpack/yarn.
Thanks
Hello!
I've read the CONTRIBUTING.md and i'm here to talk about add PT-br font, how can i made it?
adding contributors
Nice library, I tried running a sample Hello World test. It produces 2 pages in output.pdf document, however expected pages should be 1. Code for reproducing the issue:
const handwritten = require('./src/index.js');
const fs = require('fs');
(async function(text) {
let converted = await handwritten(text);
converted.pipe(fs.createWriteStream('output.pdf'));
})("Hello, world!");
It would be nice to have support for these two scripts. Because whenever I tried to add a superscript to my text, the result will be "_____"
JPEG for text is not the best: https://github.com/alias-rahil/handwritten.js/blob/master/screenshots/lorem-ipsum.jpeg
Is your feature request related to a problem? Please describe.
I think it will be useful to add a "Preview" button besides the "download as a PDF" button.
Describe the solution you'd like
Will try to add it.
Is your feature request related to a problem? Please describe.
The library is very slow.
Describe the solution you'd like
The src/bin.js uses fs related blocking sync methods. I believe that the library could be made a lot faster if we use their alternatives. Other optimizations in src/bin.js and src/index.js are also needed.
Currently, there is no CI/CD pipeline implemented for the npm library. It would be great to have a pipeline which checks for version change in package.json
file and publish a newer version if there is a change. It should run on master
branch.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.