santhoshtr / meera-tamil

Meera Tamil Unicode font, Now renamed as Meera Inimai and moved to https://gitlab.com/smc/meera-inimai/
https://fonts.google.com/specimen/Meera+Inimai
Other
15 stars 4 forks source link

Use woff-tools and eot-utils to generate woff #11

Open copyninja opened 10 years ago

copyninja commented 10 years ago

Hi @santhoshtr now that woff and eot files are removed which was shipped by Debian so I found a aternative to do this using tools in Debian instead of sfntly. Here is patch I've for this purpose consider merging this if it does things properly

--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,7 @@
    do \
        ./generate.pe $${font}.sfd; \
        echo "Compiled the font $${font}";\
-   done 
+   done

 install: compile
 # copy ttf files to system font directory
@@ -40,8 +40,7 @@
 # generate webfonts
    @for font in `echo ${fonts}`; \
    do \
-       sfntly -w $${font}.ttf $${font}.woff; \
-       sfntly -e -x $${font}.ttf $${font}.eot; \
+       sfnt2woff -m debian/meera_woff_metadata.xml $${font}.ttf; \
+       mkeot $${font}.ttf > $${font}.eot; \
        echo "Webfonts generated for $${font}"; \
    done
-   

I'm shipping this with 1.1 of meera-tamil package, I've validated the woff font using validator but not eot. If there is issue in generated font by above snippet consider filing bug once 1.1 hits archive.

santhoshtr commented 10 years ago

That tools do work, but not optimal. https://people.mozilla.org/~jkew/woff/ is very outdated(Updated in 2009). WOFF conversion tools were optimized in past years for better compression. WOFF 2.0 is coming. EOT can use Microtype Express compression[1] now a days. Practically the size optimization is critical for webfonts. You can observe a big size difference with sfntly with these optimization and the normal woff conversion tools(eg: fontforge woff conversion feature).

For this font, you can see the eot size from mkeot is 54124 Bytes while the eot from sfnlty with Microtype express compression is 24535 Bytes

The patch miss debian/meera_woff_metadata.xml file.

[1] https://code.google.com/p/sfntly/wiki/MicroTypeExpress

copyninja commented 10 years ago

I see then I would request not to merge this patch, since you removed woff and eot from source (Well I should have been clear to ask you remove only ttf file ) I came up with this approach. @jonassmedegaard this was the reason why I wasn't using these tools!. (But for some reason I forgot)

@santhoshtr on the other hand @jonassmedegaard found this tool https://github.com/ananthakumaran/webify can you tell if this tool generates the files proper? sfntly is hard to package so we are looking for alternative to generating webfonts.

jonassmedegaard commented 10 years ago

From a quick look into the source of webify it does not seem to mention WODD 2.0 nor Microtype Express. I have thus filed https://github.com/ananthakumaran/webify/issues/8

Suggestions for other alternatives to sfntly is appreciated too.

copyninja commented 10 years ago

@santhoshtr WOFF 2.0 is not yet finalized at least this page correct me if wrong. Are you sure woff 2.0 is supported by browsers? I couldn't find much with woff 2.0 support in browsers can you clarify on this?

jonassmedegaard commented 10 years ago

Right, WOFF 2.0 is future (you brought it up yourself). I suspect support for Microtype Express is less important when also taking gzip-serving the content into account. Do you have any knowledge on that?