-
Notifications
You must be signed in to change notification settings - Fork 253
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
How does subsetting work? #108
Comments
Just pass your string to the |
Thanks! Worked beautifully. Just a stupid question. What is the right way to save the resulting TTF in a string instead of
|
The existing functionality doesn't provide for that use case. If you wanted to avoid writing to disk you might try writing to a memory stream, as does the library itself here, then read that into a variable. |
Sorry for troubling you, but I am struggling to write the output to a memory stream. We cannot simply pass
Just out of curiosity, isn't the main purpose of this program to subset/process fonts for embedding in PDF? Then, why is the default behavior to save the TFF font on the disk? |
That's not the sole purpose but certainly the primary purpose. The primary use case was developed around Dompdf and so usage is written for how that library operates. Regardless, you can write to a memory stream and capture the content in a variable using the following logic:
or using only php-font-lib functions
|
I was unable to make it work. I tried (I added
The second output is a smaller and corrupted file. |
You're right I did forget that command. Updated my example so it doesn't trip up anyone else. But yes, I do see that a file created using the memory stream is corrupted. The file looks mostly correct but the file header wrong. I don't have an answer for what's going on right now. |
I tried to create a simple subset by
it creates the TTF file without error, but the resulting font has no glyph. What am I missing here?
The text was updated successfully, but these errors were encountered: