Comments (6)
Thanks for the note! To clarify your request here, you would like the report command output to be available in a table in the binary? Where / how would it be ideal to access it?
My initial concern about this is that a tool could change the metrics data in the font and not update the information that is recorded by font-line in the binary. How should we approach that?
from font-line.
Ah, I see. Are you familiar with Python? This should be reasonably straightforward using the fonttools library and your config file format of choice.
from font-line.
No problem. The fontTools.ttLib.TTFont documentation will be a good place to start. TTFont is a font object that is instantiated from a binary file path. It provides access to all of the OpenType tables that you will need to edit and is the data structure that is used in font-line for read/write access to the metrics data.
Have a look at
font-line/lib/fontline/metrics.py
Lines 17 to 63 in fad1442
tt
is the TTFont
object. What you will want to do is edit those data with the desired values and then save
the font to disk. save
takes a file path and allows you to either save in place or on a different path. I think that the only missing piece will be to decide how you want to configure the data. JSON is supported in the Python stdlib. There are 3rd party packages on PyPI for toml, yaml, etc. Those should be the pieces to get to where you want to go!
Let me know if you run into any issues and if you come up with something that others can use!
from font-line.
Thanks for taking all this time to help me. I will try to get something out of it. Thank you again.
from font-line.
@chrissimpkins i am not very familiar in this field, also not very techy to with all the terminology. so you have to pardon me for my limited knowledge.
I want to change the Metrics
table values which are generated in the text file (ie, [head] yMax:, [head] yMin:, [OS/2] TypoAscender:... and other values)
to gain the line-gap according to my personal taste, where I know the default way to change is to use the percentage command.
I also not that good or able to tell you how can we achieve that. My thoughts are this: We generate the Metrics table in a text file and will it be possible to write back the modified values to the font anyhow? something like font-line font-report.txt > font.ttf
may be?
i can do it with any font-editor app/software (fontforge or anything of such sort) but as command line utilities are always faster in working with, also if I ever in need of editing in bulk amount it would be a perfect choice.
from font-line.
Thank you very much for the information.
Yes I am a little familiar with Python and fonttools. I sometimes use fonttool's TTX but not very advanced user. Can you link me to some tutorial or article from where people like me (with limited knowledge) can learn about what I am trying to achieve here?
from font-line.
Related Issues (20)
- Fix version string reporting in report command HOT 1
- Add support for Markdown formatted metrics list
- Add support for JSON formatted metrics standard output
- Fix License link in ToC
- Better error handling? Crashes when an attribute is not present HOT 12
- Add test font for missing attribute issue
- pip install fails due to permission error HOT 2
- shebang issue HOT 4
- Eliminate Python 2.7 support
- font-line will be upgrading to Py3.6+ support only! HOT 1
- Option to modify ┬ │ ┼ ┴ ├ ┤┘└┌ ┐ glyph heights HOT 7
- Fix file path parser for font files HOT 4
- Font weight changed after changing the interline spacing HOT 16
- Dependabot couldn't authenticate with https://pypi.python.org/simple/ HOT 1
- Add metrics warning to report tool for values that values fall within yMin / yMax HOT 1
- Allow negative percents HOT 10
- Percent command does not properly calculate line spacing when fonts define TypoAscender + TypoDescender > UPM HOT 13
- Add an option to change font family name and/or id HOT 17
- Capital height and X height in Metrics Report. Feasible? HOT 11
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 font-line.