# kirupa.com - Detect Whether a Font is Installed

**URL:** https://forum.kirupa.com/t/kirupa-com-detect-whether-a-font-is-installed/399543
**Category:** programming
**Created:** [December 2, 2014, 5:04am UTC](https://forum.kirupa.com/t/kirupa-com-detect-whether-a-font-is-installed/399543 "2014-12-02T05:04:05Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)
#### Post date: [December 2, 2014, 5:04am UTC](https://forum.kirupa.com/t/kirupa-com-detect-whether-a-font-is-installed/399543/1 "2014-12-02T05:04:06Z")

</div>

by [kirupa](http://www.kirupa.com/me/index.htm) | 1 September 2012

[Have questions? Discuss this Web Development tutorial with others on the forums.](http://www.kirupa.com/forum/showthread.php?374525-Tutorial-Backup-Your-Site-s-Data-Efficiently-Like-a-Ninja!)

* * *
This is a companion discussion topic for the original entry at [http://www.kirupa.com/html5/detect\_whether\_font\_is\_installed.htm](http://www.kirupa.com/html5/detect_whether_font_is_installed.htm)

---

<div class="post-metadata">

### Author: ![abergquist](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/abergquist/32/12871_2.png) [@abergquist](https://forum.kirupa.com/u/abergquist)
#### Post date: [August 14, 2017, 8:14pm UTC](https://forum.kirupa.com/t/kirupa-com-detect-whether-a-font-is-installed/399543/2 "2017-08-14T20:14:38Z")

</div>

Hi Kirupa,

I enjoyed your “Detect Whether a Font is Installed” article (and appreciate the fact that you mentioned that some other fonts could be the same size [since I thought about it while reading your article]).

Just wanted to mention that the following code at the bottom of the **doesFontExist()** function:

```
if (newSize == baselineSize) {
    return false;
} else {
    return true;
}

```

can be simplified to:

`return (newSize != baselineSize);`

Art Bergquist

---

<div class="post-metadata">

### Author: ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)
#### Post date: [August 17, 2017, 3:35am UTC](https://forum.kirupa.com/t/kirupa-com-detect-whether-a-font-is-installed/399543/3 "2017-08-17T03:35:53Z")

</div>

Thanks for pointing that out, Art. This is one of those things that I deliberately expand to call out the two return values to be more beginner-friendly. This isn’t the first time it’s been brought up. I think @krilnon and @senocular have mentioned this in the past. I’ll go ahead and start simplifying it down to how you suggest shortly.

---

<div class="post-metadata">

### Author: ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)
#### Post date: [September 30, 2017, 3:33am UTC](https://forum.kirupa.com/t/kirupa-com-detect-whether-a-font-is-installed/399543/5 "2017-09-30T03:33:08Z")

</div>

Good catch! @kirupa you should consider fixing this.

---

<div class="post-metadata">

### Author: ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)
#### Post date: [October 1, 2017, 3:44pm UTC](https://forum.kirupa.com/t/kirupa-com-detect-whether-a-font-is-installed/399543/6 "2017-10-01T15:44:55Z")

</div>

Agreed! Fixing that in a few moments 🙂 Thanks @Wouldthat\_Wouldthat!
