Comments (3)
Given that there is no guarantee that the font metrics would be even remotely similar, you'd probably have to do a fair bit of work based on getting the various metrics (both font global and specific to that glyph) for both fonts so you can match one to the other. This is something that might feel like it should be straight forward, but is actually a lot of work in terms of making sure the replacements look right =)
from fontkit.
Thanks for the response. Since posting, I've dug in a bit more. Seems like the best route might be to convert ttf to a SVG font, and add glyphs and adjust metrics as needed just with XML manipulation, then convert it back to ttf.
from fontkit.
That's an option, although you'll still need to perform the metrics matching there, too (so you don't end up with a full stop that's the size of a lowercase O, or positioned halfway up the main font's ascender because the two fonts have different baselines, for example).
Although at that point you're also just "creating a new font" by mashing two fonts together, rather than relying on font stack logic, so I guess the question is "what are you actually doing" (i.e. what kind of thing are you trying to implement, in which tech stack. Because useful as fontkit is, it might not actually be the right tool for the job)
from fontkit.
Related Issues (20)
- babel-runtime ^6.26.0 is outdated HOT 9
- Reading a ttf font file familyName returns a buffer HOT 3
- Building error "data.trie" with rollup HOT 4
- Consider bringing back improvements from @pdf-lib/fontkit HOT 7
- ReferenceError: Cannot access 'c3x' before initialization HOT 1
- encoding problems after dropping iconv-lite HOT 3
- Unable to import fontkit's package.json in dependent packages
- Issue in migrating from 1.8.0 to 2.0.0 HOT 1
- Missing Non Unicode characters from fontkit object HOT 1
- Feature Request: expose getKerning(left, right) to users HOT 2
- Missing instructions on how to build fontkit for brwoser HOT 2
- .advanceWidth triggers RangeError: Offset is outside the bounds of the DataView HOT 2
- Bad glyphs code points produce by layout function with Arabic font HOT 1
- TypeError when encoding subset of font with set variation
- Modify and save/write a font HOT 1
- font.layout crashing on esoteric unicode character
- Implementation question: availableFeatures HOT 1
- Support glyph path fill rule (non-zero winding / even-odd crossing / etc)
- Handle avar table version 2
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.