Comments (1)
The readme does mention that over in https://github.com/foliojs/fontkit#other-properties, the characterSet
property is specifically for Unicode codepoint glyphs only. If you compare its length to numGlyphs, though, you will see that Fontkit does know that Calibri has over 6.5k glyphs:
const fontkit = require("fontkit");
const fs = require("fs/promises");
fs.readFile("./calibri.ttf")
.then((font) => {
font = fontkit.create(Buffer.from(font));
console.log(font.numGlyphs);
console.log(font.characterSet.length);
})
.catch(err => console.error(err));
outputs:
6954
3663
So if you want to work with the non-unicode glyphs, you'll have to build that list, but then you might still not be able to actually access those characters given that Fontkit's API is built around working specifically with Unicode codepoints.
However, also note that a ton of glyphs are not "letters": glyphs are just vector graphics, and while some glyphs are actual letters, with an associated code point, plenty are just "components" that used in other glyphs, and would make no sense when rendered in isolation: if you load Calibri in an actual font editor, you'll see it contains 3378 "unmapped" glyphs, meaning they are not meant to ever be rendered in isolation, only to be used as parts of other, real, glyphs. In terms of glyphs that you should actually be able to "use" for Calibri, there are only 3660 glyphs with outlines, plus three "empty" glyphs (notdef, the nonmarking return, and space)
from fontkit.
Related Issues (20)
- Implementation question: availableFeatures HOT 1
- Support glyph path fill rule (non-zero winding / even-odd crossing / etc)
- Handle avar table version 2
- Exntend font.layout accept Array of Glyphs and return a GlyphRun? HOT 1
- .getImageForSize(100) returns "null" using "Apple Color Emoji.ttc" HOT 2
- when i use fontkit to genetate the subset of ttf file,but can not open the subset file,shows โnot a valid font fileโ HOT 3
- [Performance] WOFF font format for CJK languages is 5x slower in Chrome and Unresponsive in Firefox HOT 1
- seac-like endchar compatibility syntax not handled HOT 1
- Cannot use Fontkit on CodeSandbox.io HOT 3
- How to extract individual TTF from a font collection (TTC) file?
- Missing initialisation for pts variable for glyphs HOT 1
- Trouble with Kerning / Letter Spacing HOT 1
- fontkit library installing on react js project while importing we have issue
- fonkit 2.0.0 create from ArrayBuffer returns empty `variationAxes` and null parameters HOT 1
- Newest version of restructure doesn't support all string encodings HOT 6
- Empty _table object
- Fontkit.Font to Buffer
- Question: How to lookup name record by nameID
- postscriptname null in some version of fontkit HOT 2
- OS/2 vs hhea font metrics for ascender/descender
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fontkit.