# has-font

> Detect a font is available or not

Latest version **1.0.2** (published 2017-03-24) · 0 weekly downloads

## Install

```sh
npm install has-font
pnpm add has-font
yarn add has-font
bun add has-font
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2017-03-24 |
| First published | 2015-06-20 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | CodinCat |
| Maintainers | codincat |
| Keywords | client, browser, util, font |

## Links

- npm: https://www.npmjs.com/package/has-font
- Repository: https://github.com/CodinCat/hasFont.js
- Issues: https://github.com/CodinCat/hasFont.js/issues
- npm.io page: https://npm.io/package/has-font

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2017-03-24
- 1.0.1 — 2015-07-12
- 1.0.0 — 2015-06-20

## README

hasFont.js
==========

A simple script to check that the user has the font or not. It's vanilla JavaScript, no dependency required.

You can see it in action here: https://codincat.github.io/hasFont.js/


Usage
==========

```
npm install --save has-font
```

or

```html
<script type="text/javascript" src="hasfont.min.js"></script>
```

```javascript
import hasFont from 'has-font'

// hasFont(fontNameString)

if (hasFont('monaco')) {
  element.style.fontSize = '10px'
} else {
  element.style.fontSize = '12px'
}
```

---
_Source: https://npm.io/package/has-font · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
