Jan Pokorny | 20 Feb 2012 16:24
Picon
Favicon

[PATCH 0/6] Liberation: more flexible Makefile incl. formats for web

Hi Pravin and list,

at sunzi project, we strive to consume external components from
their repositories and other native locations.  To make it easily
possible also with Liberation fonts, I went through the existing
Makefile with the aim to add support for exporting into common web
formats, making some other changes on my way.

In fact, the change I desire is concentrated in the last patch, but
I hope the previous ones (split into more patches for easier review)
also make sense.  The compatibility with releasing workflow as well
as with the job of system packagers should be guaranteed.

If there is something wrong with the patchset, feel free to bug me
on.  Otherwise I would be grateful for applying it.

P.S. I can go ahead and file a bug (referring to this thread) if it is
a preferred channel.

Regards,
Jan

Jan Pokorný (6):
  Makefile: do not remove file we do not create
  Fix duplicate README (nested as link to root one)
  Makefile: add .PHONY target
  Makefile: add check target using fontlint
  Makefile: restructure for usability and modularity
  Makefile: now support other common export formats

(Continue reading)

Jan Pokorny | 20 Feb 2012 17:08
Picon
Favicon

[PATCH 1/6] Makefile: do not remove file we do not create

Signed-off-by: Jan Pokorný <jpokorny <at> redhat.com>
---
 source/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/source/Makefile b/source/Makefile
index 3fe1620..f80020b 100644
--- a/source/Makefile
+++ b/source/Makefile
 <at>  <at>  -35,7 +35,7  <at>  <at>  dist-ttf: clean-ttf build
 clean: clean-ttf clean-src

 clean-ttf:
-       rm -rf ttf liberation-fonts-*
+       rm -rf liberation-fonts-*

 clean-src:
        rm -f *.tar.gz
--

-- 
_______________________________________________
fonts mailing list
fonts <at> lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/fonts
http://fonts.fedoraproject.org/
Jan Pokorny | 20 Feb 2012 17:12
Picon
Favicon

[PATCH 2/6] Fix duplicate README (nested as link to root one)

Also fix options to tar command so the symlinks are resolved first.

Note that previously, dist-ttf would propably fail if not dist-sfd
was not run in advance (due to missing "cp ../README ./").

Signed-off-by: Jan Pokorný <jpokorny <at> redhat.com>
---
 source/Makefile |    5 +--
 source/README   |   83 +------------------------------------------------------
 2 files changed, 3 insertions(+), 85 deletions(-)
 mode change 100644 => 120000 source/README

diff --git a/source/Makefile b/source/Makefile
index f80020b..018bbed 100644
--- a/source/Makefile
+++ b/source/Makefile
 <at>  <at>  -20,16 +20,15  <at>  <at>  dist-src: dist-sfd

 dist-sfd:
        mkdir -p $(TMPDIR)/liberation-fonts-$(VER)/{src,scripts}
-       cp ../README ./
        cp Makefile $(MISCFILES) $(TMPDIR)/liberation-fonts-$(VER)/
        cp $(SFDFILES) $(TMPDIR)/liberation-fonts-$(VER)/src/
        cp $(SCRIPTS) $(TMPDIR)/liberation-fonts-$(VER)/scripts/
-       tar Cczvf $(TMPDIR)/ liberation-fonts-$(VER).tar.gz \
+       tar Cczvhf $(TMPDIR)/ liberation-fonts-$(VER).tar.gz \
          liberation-fonts-$(VER)/

 dist-ttf: clean-ttf build
        cp $(MISCFILES) liberation-fonts-ttf-$(VER)/
(Continue reading)

Jan Pokorny | 20 Feb 2012 17:13
Picon
Favicon

[PATCH 3/6] Makefile: add .PHONY target

Signed-off-by: Jan Pokorný <jpokorny <at> redhat.com>
---
 source/Makefile |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/source/Makefile b/source/Makefile
index 018bbed..eb53799 100644
--- a/source/Makefile
+++ b/source/Makefile
 <at>  <at>  -38,3 +38,5  <at>  <at>  clean-ttf:

 clean-src:
        rm -f *.tar.gz
