Coder Social home page Coder Social logo

clearleft / whatfont-bookmarklet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chengyin/whatfont-bookmarklet

2.0 16.0 1.0 130 KB

The core of WhatFont Tool

Home Page: http://chengyinliu.com/whatfont.html

License: University of Illinois/NCSA Open Source License

JavaScript 100.00%

whatfont-bookmarklet's Introduction

WhatFont

WhatFont is a JavaScript script to detect what font in the stack is being used on any elements of a web page.

Here in the repo is the core component with out wrappers, the wrapped Chrome/Safari extensions are available at http://chengyinliu.com/whatfont.html.

How to Use

whatfont_core.js is the core script. It adds _whatFont() into the global scope. WhatFont then runs in a closure created by the _whatFont() function.

An controller object is returned by whatFont() function. The controller will be used to set up the dependencies (jQuery and stylesheet) and initialize WhatFont.

This controller has the following functions:

  • setJQuery(jQ)

    WhatFont requires jQuery (v1.5.2), if jQuery has already been loaded into the global scope, the script finds it automatically. Otherwise setJQuery(jQ) needs to be called to set up jQuery object.

  • setCSSURL(url)

    WhatFont injects its stylesheet file into the webpage. The script comes with a default URL setting, if you want to change the setting, calling this function.

  • getVer()

    Return the version of WhatFont.

  • init()

    Initialize WhatFont and inject to the current document.

  • restore()

    Remove WhatFont from current document.

Example

wf = _whatFont();		
wf.setjQuery(jQuery);		// Setup jQuery
wf.init();					// Load WhatFont
wf.restore();				// Remove WhatFont

whatfont-bookmarklet's People

Contributors

chengyin avatar allmarkedup avatar riobard avatar bennettmcelwee avatar

Stargazers

Lukas Imrich avatar Olof avatar

Watchers

Jeremy Keith avatar James Box avatar Ben Sauer avatar Andy Dennis avatar  avatar James Cloos avatar  avatar Charlotte avatar Clearleft Bot avatar  avatar Mikey Allan avatar Viviana Doctorovich avatar  avatar Andy Thornton avatar  avatar  avatar

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.