Giter Club home page Giter Club logo

handwritten.js's People

Contributors

alias-rahil avatar allcontributors[bot] avatar anirudhbot avatar ashikka avatar dependabot[bot] avatar etnnth avatar hsrambo07 avatar mrbenj avatar newtonmunene99 avatar newyork-anthonyng avatar suyashsonawane avatar vishal-sys-code avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

handwritten.js's Issues

Handwriting options

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!

Quality looks pretty rough, no?

Just trying it out after hearing about it from the Bytes newsletter. Quality looks a little rough with pixelation, clipping and background colour mismatch.

image

Window not Defined

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

Problem with russiian languge

Russian text is transcribed using latin letters it is extremely strange:
fro example:

Привет
is transcribed
as:
Privet

outputtype option type

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

Screenshot from 2021-12-03 14-42-31

Desktop (please complete the following information):

  • OS: Linux
  • Browser: Chrome
  • Version: ^18.11.0

Additional context

Adding Markdown in text area

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

Problem with french

It has proble with french language: all accentuetés character are rendered without accents

Support Chinese?

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.

sugges to support image output

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

demo website

Hi I can't find a demo website showing off handwritten.js ; should be easy with github pages?

add tests and git hooks (husky)

Currently we have no proper checks for code formatting and functional tests.

To-do:

  • Write tests using jest or mocha (just check if the exported function executes properly without any errors)
  • Add pre-commit hooks to run eslint and the tests
  • (Optional) Add commit-msg hook to follow proper commit message convection. See: https://www.conventionalcommits.org/en/v1.0.0/

UI improvement

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

Ability to change ink color

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'))
})

image

Adding aligned outline to the text area(when active)

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

My output seems distored/skewed

output.pdf

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

Need documention for adding to webpack/yarn

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 World test generates pdf document with 2 pages

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!");

Adding Supersript and Subscript

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 "_____"

Adding a Preview Option for mobile devices

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.

make library faster using some optimization techniques

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.

Describe alternatives you've considered

Additional context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.