+
+.PHONY: all build dist dist-src dist-sfd dist-ttf clean clean-ttf clean-src
--

-- 
_______________________________________________
fonts mailing list
fonts <at> lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/fonts
http://fonts.fedoraproject.org/
Jan Pokorny | 20 Feb 2012 17:16
Picon
Favicon

[PATCH 4/6] Makefile: add check target using fontlint

Fontlint is a font checker accompanying FontForge.
The check will proceed the SFD files through it, outputting the messages
to both standard output and to the per commit specific file (failback
to per date specific if git information not available) for easy
regression checking.  This final part of "check" workflow can be done,
e.g., manually (with diff selecting the right files to compare).

To prevent logs from check messing the repo, capture them in local
.gitignore file that initially includes also archives and directory
with generated TTF files.

See also: https://bugzilla.redhat.com/show_bug.cgi?id=795465

Signed-off-by: Jan Pokorný <jpokorny <at> redhat.com>
---
 source/.gitignore |    7 +++++++
 source/Makefile   |   12 +++++++++++-
 2 files changed, 18 insertions(+), 1 deletions(-)
 create mode 100644 source/.gitignore

diff --git a/source/.gitignore b/source/.gitignore
new file mode 100644
index 0000000..0615b11
--- /dev/null
+++ b/source/.gitignore
 <at>  <at>  -0,0 +1,7  <at>  <at> 
