A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Hopding/unicode-properties below:

Hopding/unicode-properties: Provides fast access to unicode character properties

This project is a fork of https://github.com/foliojs/unicode-properties created for use in https://github.com/Hopding/pdf-lib.

Listed below are changes that have been made in this fork:

Also see

Provides fast access to unicode character properties. Uses unicode-trie to compress the properties for all code points into just 12KB.

import unicode from '@pdf-lib/unicode-properties';

unicode.getCategory('2'.charCodeAt()) //=> 'Nd'
unicode.getNumericValue('2'.charCodeAt()) //=> 2

To install the latest stable version:

# With npm
npm install --save @pdf-lib/unicode-properties

# With yarn
yarn add  @pdf-lib/unicode-properties

This assumes you're using npm or yarn as your package manager.

You can also download @pdf-lib/unicode-properties as a UMD module from unpkg. The UMD builds have been compiled to ES5, so they should work in any modern browser. UMD builds are useful if you aren't using a package manager or module bundler. For example, you can use them directly in the <script> tag of an HTML page.

The following builds are available:

When using a UMD build, you will have access to a global window.UnicodeProperties variable. This variable contains the object exported by @pdf-lib/unicode-properties. For example:

// NPM module
import unicode from '@pdf-lib/unicode-properties';

// UMD module
var unicode = window.UnicodeProperties;

Returns the unicode general category for the given code point.

Returns the script for the given code point.

getCombiningClass(codePoint)

Returns the canonical combining class for the given code point.

getEastAsianWidth(codePoint)

Returns the East Asian width for the given code point.

getNumericValue(codePoint)

Returns the numeric value for the given code point, or null if there is no numeric value for that code point.

Returns whether the code point is an alphabetic character.

Returns whether the code point is a digit.

Returns whether the code point is a punctuation character.

Returns whether the code point is lower case.

Returns whether the code point is upper case.

Returns whether the code point is title case.

Returns whether the code point is whitespace: specifically, whether the category is one of Zs, Zl, or Zp.

Returns whether the code point is a base form. A code point of base form does not graphically combine with preceding characters.

Returns whether the code point is a mark character (e.g. accent).

MIT


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4