Giter Club home page Giter Club logo

custom-fonts-in-emails's People

Contributors

niftylettuce avatar titanism 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

custom-fonts-in-emails's Issues

Question - How to use with browserify

Hi,

How do I use this with browserify?

When I run - browserify my_source.js -o my_output.js

where 'my_source.js' includes the import command for custom-fonts-in-email, I get the following error - import declarations may only occur at top level of a module

TypeError: $ is not a function.

Describe the bug

Node.js version: v16.15.1

Description: TypeError: $ is not a function.

Actual behavior

I installed a custom font called Camelina.otf and placed it in the path /usr/share/font/opentype/ then sudo fc-cache -f -v to update the font cache.
to check if the font in installed or not i tested it with the following code:

import  osFonts from 'os-fonts';
osFonts.getAll().then(fonts => {
    // array of fonts...
    fonts.forEach(font => {
        console.log(font);
    });
})

and i could indeed see that the font exists under the /usr/share/font/opentype/Camelina.otf
after following the guide from your readme i tried to run the program and i always get the error:


TypeError: $ is not a function
    at svg (/home/kazem/WebstormProjects/x/node_modules/custom-fonts-in-emails/lib/index.js:173:14)
    at async png (/home/kazem/WebstormProjects/x/node_modules/custom-fonts-in-emails/lib/index.js:240:18)

Code to reproduce

Saved it as t.mjs and ran it with node t.mjs

import customFonts from 'custom-fonts-in-emails';
import path from 'path';

const options = {
  text: 'Make something people want',
  fontNameOrPath: 'Camelina',
  fontColor: 'white',
  backgroundColor: '#ff6600',
  fontSize: 40
};

customFonts.png2x(options)
  .then(console.log)
  .catch(console.error);

Checklist

  • I have searched through GitHub issues for similar issues.
  • I have completely read through the README and documentation.
  • I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.

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.