+# archives (this dir only)
+/*.tar.gz
+/*.zip
+# generated subdirectories
(Continue reading)

Jan Pokorny | 20 Feb 2012 17:18
Picon
Favicon

[PATCH 5/6] Makefile: restructure for usability and modularity

Previously, it was rather a shell script than set of recipes
with resource dependencies tracking.

The old targets (should) work as they used to, plus there are new ones:
- make ttf:
  generate TTF files in the "export" dir (which can be overriden from
  command line), utilizing native feature of "make" to generate only
  files the sources of which have changed (useful, e.g., for continuous
  updates tracking)
- make ttf-dir:
  target which "make" and "make down" boil down to, single-shot
  batch generation of TTF file to dedicated directory, i.e., without
  the advantage of dependency-change tracking as with the previous

To handle more universal tasks, new FontForge script was added
as scripts/fontexport.pe (it even contains brief help) and is
integrated on the places as the other ones.

Also .gitignore is extended with "export" dir.

Signed-off-by: Jan Pokorný <jpokorny <at> redhat.com>
---
 source/.gitignore            |    1 +
 source/Makefile              |   99 ++++++++++++++++++++++++++----------------
 source/scripts/fontexport.pe |   22 +++++++++
 3 files changed, 85 insertions(+), 37 deletions(-)
 create mode 100644 source/scripts/fontexport.pe

diff --git a/source/.gitignore b/source/.gitignore
index 0615b11..2b685a5 100644
(Continue reading)

Jan Pokorny | 20 Feb 2012 17:19
Picon
Favicon

[PATCH 6/6] Makefile: now support other common export formats

Based on the previous patch, we create a generalization of how was
"ttf" target handled to support exporting also to other common
formats.  We add "4web" target covering common formats used on
the web (HTML/CSS:font-face): TTF, WOFF, SVG, EOT.
It is easy to add other formats if needed and provided that
such format is supported by FontForge.

To be honest, I am not sure about two things:
- Is the existing TTF export OK for web usage?  Have been exploring
  this field shortly, but cannot defuse my confusion (TTF/OTF, ...).
- Is hardcoded "fmflags" parameter in scripts/fontexport.pe
  OK also for formats other than TTF?

Signed-off-by: Jan Pokorný <jpokorny <at> redhat.com>
---
 source/Makefile |   37 +++++++++++++++++++++++++++++--------
 1 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/source/Makefile b/source/Makefile
index 995443b..c2bf920 100644
--- a/source/Makefile
+++ b/source/Makefile
 <at>  <at>  -1,7 +1,13  <at>  <at> 
+# common targets:
+# <no target>, build, ttf-dir: create dedicated dir with TTF files
+# ttf:                         create export dir with TTF files, track changes
+# 4web:                        dtto for TTF, WOFF, SVG, and EOT
+
 FONTFORGE    = fontforge
 FONTLINT     = fontlint
(Continue reading)

Pravin Satpute | 21 Feb 2012 07:20
Picon
Favicon

Re: [PATCH 6/6] Makefile: now support other common export formats

On 02/20/2012 09:49 PM, Jan Pokorny wrote:
> Based on the previous patch, we create a generalization of how was
> "ttf" target handled to support exporting also to other common
> formats.  We add "4web" target covering common formats used on
> the web (HTML/CSS:font-face): TTF, WOFF, SVG, EOT.
> It is easy to add other formats if needed and provided that
> such format is supported by FontForge.
>
> To be honest, I am not sure about two things:
> - Is the existing TTF export OK for web usage?  Have been exploring
>   this field shortly, but cannot defuse my confusion (TTF/OTF, ...).

Yes. It should work fine.
I have not explored Web fonts yet much, this is learning experience for
me as well.

> - Is hardcoded "fmflags" parameter in scripts/fontexport.pe
>   OK also for formats other than TTF?

Will be good if you can test it and update the thread, so before final
commit i will be in better position.

Regards,
Pravin Satpute
_______________________________________________
fonts mailing list
fonts <at> lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/fonts
http://fonts.fedoraproject.org/
Jan Pokorny | 21 Feb 2012 22:19
Picon
Favicon

Re: [PATCH 6/6] Makefile: now support other common export formats

On February 21, 2012 7:20:27 AM, Pravin Satpute wrote:
> 
> On 02/20/2012 09:49 PM, Jan Pokorny wrote:
> > Based on the previous patch, we create a generalization of how was
> > "ttf" target handled to support exporting also to other common
> > formats.  We add "4web" target covering common formats used on
> > the web (HTML/CSS:font-face): TTF, WOFF, SVG, EOT.
> > It is easy to add other formats if needed and provided that
> > such format is supported by FontForge.
> >
> > To be honest, I am not sure about two things:
> > - Is the existing TTF export OK for web usage?  Have been exploring
> >   this field shortly, but cannot defuse my confusion (TTF/OTF,
> >   ...).
> 
> Yes. It should work fine.
> I have not explored Web fonts yet much, this is learning experience
> for me as well.
> 
> > - Is hardcoded "fmflags" parameter in scripts/fontexport.pe
> >   OK also for formats other than TTF?
> 
> Will be good if you can test it and update the thread, so before
> final commit i will be in better position.

I've put together a simple test page [1] so anyone can test the result
in the browser of choice.  I've only tested Firefox (i.e., TTF and WOFF
only) and works as expected.  All the formats used are generated using
"make 4web", employing the proposed patchset.

(Continue reading)

Picon

Re: [PATCH 6/6] Makefile: now support other common export formats



On 22 February 2012 02:49, Jan Pokorny <jpokorny <at> redhat.com> wrote:
On February 21, 2012 7:20:27 AM, Pravin Satpute wrote:
>
> On 02/20/2012 09:49 PM, Jan Pokorny wrote:
> > Based on the previous patch, we create a generalization of how was
> > "ttf" target handled to support exporting also to other common
> > formats.  We add "4web" target covering common formats used on
> > the web (HTML/CSS:font-face): TTF, WOFF, SVG, EOT.
> > It is easy to add other formats if needed and provided that
> > such format is supported by FontForge.
> >
> > To be honest, I am not sure about two things:
> > - Is the existing TTF export OK for web usage?  Have been exploring
> >   this field shortly, but cannot defuse my confusion (TTF/OTF,
> >   ...).
>
> Yes. It should work fine.
> I have not explored Web fonts yet much, this is learning experience
> for me as well.
>
> > - Is hardcoded "fmflags" parameter in scripts/fontexport.pe
> >   OK also for formats other than TTF?
>
> Will be good if you can test it and update the thread, so before
> final commit i will be in better position.

I've put together a simple test page [1] so anyone can test the result
in the browser of choice.  I've only tested Firefox (i.e., TTF and WOFF
only) and works as expected.  All the formats used are generated using
"make 4web", employing the proposed patchset. 

Pravin, we can somehow get such or similar test HTML to the upstream
repo if preferred (can be viewed offline as well, indeed).

Yes, having test page in upstream repo is good idea.
I will check and commit in upstream repo, soon.

Thanks,
Pravin Satpute
 

[1] http://fedorapeople.org/~jpokorny/font-test/liberation-sans-italic.html

-- Jan

_______________________________________________
fonts mailing list
fonts <at> lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/fonts
http://fonts.fedoraproject.org/
Jan Pokorny | 22 Feb 2012 17:30
Picon
Favicon

[PATCH 6v2/6] Makefile: now support other common export formats (v2)

Based on the previous patch, we create a generalization of how was
"ttf" target handled to support exporting also to other common
formats.  We add "4web" target covering common formats used on
the web (HTML/CSS:font-face): TTF, WOFF, SVG, EOT.
It is easy to add other formats if needed and provided that
such format is supported by FontForge.

Update v2
---------

EOT is not supported natively by FontForge, so in fact, another tool
is needed, either will serve the purpose:
    1. mkeot from eot-utils (http://www.w3.org/Tools/eot-utils/)
    2. ttf2eot (http://code.google.com/p/ttf2eot/)

Unfortunately, these are not commonly packaged so they have to be
compiled from source.  This is quite straightforward, only in case 2.,
extra header file has to be imported, see [1].

The Makefile supports both these convertors.  I made some comparison
of the two and the output is similar, although 2. seems to be doing font
subsetting and supports setting the URL prefixes where the font is
intended to be used -- this can be explictly requested using:

    make eot MKEOT_URLS="URL1 URL2 ..."

Because 1. is also under the wings of authoritative organization (W3C),
I arranged it as prioritized choice with the fallback to 2. if mkeot
is not found on the PATH (if even this is missing, the eot target fails).

If official distribution of web fonts incl. EOT is ever to be made,
I think it is important to mark (in the form of a comment in Makefile)
the "canonical" converter.  I anticipated it is 1. as well, but it can be
changed anytime (preferrably also fallback order is changed then).

In scripts/fontexport.pe, printing newline is removed.

[1] http://code.google.com/p/ttf2eot/issues/attachmentText?id=22&aid=220001000&name=cstddef.patch

Signed-off-by: Jan Pokorný <jpokorny <at> redhat.com>
---
 source/Makefile              |   59 ++++++++++++++++++++++++++++++++++++-----
 source/scripts/fontexport.pe |    1 -
 2 files changed, 51 insertions(+), 9 deletions(-)

diff --git a/source/Makefile b/source/Makefile
index 995443b..32b2e17 100644
--- a/source/Makefile
+++ b/source/Makefile
 <at>  <at>  -1,7 +1,30  <at>  <at> 
+# common targets:
+# <no target>, build, ttf-dir: create dedicated dir with TTF files
+# ttf:                         create export dir with TTF files, track changes
+# 4web:                        dtto for TTF, WOFF, SVG, and EOT
+
 FONTFORGE    = fontforge
 FONTLINT     = fontlint

-SCRIPTS      = scripts/sfd2ttf.pe scripts/ttf2sfd.pe scripts/fontexport.pe
+# TTF->EOT converters in fallback order
+# the first one is canonical choice used in the release process
+MKEOT        = mkeot
+# URLs to be used for root string within EOT file;
+# expected to be provided via command-line arguments when needed
+MKEOT_URLS   =
+TTF2EOT      = ttf2eot
+ifneq ($(strip $(shell which $(MKEOT) 2>/dev/null)),)
+    make_eot = $(MKEOT) $(1) $(MKEOT_URLS) > $(2)
+else
+    ifneq ($(strip $(shell which $(TTF2EOT) 2>/dev/null)),)
+        make_eot = $(TTF2EOT) $(1) > $(2)
+    else
+        make_eot = $(error No tool for TTF->EOT conversion: $(MKEOT), $(TTF2EOT))
+    endif
+endif
+
+EXPORTSCRIPT = scripts/fontexport.pe
+SCRIPTS      = $(EXPORTSCRIPT) scripts/sfd2ttf.pe scripts/ttf2sfd.pe
 MISCFILES    = AUTHORS ChangeLog COPYING License.txt README TODO
 SRCDIR       = src
 EXPORTDIR    = export
 <at>  <at>  -30,16 +53,36  <at>  <at>  $(EXPORTDIR):
 # TrueType/OpenType Font, general usage
 # - ttf cares about source file changes, using shared EXPORTDIR
 # - ttf-dir should be a bit more efficient, creating dedicated dir for TTF
-ttf: $(EXPORTDIR) $(TTFFILES)
+FORMATS = ttf
 ttf-dir:: $(SFDFILES)
-	$(FONTFORGE) -script ./scripts/fontexport.pe -ttf $^
+	$(FONTFORGE) -script $(EXPORTSCRIPT) -ttf $^
 	mkdir -p $(DISTPREFIX_TTF)
 	mv $(addsuffix .ttf,$(basename $^)) $(DISTPREFIX_TTF)

-# single file export (primarily used by other targets)
-$(EXPORTDIR)/%.ttf:: $(SRCDIR)/%.sfd
-	$(FONTFORGE) -script ./scripts/fontexport.pe -$(lastword $(subst ., ,$ <at> )) $<
-	mv $(SRCDIR)/$(notdir $ <at> ) $(EXPORTDIR)
+# web sites usage
+# Web Open Font Format (WOFF); for all modern browsers (W3C recommendation)
+FORMATS += woff
+# SVG Font; only for WebKit and Presto based browsers (Firefox "avoids" it)
+FORMATS += svg
+# Embedded OpenType (EOT); only for MSIE
+FORMATS += eot
+eot:: $(EXPORTDIR) $(addprefix $(EXPORTDIR)/$(NAME), $(VARIANTS:=.eot))
+	 <at> echo
+$(EXPORTDIR)/%.eot: $(EXPORTDIR)/%.ttf
+	$(call make_eot,$<,$ <at> )
+4web: ttf woff svg eot
+
+# XXX: declare other formats here if needed (TeX, etc.)
+
+# summary per-format target + single file export for these declared formats
+define FORMAT_template =
+$(1):: $$(EXPORTDIR) $$(addprefix $$(EXPORTDIR)/$$(NAME), $$(VARIANTS:=.$(1)))
+	 <at> echo
+$$(EXPORTDIR)/%.$(1):: $$(SRCDIR)/%.sfd
+	$$(FONTFORGE) -script $$(EXPORTSCRIPT) -$$(lastword $$(subst ., ,$$ <at> )) $$< 2>/dev/null
+	mv $$(SRCDIR)/$$(notdir $$ <at> ) $$(EXPORTDIR)
+endef
+$(foreach format,$(FORMATS),$(eval $(call FORMAT_template,$(format))))

 dist: clean-dist dist-sfd dist-ttf
 dist-src: dist-sfd
 <at>  <at>  -74,4 +117,4  <at>  <at>  clean: clean-dist
 clean-dist:
 	rm -f -- *.tar.gz *.zip

-.PHONY: all build ttf-dir ttf dist dist-src dist-sfd dist-ttf check clean clean-dist
+.PHONY: all build ttf-dir ttf dist dist-src dist-sfd dist-ttf 4web $(FORMATS) check clean clean-dist
diff --git a/source/scripts/fontexport.pe b/source/scripts/fontexport.pe
index 031cf08..343f808 100644
--- a/source/scripts/fontexport.pe
+++ b/source/scripts/fontexport.pe
 <at>  <at>  -17,6 +17,5  <at>  <at>  while ($argc > 1)
     Open($1)
     Generate($1:r + "." + format, "", 0x800)
     Close()
-    Print("")
     shift
 endloop
--

-- 

_______________________________________________
fonts mailing list
fonts <at> lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/fonts
http://fonts.fedoraproject.org/
Jan Pokorny | 22 Feb 2012 17:38
Picon
Favicon

Re: [PATCH 6v2/6] Makefile: now support other common export formats (v2)

Oops,

- although 2. seems to be doing font subsetting
+ although 1. seems not to be doing font subsetting

(1. supports setting the URL prefixes)

-- Jan
_______________________________________________
fonts mailing list
fonts <at> lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/fonts
http://fonts.fedoraproject.org/
Jan Pokorný | 5 Mar 2012 18:59
Picon
Favicon

Re: [PATCH 6/6v3] Makefile: now support other common export formats (v3)

Based on the previous patch, we create a generalization of how was
"ttf" target handled to support exporting also to other common
formats.  We add "4web" target covering common formats used on
the web (HTML/CSS:font-face): TTF, WOFF, SVG, EOT.
It is easy to add other formats if needed and provided that
such format is supported by FontForge.

Update v2
---------

EOT is not supported natively by FontForge, so in fact, another tool
is needed, either will serve the purpose:
     1. mkeot from eot-utils (http://www.w3.org/Tools/eot-utils/)
     2. ttf2eot (http://code.google.com/p/ttf2eot/)

Unfortunately, these are not commonly packaged so they have to be
compiled from source.  This is quite straightforward, only in case 2.,
extra header file has to be imported, see [1].

The Makefile supports both these convertors.  I made some comparison
of the two and the output is similar, although 2. seems to be doing font
subsetting and supports setting the URL prefixes where the font is
intended to be used -- this can be explictly requested using:

     make eot MKEOT_URLS="URL1 URL2 ..."

Because 1. is also under the wings of authoritative organization (W3C),
I arranged it as prioritized choice with the fallback to 2. if mkeot
is not found on the PATH (if even this is missing, the eot target fails).

If official distribution of web fonts incl. EOT is ever to be made,
I think it is important to mark (in the form of a comment in Makefile)
the "canonical" converter.  I anticipated it is 1. as well, but it can be
changed anytime (preferrably also fallback order is changed then).

In scripts/fontexport.pe, printing newline is removed.

Update v3
---------

Use "libre roots" by default for EOT as it seems that 1+ root is needed
for MSIE 8+ and these are as neutral as possible (see also test page
[2]).

Also, make should be more parallel-run-friendly now regarding creation
of export dir.

[1] http://code.google.com/p/ttf2eot/issues/attachmentText?id=22&aid=220001000&name=cstddef.patch
[2] http://jpokorny.fedorapeople.org/font-test/liberation-sans-italic.html

Signed-off-by: Jan Pokorný <jpokorny <at> redhat.com>
---
  source/Makefile              |   60 ++++++++++++++++++++++++++++++++++++-----
  source/scripts/fontexport.pe |    1 -
  2 files changed, 52 insertions(+), 9 deletions(-)

diff --git a/source/Makefile b/source/Makefile
index 995443b..520d892 100644
--- a/source/Makefile
+++ b/source/Makefile
 <at>  <at>  -1,7 +1,30  <at>  <at> 
+# common targets:
+# <no target>, build, ttf-dir: create dedicated dir with TTF files
+# ttf:                         create export dir with TTF files, track changes
+# 4web:                        dtto for TTF, WOFF, SVG, and EOT
+
  FONTFORGE    = fontforge
  FONTLINT     = fontlint

-SCRIPTS      = scripts/sfd2ttf.pe scripts/ttf2sfd.pe scripts/fontexport.pe
+# TTF->EOT converters in fallback order
+# the first one is canonical choice used in the release process
+MKEOT        = mkeot
+# URLs to be used for root string within EOT file;
+# defaults to "libre roots" that allow usage on any common web page
+MKEOT_URLS   = http:// https:// file://
+TTF2EOT      = ttf2eot
+ifneq ($(strip $(shell which $(MKEOT) 2>/dev/null)),)
+    make_eot = $(MKEOT) $(1) $(MKEOT_URLS) > $(2)
+else
+    ifneq ($(strip $(shell which $(TTF2EOT) 2>/dev/null)),)
+        make_eot = $(TTF2EOT) $(1) > $(2)
+    else
+        make_eot = $(error No tool for TTF->EOT conversion: $(MKEOT), $(TTF2EOT))
+    endif
+endif
+
+EXPORTSCRIPT = scripts/fontexport.pe
+SCRIPTS      = $(EXPORTSCRIPT) scripts/sfd2ttf.pe scripts/ttf2sfd.pe
  MISCFILES    = AUTHORS ChangeLog COPYING License.txt README TODO
  SRCDIR       = src
  EXPORTDIR    = export
 <at>  <at>  -30,16 +53,37  <at>  <at>  $(EXPORTDIR):
  # TrueType/OpenType Font, general usage
  # - ttf cares about source file changes, using shared EXPORTDIR
  # - ttf-dir should be a bit more efficient, creating dedicated dir for TTF
-ttf: $(EXPORTDIR) $(TTFFILES)
+FORMATS = ttf
  ttf-dir:: $(SFDFILES)
-	$(FONTFORGE) -script ./scripts/fontexport.pe -ttf $^
+	$(FONTFORGE) -script $(EXPORTSCRIPT) -ttf $^
  	mkdir -p $(DISTPREFIX_TTF)
  	mv $(addsuffix .ttf,$(basename $^)) $(DISTPREFIX_TTF)

-# single file export (primarily used by other targets)
-$(EXPORTDIR)/%.ttf:: $(SRCDIR)/%.sfd
-	$(FONTFORGE) -script ./scripts/fontexport.pe -$(lastword $(subst ., ,$ <at> )) $<
-	mv $(SRCDIR)/$(notdir $ <at> ) $(EXPORTDIR)
+# web sites usage
+# Web Open Font Format (WOFF); for all modern browsers (W3C recommendation)
+FORMATS += woff
+# SVG Font; only for WebKit and Presto based browsers (Firefox "avoids" it)
+FORMATS += svg
+# Embedded OpenType (EOT); MSIE only [extra recipe, FontForge can't create EOT]
+FORMATS += eot
+eot:: $(addprefix $(EXPORTDIR)/$(NAME), $(VARIANTS:=.eot))
+	 <at> echo
+$(EXPORTDIR)/%.eot: $(EXPORTDIR)/%.ttf | $(EXPORTDIR)
+	$(call make_eot,$<,$ <at> )
+4web: ttf woff svg eot
+
+# XXX: declare other formats here if needed (TeX, etc.)
+
+# default for formats without extra recipes defined above (e.g., not "eot"):
+# summary per-format target + single file export for these declared formats
+define FORMAT_template =
+$(1):: $$(addprefix $$(EXPORTDIR)/$$(NAME), $$(VARIANTS:=.$(1)))
+	 <at> echo
+$$(EXPORTDIR)/%.$(1):: $$(SRCDIR)/%.sfd | $$(EXPORTDIR)
+	$$(FONTFORGE) -script $$(EXPORTSCRIPT) -$$(lastword $$(subst ., ,$$ <at> )) $$< 2>/dev/null
+	mv $$(SRCDIR)/$$(notdir $$ <at> ) $$(EXPORTDIR)
+endef
+$(foreach format,$(FORMATS),$(eval $(call FORMAT_template,$(format))))

  dist: clean-dist dist-sfd dist-ttf
  dist-src: dist-sfd
 <at>  <at>  -74,4 +118,4  <at>  <at>  clean: clean-dist
  clean-dist:
  	rm -f -- *.tar.gz *.zip

-.PHONY: all build ttf-dir ttf dist dist-src dist-sfd dist-ttf check clean clean-dist
+.PHONY: all build ttf-dir ttf dist dist-src dist-sfd dist-ttf 4web $(FORMATS) check clean clean-dist
diff --git a/source/scripts/fontexport.pe b/source/scripts/fontexport.pe
index 031cf08..343f808 100644
--- a/source/scripts/fontexport.pe
+++ b/source/scripts/fontexport.pe
 <at>  <at>  -17,6 +17,5  <at>  <at>  while ($argc > 1)
      Open($1)
      Generate($1:r + "." + format, "", 0x800)
      Close()
-    Print("")
      shift
  endloop
--

-- 
1.7.3.4
_______________________________________________
fonts mailing list
fonts <at> lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/fonts
http://fonts.fedoraproject.org/

Gmane