pointers getting a WOFF with chars to support css font-feature-settings?

83 views
Skip to first unread message

Rolf-nl

unread,
Feb 18, 2012, 6:28:56 AM2/18/12
to sfntly-users
Hi,

My goal is to generate usable woff (and eot) files that I can use
online with the css3 font-feature-settings property.
Thus being able to work with ligatures, small caps, stylesets for
salts, etc.

I think 98% of the time we have .otf files, meaning these are CFF
based correct? I read in another thread that this is supported by
sfntly because of the internal wrapper of sort of PS data. (http://
groups.google.com/group/sfntly-users/browse_thread/thread/
f55af47d5a011762)

So we must convert the fonts first to ttf before using sfntly?
Is there a good convertor tool for this? Or, should fonts be re-
generated in a tool such as RoboFont or FontLab?

Thanks,
Rolf

Brian Stell

unread,
Feb 26, 2012, 12:28:12 PM2/26/12
to sfntly...@googlegroups.com
Hi Rolf,

An *.otf file can have either TrueType or CFF outlines inside. Off the top of my head I don't know how one can tell which is inside.

As far as tools go, sfntly is currently in the "get the low level C++/Java API working" phase. At the tools level it has some assorted input but no real work or organization yet. Have you tried the instructions John Hudson lists here to see what happens?

Best,

Brian

Stuart Gill

unread,
Feb 29, 2012, 7:53:03 PM2/29/12
to sfntly...@googlegroups.com
Brian is right. The spec states that font files with a CFF table must have the otf extension. Font files with TrueType outlines can have either otf or the ttf extension. So there is no way to tell just by looking at the name. You can open the file programmatically with sfntly and look for the presence of the CFF table. If you want to do it on the command line you could use the SfntDump tool. It's default setting will dump the tables (tag, offset, length, and checksum for each) that are in the font. Note that most of the tools with sfntly are really sample code. The main item of sfntly is the library that lets programmers start to manipulate fonts.

sfntly has very basic support for every table type in the font. For all of the table types that we have explicit support for you can do editing of semantic content of the table. For tables we don't have explicit support for (yet), such as CFF, you can do byte level reading and editing.

Stuart


On Sunday, 26 February 2012 09:28:12 UTC-8, bstell wrote:
Hi Rolf,

An *.otf file can have either TrueType or CFF outlines inside. Off the top of my head I don't know how one can tell which is inside.

As far as tools go, sfntly is currently in the "get the low level C++/Java API working" phase. At the tools level it has some assorted input but no real work or organization yet. Have you tried the instructions John Hudson lists here to see what happens?

Best,

Brian

Rolf

unread,
Mar 1, 2012, 7:01:19 AM3/1/12
to sfntly...@googlegroups.com
Thank you for the replies. I was expecting this :)
I understand the extension isn't of much use to tell what it is - I know the fonts I'm working with and by default they don't have TrueType outlines, but it's no problem creating good TT-outlined based OT fonts to use with sfntly (at least for testing purposes anyway) and was able to produce a correct WOFF.

Is it possible with the current set of sftnly tools provided (even though it's "sample code") to create a subset of a font with for example only greek (like what can be done with the Google Web Font API) or StyleSet X if it is present?
I have been looking in the javadocs and tried some things also using the dump tool, but was more or less shooting in the dark.

My current problem is that I'm no Java or C programmer :) so even though I am able follow most of the Java code I probably can't use it directly to create new tools. I did some byte level reading using PHP on CFF based fonts about a year ago btw which wasn't fun so I dropped that. There are people with more experience to try and implement it. Nevertheless I'm pretty excited about these tools so far.

Brian Stell

unread,
Mar 1, 2012, 7:28:20 PM3/1/12
to sfntly...@googlegroups.com
The short answer is sfntly cannot yet subset OTF/CFF fonts.

Currently sfntly can recognize the CFF table block but cannot take the CFF table apart or reassemble it; ie: cannot edit or subset it. We also want to subset OTF/CFF fonts so we are working on adding subsetting support for CFF but it's a biggish task and will take a while (?several seasons?)

Best,

Brian

Rolf-nl

unread,
Mar 2, 2012, 3:49:43 AM3/2/12
to sfntly...@googlegroups.com
Hi Brian,

I'm (now) testing fonts with TrueType outlines, not CFF based outlines.

Brian Stell

unread,
Mar 2, 2012, 1:35:35 PM3/2/12
to sfntly...@googlegroups.com
Hi Rolf,

Are you auto converting? If so, one of the issues can be that the CFF hints are not generally converted to TrueType hints. This should not make much difference on a Mac since generally Macs don't use hints. However, on Windows a font can render somewhat differently. Auto hinting the TrueType can help but the results may still be different.

I would appreciate hearing how things go.

Best,

Brian

Rolf-nl

unread,
Mar 12, 2012, 4:13:39 PM3/12/12
to sfntly...@googlegroups.com
Hello Brian,

As far as hinting, I'm not looking at it yet. At the moment I work with TT based OT fonts only.

My main interest is getting more insight on how to 'read' advanced layout features like smcp, salt and ss01-ss20 things.
For example from a character/glyph get all alternatives from using aalt, or being able to say that a certain glyph is part of style set 13, or getting a subset with small caps using smcp. This is currently not possible with sfntly, correct? ...since I read in another thread:

If your definition of "best" is more than just does it have a glyph then you may need to use the advanced layout tables (GSUB, GPOS, GDEF) to determine more details. Bill is correct that sfntly doesn't, yet, have support for these.


Rolf
 
Reply all
Reply to author
Forward
0 new messages