chengyin / WhatFont-Bookmarklet

The core of WhatFont Tool
http://chengyinliu.com/whatfont.html
University of Illinois/NCSA Open Source License
488 stars 74 forks source link

Add Fontdeck detection support #3

Closed allmarkedup closed 12 years ago

allmarkedup commented 12 years ago

Hello!

I've done a bit of work on the core js file to add detection of fonts served from fontdeck.com. It uses the (as yet undocumented) Fontdeck api to retrieve the font details.

Just as a note: In order to get the link to the font on the Fontdeck website, it checks if the API has supplied a URL for that font, otherwise it falls back to submitting a search with that font's name. The search fallback is really just a stopgap solution as the API does not yet supply the URL for all fonts yet, but it will do shortly.

Hope this is useful for you - any questions or amends please let me know.

Mark

allmarkedup commented 12 years ago

Oh, and one other thing that I forgot to mention - the first commit is actually unrelated to the Fontdeck support but fixes a problem I was seeing with an error being thrown when no attribute was being specified when creating an element.

chengyin commented 12 years ago

Thank you, Mark.

I will merge these and push them into next release.

allmarkedup commented 12 years ago

Great, thanks Chengyin :-)

allmarkedup commented 12 years ago

Hi Chengyin - just a heads up that I've added another commit to this pull request with a minor fix in it - the Fontdeck API has now been updated to supply a website URL for each font and it wasn't checking the correct parameter before.

Cheers,

Mark