Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TTF gets converted to CFF #594

Open
ollimeier opened this issue Apr 16, 2023 · 1 comment
Open

TTF gets converted to CFF #594

ollimeier opened this issue Apr 16, 2023 · 1 comment

Comments

@ollimeier
Copy link
Contributor

Expected Behavior

When loading a TTF font I would expect to have truetype tables in the font object. But in fact, I get CFF data.

Current Behavior

Any TTF will be converted into CFF data, eg. there is no glyf table in 'tables'.

Possible Solution

When loading a TTF -> no changes to the actual data.

Steps to Reproduce (for bugs)

for example:

const font = loadSync('./test/fonts/Roboto-Black.ttf');
font.download('Roboto-Black-test.ttf')

Context

I tried to open a TTF file and change only one value in the OS/2 table and save it again. But when I saved the font, it's messed up totally. Many changes have been made automatically and even outlines have been converted to CFF.

Your Environment

  • Version used: The latest master-branch
  • Font used: eg. ./test/fonts/Roboto-Black.ttf
  • Browser Name and version: Not important.
  • Operating System and version (desktop or mobile): Not important.
  • Link to your project: https://github.com/moontypespace
@Connum
Copy link
Contributor

Connum commented Jul 31, 2023

opentype.js currently only supports writing in CFF format, and even that doesn't support all features yet. I think it's very unlikely the library will ever implement TTF format in writing for a variety of reasons, but of course that's open for discussion and if someone came along with a PR implementing a format switch for reading/storing the data and writing, it wouldn't be rejected.
But right now, there are too many other features to tackle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants