Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Font Suggestion: Source Han Sans #108

Open
TriforceOfKirby opened this issue Mar 27, 2015 · 10 comments
Open

Font Suggestion: Source Han Sans #108

TriforceOfKirby opened this issue Mar 27, 2015 · 10 comments
Labels

Comments

@TriforceOfKirby
Copy link

https://github.com/adobe-fonts/source-han-sans

@alfredxing
Copy link
Owner

Thanks! There's a huge backlog of fonts already; I don't think I'll be able to start working on adding fonts until my exams are done (start of May or start of June).

@TriforceOfKirby
Copy link
Author

I could help add fonts if you want via pull request.

@alfredxing
Copy link
Owner

@TriforceOfKirby It is a bit tricky, but if you want to tackle it, that would be great!

@TriforceOfKirby
Copy link
Author

@alfredxing Ok so I opened the font in FontForge, then went to File>Generate Fonts... selected Web Open Font and clicked Generate.

It gives me a warning message:

You are attempting to save a CID font in a non-CID format.
This is ok, but it means that only the current sub-font will be saved. Is that what you want?

If I click Yes, it also gives me another warning message about the em size being 1000 and that it should normally be a power of 2.

Clicking Yes again results in a woff format font that is 5kB(5,088 bytes) file, the original font in otf format is 16.4MB(16,421,764 bytes).

I'm not sure if this is right, I don't think the font file size should shrink that much.

@alfredxing
Copy link
Owner

@TriforceOfKirby Yeah, I think it's a problem with this being an Asian font, which might have different data than regular fonts...

I haven't worked with CID fonts before, but maybe try flattening them? This page provides docs on manipulating CID fonts in FontForge.

@TriforceOfKirby
Copy link
Author

@alfredxing So flattening seems to work, but I do get a couple warning messages:

Internal Error:
Atempt to output -63677 into a 16-bit field. It will be truncated and the file may not be useful.

I still get the font file, but I'm not sure if it was created correctly. I made a test web page with the font embedded on Dropbox.

@alfredxing
Copy link
Owner

That should be okay. It'll just be one character probably, and there's not much we can do other than that. Did the em-size error go away?

Thanks for doing this, by the way. It really helps out!

@TriforceOfKirby
Copy link
Author

@alfredxing No, the em-size warning still shows. Although, this page on FontForge's website says that 1000 is a perfectly fine em size.

You're welcome! I'll help out with a few more fonts too.

@alfredxing
Copy link
Owner

Yep, 1000 is fine. I think (though I'm not sure) that 1000 is used for PostScript outlines, and a power of two (like 1024 or 2048) is usually used for TrueType.

@TriforceOfKirby
Copy link
Author

@alfredxing So I found a command-line tool by Mozilla for converting sfnt fonts(otf, ttf, etc.) to woff format here.

With that I ran this batch command:
FOR %A IN (*.otf) DO sfnt2woff %A
And it converted all the files without any errors, so would this method of converting the fonts be ok?

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

No branches or pull requests

2 participants