Component For Quickly Selecting Fonts From Google Web Fonts | Fontpicker jQuery Plugin

Fontpicker jQuery Plugin is a component for quickly selecting fonts from Google Web Fonts, custom fonts provided by (web developer), as well as system fonts. It allows users to easily select and preview a font from Google’s large free font selection, and optionally choose font weight and font style (normal or italic).

google fonts, system google font picker, font picker html, vue font picker, jquery font picker, system font picker, font picker android github, bootstrap font style picker

Stylish and Modern Notifications Based on Bootstrap and Font Awesome | Notify

How to make use of it:

1. Load the stylesheet jquery.fontpicker.css and JavaScript jquery.fontpicker.js within the HTML file.

<link href="/path/to/dist/jquery.fontpicker.min.css" rel="stylesheet" />
<script src="/path/to/cdn/jquery.slim.min.js"></script>
<script src="/path/to/dist/jquery.fontpicker.js"></script>

2. Create a standard enter subject for the font picker.

<input id="myFontPicker" type="text">

3. Just name the function fontpicker on the input subject and the plugin will handle the remaining.

$('#myFontPicker').fontpicker();

4. Apply the chosen font household to a given element utilizing the change occasion.

function applyFont(element, fontSpec) {

  // Split font into family and weight/style
  var tmp = fontSpec.split(':'),
    family = tmp[0],
    variant = tmp[1] || '400',
    weight = parseInt(variant,10),
    italic = /i$/.test(variant);

  // Set selected font on paragraphs
  var css = {
    fontFamily: "'" + family + "'",
    fontWeight: weight,
    fontStyle: italic ? 'italic' : 'normal'
  };

  $(element).css(css);
  
}
$('#myFontPicker').fontpicker()
.on('change', function() {
  applyFont('#yourElement', this.value);
});

5. Determine whether or not to not present font variants.

$('#myFontPicker').fontpicker({
  variants: false
});

6. Customize the system fonts you need to make use of. Setting the choice  false will disable system fonts.

$('#myFontPicker').fontpicker({
  localFonts: {// Default: web safe fonts
    "Arial": {
      "category": "sans-serif",
      "variants": "400,400i,600,600i"
    },
    "Courier New": {
      "category": "monospace",
      "variants": "400,400i,600,600i"
    },
    "Georgia": {
      "category": "serif",
      "variants": "400,400i,600,600i"
    },
    "Tahoma": {
      "category": "sans-serif",
      "variants": "400,400i,600,600i"
    },
    "Times New Roman": {
      "category": "serif",
      "variants": "400,400i,600,600i"
    },
    "Trebuchet MS": {
      "category": "sans-serif",
      "variants": "400,400i,600,600i"
    },
    "Verdana": {
      "category": "sans-serif",
      "variants": "400,400i,600,600i",
    }
  }
});

7. Add your individual customized fonts to the font picker. Specify the path to the font folder containing .woff information.

$('#myFontPicker').fontpicker({
  localFontsUrl: '/fonts/'
});

8. Determine the parent container the place the font picker popup is hooked up to.

$('#myFontPicker').fontpicker({
  parentElement: '#customContainer'
});

9. Determine whether or not to allow font lazy load.

$('#myFontPicker').fontpicker({
  lazyLoad: true
});

10. Determine what number of lately picked fonts to remember.

$('#myFontPicker').fontpicker({
  nrRecents: 5
});

11. Execute a callback when a font is chosen.

$('#myFontPicker').fontpicker({
  onSelect: function(e) {
    fontType: fontType,
    fontFamily: fontFamily,
    fontStyle: italic ? 'italic' : 'normal',
    fontWeight: weight,
    fontSpec: value
  }
});

12. Determine whether or not to show the clear button.

$('#myFontPicker').fontpicker({
  showClear: true
});

13. Set the language of the font picker. Available languages: ‘en’, ‘de’, ‘fr’, ‘es’, ‘nl’.

$('#myFontPicker').fontpicker({
  lang: 'en'
});

14. API strategies.

// set font: weight 800, italic
$('#myFontPicker').val('Open Sans:800i').trigger('change');

// show/hide the font picker
$('#myFontPicker').fontpicker('show');
$('#myFontPicker').fontpicker('hide');

// destroy the font picker
$('#myFontPicker').fontpicker('destroy');

Select/Preview Google/System/Custom Fonts, Fontpicker jQuery Plugin/Github


See Demo And Download

Official Website(av01d): Click Here

This superior jQuery/javascript plugin is developed by av01d. For extra Advanced Usages, please go to the official website.

Related Posts

Responsive-Multiple-Selection-Combo-Box-using-Bootstrap-3

Responsive Multiple Selection Combo Box using Bootstrap 3 | MagicSuggest

MagicSuggest is an easy-to-use jQuery plugin for creating a combo menu that allows you to select multiple items from a dropdown list with typing and auto-complete support….

material-design-tab-vanilla-js

Material Design Inspired Tab UI In Vanilla JavaScript

Material Design tab vanilla JS implements a material design-inspired tab component with a click ripple effect and an active sliding menu cursor. Must Read: Responsive Accessible Tabs…

countdown-timer-app

Simple Countdown Timer App In jQuery

The countdown is a front-end application that allows starting the countdown with two options: set a target date or write the number of countdown days. A countdown…

html5-animate-js

Add Animation to Your HTML5 Pages | animate.js

animate.js is a small JavaScript library that provides a convenient way to apply CSS animations powered by Animate.css to DOM elements without writing any CSS. Easily apply…

vue-responsive-parallax-cards

Responsive Hover Parallax Cards With Vuejs

Vue Responsive Parallax Cards Hover Create response cards with a scroll-triggered parallax effect in your Vue.js application. Must Read: jQuery Sliding Display Your Content Like a Deck…

pure-css-tabs-responsive

Responsive Pure CSS Only Accordion & Tabs Component

Responsive pure CSS accordion tabs and tabs will automatically convert to a vertical accordion interface on mobile devices. Must Read: Create Dynamic Accordion Giving JSON Data Using…