Comments (10)
Do you know if Fira has actual kerning information ?
from freetype-py.
Yes, it does
from freetype-py.
Ok, I will try to investigate using same method as the bbox
from freetype-py.
From the script below, I get some flags but none for the kerning. Maybe kerning is present but freetype does not advertise it (and in this case, there is not much we can do).
import freetype
face = freetype.Face('FiraSans-Book.ttf')
print("Scalable: ", bool(face.face_flags & freetype.FT_FACE_FLAG_SCALABLE))
print("Fixed sizes: ", bool(face.face_flags & freetype.FT_FACE_FLAG_FIXED_SIZES))
print("Fixed width: ", bool(face.face_flags & freetype.FT_FACE_FLAG_FIXED_WIDTH))
print("SFNT: ", bool(face.face_flags & freetype.FT_FACE_FLAG_SFNT))
print("Horizontal: ", bool(face.face_flags & freetype.FT_FACE_FLAG_HORIZONTAL))
print("Vertical: ", bool(face.face_flags & freetype.FT_FACE_FLAG_VERTICAL))
print("Kerning: ", bool(face.face_flags & freetype.FT_FACE_FLAG_KERNING))
print("Fast glyphs: ", bool(face.face_flags & freetype.FT_FACE_FLAG_FAST_GLYPHS))
print("Multiple masters: ", bool(face.face_flags & freetype.FT_FACE_FLAG_MULTIPLE_MASTERS))
print("Glyph names: ", bool(face.face_flags & freetype.FT_FACE_FLAG_GLYPH_NAMES))
print("External stream: ", bool(face.face_flags & freetype.FT_FACE_FLAG_EXTERNAL_STREAM))
print("Hinter: ", bool(face.face_flags & freetype.FT_FACE_FLAG_HINTER))
print("CID Keyed: ", bool(face.face_flags & freetype.FT_FACE_FLAG_CID_KEYED))
print("Tricky: ", bool(face.face_flags & freetype.FT_FACE_FLAG_TRICKY))
Scalable: True
Fixed sizes: False
Fixed width: False
SFNT: True
Horizontal: True
Vertical: False
Kerning: False
Fast glyphs: False
Multiple masters: False
Glyph names: True
External stream: False
Hinter: True
CID Keyed: False
Tricky: False
from freetype-py.
Also, from freetype documentation:
Not all font formats contain kerning information, and not all kerning formats are supported by FreeType; in particular, for TrueType fonts, the API can only access kerning via the ‘kern’ table. OpenType kerning via the ‘GPOS’ table is not supported! You need a higher-level library like HarfBuzz, Pango, or ICU, since GPOS kerning requires contextual string handling.
from freetype-py.
Fira, like the vast majority of modern fonts only has GPOS kerning and no ttf “kern” table. So that would explain it. But how can freetype lack such a thing? It sounds pretty essential
from freetype-py.
It is essential and can become pretty complex for some languages . I imagine this is the reason why freetype doesn't handle it outside the kern table. You'll have to use HarfBuzz or pango.
from freetype-py.
is it possible for freetype to just return the opentype kerning table itself so I can read latin kern pairs off of it?
from freetype-py.
I don't know. You should ask on the freetype mailing list.
from freetype-py.
ugh so the FAQ says Well, the engine already reads OpenType/CFF files perfectly. What it doesn't do is handling ‘OpenType Layout’ tables.
from freetype-py.
Related Issues (20)
- [Question] How to decode Face.postscript_name? HOT 26
- About emoji from font file error HOT 9
- libfreetype.so when system == Emscripten HOT 11
- Documentation for get_first_char HOT 3
- FT_Exception: (cannot open resource) HOT 21
- Two-factor identification on PyPi HOT 5
- get_cbox() raise "invalid argument" error HOT 3
- Wrong horizontal character positioning in hello world examples HOT 9
- New release with pyinstaller fix HOT 5
- feature request: expose FreeType's COLRv1 API HOT 6
- Please publish .tar.gz sdist archives
- on exit, freetype/__init__.py", line 1233, in __del__ TypeError: 'NoneType' object is not callable HOT 10
- `segfault` with version `2.4.0` HOT 10
- possible memory leaks and issues during finalizer HOT 1
- `load_char` failed for custom fonts with right input HOT 28
- Pyinstaller cannot import module HOT 5
- AttributeError: module 'freetype' has no attribute 'Face' HOT 2
- Please provide non-bundled wheels HOT 7
- Remove the pyinstaller code if there is any more trouble
- Move freetype-py to Freetype organisation ? HOT 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 freetype-py.