Git Product home page Git Product logo

os-fonts's Introduction

๐Ÿ‘‹ Greetings!

os-fonts's People

Contributors

iabukai avatar niftylettuce avatar vutran avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

Forkers

iabukai chalkpe

os-fonts's Issues

Subfont files not found in Windows

Thanks for the library!

I'm noticing in Windows that there are fonts listed in the C:\Windows\Fonts\ folder in which you find specific subfamily files like Bold, Italic, etc. For example, the Times New Roman font contains 4 different .ttf files but the filepaths are said to be like:

C:\Windows\Fonts\timesbd.ttf

os-fonts is finding them all and returning the paths as reported by the system, however, there seems to be no way of accessing the file by path directly. If you enter the above in file explorer you get:

Windows can't find C:\Windows\Fonts\timesbd.ttf. Check the spelling and try again.

I am a Mac user mainly but need to develop an app for both Windows and Mac from which the user can access their local files. This is creating a bit of a problem. Has this been an issue for you in your experience? If so, how did you overcome it?

Thanks again.

UPDATE: This was an issue where Chromium was stripping out the backslashes in the file path on Windows. Used slash to fix the problem. Would still love to know how to access the subfont ttf files in Windows Explorer.

Basic test does not work (`process.env.WIN_DIR` undefined)

You cannot use path with an undefined variable.

ฮป ~/Public/project/ master* node -i
> require('os-fonts');
TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.join (path.js:1211:7)
    at Object.<anonymous> (/Users/user/Public/project/node_modules/os-fonts/index.js:15:16)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)

If folder does not exist on a platform then it errors

I believe that if we pass useType to be network, and the path does not exist for the network folder, then we should return an empty array instead of throwing an error (because path.join and fs.readDir are reading a director that does not exist. Perhaps you could modify the code so that it checks fs.stats if the directory exists, and if not return an empty array.

precommit breaks on Windows

Question : Which OS do you use?
The precommit is breaks on windows for me :

No matching files. Patterns tried: '{{mocks,test}/*.js' 'index.js' !/node_modules/ !./node_modules/**

Although if I remove the quotes from these : '{{mocks,test}/*.js' 'index.js' its perfectly working.

Are you working on darwin or linux?

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.