sync code with last improvements from OpenBSD

This commit is contained in:
purplerain 2023-08-28 05:57:34 +00:00
commit 88965415ff
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
26235 changed files with 29195616 additions and 0 deletions

19
app/fonttosfnt/COPYING Normal file
View file

@ -0,0 +1,19 @@
Copyright (c) 2002-2008 by Juliusz Chroboczek
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

949
app/fonttosfnt/ChangeLog Normal file
View file

@ -0,0 +1,949 @@
commit 2726947ea34653a90f89163849887c11179b2d6d
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Jun 15 10:33:54 2021 +1000
Bump to 1.2.2
commit 9ea3677ba344c7ebd47f8078d11f69d117b9541e
Author: Christopher Zimmermann <madroach@gmerlin.de>
Date: Mon Oct 26 12:17:45 2020 +0100
1em is font size, not height
commit 49524b5db4867b5e896ed299fd66b390e68f1ffc
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue May 25 09:50:45 2021 +1000
Fail if ftell fails
Fixes a coverity warning: ftell may return -1 on error which we then pass into
fseek later. We properly fail there anyway, so this change is unlikely to have
any real effect.
commit 33f944705c6c42e1b52f6ec62131d31f737c638f
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Wed Dec 16 15:14:11 2020 +1000
Bump to 1.2.1
commit 2d30328f9c5390eb38d4052028cd00bafaa151d4
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Oct 31 21:01:02 2020 -0700
writeFile: avoid file leak on errors
Resolves issues found by Oracle Parfait 4.0 static analyser:
File Leak [file-ptr-leak]:
Leaked File out
at line 337 of app/fonttosfnt/write.c in function 'writeFile'.
out initialized at line 330 with fopen
File Leak [file-ptr-leak]:
Leaked File out
at line 366 of app/fonttosfnt/write.c in function 'writeFile'.
out initialized at line 330 with fopen
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 899eadee6750ea39ddb6b874529c29c011599bb2
Author: Christopher Zimmermann <madroach@gmerlin.de>
Date: Sat Oct 24 11:41:32 2020 +0200
Fall back to using FONT property as family name
commit 5f2307d883de6ddf55f499f1690840747b1a3ad9
Author: Christopher Zimmermann <madroach@gmerlin.de>
Date: Sat Oct 24 09:53:32 2020 +0200
fix sign of calculated descent
I discovered this bug when converting the Tamsyn font from pcf to otb.
commit 4d418c1602c8b939d3e5e479c44985a505ecad83
Author: Christopher Zimmermann <madroach@gmerlin.de>
Date: Fri Oct 23 21:35:24 2020 +0200
handle empty foundry encoded as NULL
to fix a segfault
commit 5727003b1df9071a2bc9a42bc0b25d7c03c8de09
Author: Christopher Zimmermann <madroach@gmerlin.de>
Date: Fri Oct 23 21:00:06 2020 +0200
remove leftover debug printf
commit 91af80a0aa18c969cd90668eed80bcbfc1e40661
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Wed Oct 21 16:36:30 2020 +1000
Bump to 1.2.0
commit ca9ad454496bebbc37125959d049cf2173c07c2a
Author: Christopher Zimmermann <madroach@gmerlin.de>
Date: Sun Aug 16 21:56:15 2020 +0200
use PIXEL_SIZE to calculate lineGap
commit 0447b81053d4ccaa1e1b0087bf6076abae431cae
Author: Christopher Zimmermann <madroach@gmerlin.de>
Date: Fri Jul 31 00:07:26 2020 +0200
fix sign of sTypoDescender
commit 747c58aa17b9adc016aed0caab049417a20f0b22
Author: Christopher Zimmermann <madroach@gmerlin.de>
Date: Thu Jul 30 22:46:50 2020 +0200
calculate capHeight and xHeight as recommended
commit 64e7f386baf69fa6857047fc8ad9b4cd9a8185f1
Author: Christopher Zimmermann <madroach@gmerlin.de>
Date: Thu Jul 30 21:34:59 2020 +0200
move metrics calculation to write.c
commit 19412d9ac3fb7f00346273cfe914601c844f5872
Author: Christopher Zimmermann <madroach@gmerlin.de>
Date: Sat Jul 18 08:39:01 2020 +0200
Add warnings when wrapping multiple fonts and on PCF fonts
commit 1fa97fdc6dc900728be8523be89096b4cb117d4d
Author: Christopher Zimmermann <madroach@gmerlin.de>
Date: Sun Jul 12 15:36:18 2020 +0200
provide version 5 OS/2 table
this was an attempt to fix linespacing, which did not help, but
would still keep it around to avoid double efforts.
commit facf71184163d50adf0b8fccffcaffa18b7bd277
Author: Christopher Zimmermann <madroach@gmerlin.de>
Date: Sun Jul 12 15:12:59 2020 +0200
use design metrics in eblc instead of calculated metrics
This will probably not work for a font providing multiple strikes.
But .bdf fonts don't provide multiple strikes (or do they?!?)
I don't know about .pcf fonts, but I would recommend against running fonttosfnt
on .pcf fonts because bdf2pcf seems to loose some attributes during conversion.
commit 9fb05de7d6c57d045b4a88516f3c28cf3cf98722
Author: Christopher Zimmermann <madroach@gmerlin.de>
Date: Tue Jul 7 21:02:56 2020 +0200
use more properties according to XLFD
commit 58cbf737557f34744b950668e3354ec2f2dae766
Author: Christopher Zimmermann <madroach@gmerlin.de>
Date: Mon Jul 6 22:50:23 2020 +0200
use standard C rounding functions
commit f8fa7919397659fb0ac5dade75152343d57f20ce
Author: Christopher Zimmermann <madroach@gmerlin.de>
Date: Tue Jun 16 18:43:12 2020 +0200
correctly set OS2 fsSelection for italic and bold fonts
commit 1df352c9e862686692ac053b838d76a36d721805
Author: Christopher Zimmermann <madroach@gmerlin.de>
Date: Mon Jun 15 14:08:49 2020 +0200
truncate foundry if there is no known abbreviation.
Honestly I have no idea why the foundry needs to fit in four bytes.
But anyway truncation might indeed be better then "UNKN" ?
Anyone more knowledgeable than me out there?
commit 8532812f1eddfadc0bcfad220b283bf5990bba10
Author: Christopher Zimmermann <madroach@gmerlin.de>
Date: Sun May 31 08:02:24 2020 +0200
use zero lineGap, sTypoDescender should be negative
According to
https://simoncozens.github.io/fonts-and-layout/opentype.html#vertical-metrics-hhea-and-os2
sTypoDescender should be negative and lineGap should be zero.
commit de8068f9c4251fb6cb9407c07bf245e1937270bc
Author: Christopher Zimmermann <madroach@gmerlin.de>
Date: Sun May 31 07:58:10 2020 +0200
don't add arbitrary number to the glypth metrics
This caused pango to calculate wrong, too large font extents and in
consequence gvim used too large character cells.
commit 7096c58f3fe3b6c79508cb16daac5c5bb2f042e7
Author: Peng Wu <pwu@redhat.com>
Date: Thu Jun 11 14:09:35 2020 +0800
Guess Regular style for Medium Weight
X Logical Font Description recognize "Medium" as "Regular".
Update the faceWeight function to change style from "Medium" to "Regular".
commit 81a61c049e6de80120531f0770b22e7637c9acb9
Author: rnhmjoj <rnhmjoj@inventati.org>
Date: Fri Feb 7 17:47:52 2020 +0100
Fix uninitialised memory write
If macTime() fails write zeros instead of unitialized memory to
the date fields.
commit 51e8117654fb092ae5412d7aa184bfc6b498c954
Author: rnhmjoj <rnhmjoj@inventati.org>
Date: Fri Feb 7 17:46:54 2020 +0100
Fix incorrect error handling in macTime()
mktime() and time() return (time_t -1) to signal an error.
Checking for negative values will incorrectly assume an error
happened for any calendar date before the unix epoch.
commit 1d757ff6fa30079790fc44b141f6d0e4d5411f13
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Mon Jan 6 12:55:31 2020 +1000
Bump to 1.1.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
commit bdcb892975de167b3d4258859234f0abe375f236
Author: Jouke Witteveen <j.witteveen@gmail.com>
Date: Fri Aug 2 14:03:15 2019 +0200
Accept a BDF font on stdin
This makes it easier to transition from bdftopcf.
Although an OTB file could include fonts from multiple BDF sources, that
functionality is not currently implemented for fonts read from stdin.
Signed-off-by: Jouke Witteveen <j.witteveen@gmail.com>
commit 0006f577898129c0c5d5e0996026641605705e08
Author: Jouke Witteveen <j.witteveen@gmail.com>
Date: Fri Aug 2 11:43:56 2019 +0200
Mention .otb as an extension
The OTB (OpenType Bitmap) extension has found some traction, so suggest
that.
Signed-off-by: Jouke Witteveen <j.witteveen@gmail.com>
commit cb4b8760f829040eb4b2fb314df5b6194230a237
Author: Jouke Witteveen <j.witteveen@gmail.com>
Date: Fri Aug 2 11:41:59 2019 +0200
Correct a string literal
Signed-off-by: Jouke Witteveen <j.witteveen@gmail.com>
commit d06059ef2a85df3c70f3c0b77364b4c49837f331
Author: Peng Wu <alexepico@gmail.com>
Date: Wed Oct 9 14:20:22 2019 +0800
Round font size to integer value when reading bitmap font
Some fonts have a ppem value like 11.9, this patch adds integer rounding to
convert those ppem value to 12 instead of 11.
commit cfb4d64e1b90a28693fd700f4abf0f55d969f4f6
Author: Ryan Farley <ryan.farley@gmx.com>
Date: Sat Aug 31 06:42:24 2019 -0500
allow ISO-646.1991-IRV as well, adobe standard for bdf
Allow for BDF file with no specified encoding to be read as Adobe
Standard (per freetype's BDF driver), and handle any Unicode-equivalent
encoding without changing the encoding name.
commit 5d446a02a7422d3a61f74b8d1c28b7b551ea06fd
Author: Ryan Farley <ryan.farley@gmx.com>
Date: Tue Aug 20 03:16:22 2019 -0500
let freetype handle ISO-8859-1 mapping
https://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#ft_encoding
indicates that ISO-8859-1 is automatically mapped to Unicode for BDF and
PCF fonts -- trying to use FT_Select_Charmap() with FT_ENCODING_NONE
leads to an error for such fonts.
commit 6fc84fb2c0d4ac0b3b66330057bb90418cc1eb28
Author: Ryan Farley <ryan.farley@gmx.com>
Date: Fri Aug 30 09:43:50 2019 -0500
check for freetype NULL atoms
Freetype uses NULL to represent an empty string when retrieving a BDF
property -- check for this in addition to an actual error
commit c214ab0d7deae30acdf90933ed14b223118dcf67
Author: Maya Rashish <maya@NetBSD.org>
Date: Thu Jan 10 20:49:28 2019 +0200
Avoid undefined behaviour
Left shifting a negative is undefined.
For consistency, use the equivalent form of multiplication for the
positive numbers as well.
commit 8e34a2aa7c4dea5aa07dc08a40dacd90e2148a89
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Wed Nov 21 16:46:19 2018 -0800
Update configure.ac bug URL for gitlab migration
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 46d4900c2dbed1c7a632dc34a4ef952a9cdda8eb
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Fri Nov 16 19:53:06 2018 -0800
Update README for gitlab migration
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit ec6f334152badff475d2a8c465dfdbf740f148d0
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Wed Oct 31 14:37:24 2018 +1000
Mark vsprintf_alloc as printf-like function
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
commit 7f8d7ecf0379ebc5386ee27f385a2ca564d6decb
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Jul 31 11:36:54 2018 +1000
Bump to 1.0.5
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 9d92e49a4b69edc6e05f44e00aef8b81bb00f067
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Jul 31 11:49:07 2018 +1000
Replace _BSD_SOURCE with _DEFAULT_SOURCE
/usr/include/features.h:184:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
# warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 0c993094a8899b488ba4acbb888c176f99da0849
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Jul 31 11:45:51 2018 +1000
Fix shadowing i variable complaint
C99 is a magical thing!
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 6c37ebcfd8992fdf88da225bd1de7ca40dd69240
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Jul 31 11:43:01 2018 +1000
Remove shadowing rc variable
All code paths assign rc and heck it immedately after. We can re-use the one
from the outer loop.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 65d2d8f9cbe744b4c6c64d377f7ffd5d88ee0b1d
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Jul 31 11:40:55 2018 +1000
README: update repository URL to gitlab
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
commit 9d776b6a0f770cbe045a56141844d0ba393da611
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Jul 31 11:38:41 2018 +1000
Constify a few string arguments
Cuts down on compiler warning by at least 64%, what a bargain!
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit aead36f0be638a572ec97eb5313e45086874a5e6
Author: Mihail Konev <k.mvc@ya.ru>
Date: Thu Jan 26 14:00:20 2017 +1000
autogen: add default patch prefix
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
commit 6dba18bf130e39718cc05cb8eb7d34a06b4a03a7
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date: Mon Mar 9 12:00:52 2015 +0000
autogen.sh: use quoted string variables
Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
fall-outs, when they contain space.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
commit 1111127df3838bf701eb70a4e1ef053f71321fd1
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Jan 24 10:32:07 2017 +1000
autogen.sh: use exec instead of waiting for configure to finish
Syncs the invocation of configure with the one from the server.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
commit 168cb69c5264f9b7ffd019c9c9867b23308832df
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Jun 1 21:08:25 2014 -0700
autogen.sh: Honor NOCONFIGURE=1
See http://people.gnome.org/~walters/docs/build-api.txt
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 9c630e1607a29ee63f546a6a2294ba84f3493a77
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Jun 1 21:08:25 2014 -0700
configure: Drop AM_MAINTAINER_MODE
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 4db4880098627e9136c3cb9f6dc0a9f9914ce618
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Jun 1 21:08:17 2014 -0700
config: Add missing AC_CONFIG_SRCDIR
Regroup AC statements under the Autoconf initialization section.
Regroup AM statements under the Automake initialization section.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 5b55964119d97ed763efa76bcc09dc918b6ab8be
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Wed Jan 19 10:06:55 2011 -0500
config: move man pages into their own directory
Use services provided by XORG_MANPAGE_SECTIONS.
Use standard Makefile for man pages.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit 98469be392fcb4bc45e14b449e3576248e5bc558
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Thu Jan 13 17:15:36 2011 -0500
man: replace hard coded man page section with substitution strings
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit a88c4ce51e28968ea6ff09f0ae12d9e1d52fb349
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Thu Jan 13 11:15:00 2011 -0500
man: remove trailing spaces and tabs
Using s/[ \t]*$//
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit 6146625ddfceaf32d632b72451b257325d212dc7
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Wed Jan 12 16:28:01 2011 -0500
config: replace deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADERS
This silences an Autoconf warning
commit 218f4cbdcdc9e8035208970c699fd80e217a575d
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Wed Jan 12 15:12:08 2011 -0500
config: remove unrequired AC_SUBST([*_LIBS])
This macro is called by PKG_CHECK_MODULES
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit a132b22ae57b1e7bf03167de2f1bdb17082fba3b
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Wed Jan 12 13:33:47 2011 -0500
config: remove unrequired AC_SUBST([*_CFLAGS])
This macro is called by PKG_CHECK_MODULES
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit 831d716c28934d26580391b092619e2524fb71c0
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Wed Jan 12 13:10:21 2011 -0500
config: remove AC_PROG_CC as it overrides AC_PROG_C_C99
XORG_STRICT_OPTION from XORG_DEFAULT_OPTIONS calls
AC_PROG_C_C99. This sets gcc with -std=gnu99.
If AC_PROG_CC macro is called afterwards, it resets CC to gcc.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit 1c1e0d9c19b791fa1242f070334cf191bff97019
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Wed Jan 12 11:54:40 2011 -0500
config: use AC_PROG_INSTALL now supplied by XORG_DEFAULT_OPTIONS
It depends on util-macros 1.8 or later
The existing statement can now be removed from the configuration file.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit 6e2ab22c57a18a48ad9bdf0f8ff0819191d42b3e
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Wed Jan 12 11:23:52 2011 -0500
config: upgrade to util-macros 1.8 for additional man page support
Use MAN_SUBST now supplied in XORG_MANPAGE_SECTIONS
The value of MAN_SUBST is the same for all X.Org packages.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit f8366ba7d643c99e3bdb43df2cbb76c16cdd3443
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Wed Jan 12 10:21:24 2011 -0500
config: update AC_PREREQ statement to 2.60
Unrelated to the previous patches, the new value simply reflects
the reality that the minimum level for autoconf to configure
all x.org modules in one pass is 2.60 dated June 2006.
A version later than 2.60 can be used, but no new features from such
a later version can be used in configure.ac.
Although the code in this module can be configured with a version earlier
than 2.60, most of code is now contained in macros from util-macros
which use features of version 2.60, at the present or in the future.
ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit 787b998d2eebf7825cf8c03fe1864bf8d410ee18
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Thu Feb 11 10:08:06 2010 -0500
config: move CWARNFLAGS from configure.ac to Makefile.am
Compiler warning flags should be explicitly set in the makefile
rather than being merged with other packages compiler flags.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit 5686a8163364a7dac59454c5db93a1a746b67c42
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Thu Nov 26 09:19:52 2009 -0500
Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES
Now that the INSTALL file is generated.
Allows running make maintainer-clean.
commit 27b94dbde5c63da3153f179763cf4152a73b4f17
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Wed Oct 28 14:09:07 2009 -0400
INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206
Add missing INSTALL file. Use standard GNU file on building tarball
README may have been updated
Remove AUTHORS file as it is empty and no content available yet.
Remove NEWS file as it is empty and no content available yet.
commit 49dfdf15b4bbc7d16ad954672d10a1173be6886e
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Tue Oct 27 15:07:24 2009 -0400
Deploy the new XORG_DEFAULT_OPTIONS #24242
This macro aggregate a number of existing macros that sets commmon
X.Org components configuration options. It shields the configuration file from
future changes.
commit 97aa84419e2a51bb6b594ea9dfacaf7bb670b710
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Mon Oct 26 22:08:37 2009 -0400
Makefile.am: ChangeLog not required: EXTRA_DIST or *CLEANFILES #24432
ChangeLog filename is known to Automake and requires no further
coding in the makefile.
commit f5953aeb4be49ca2711013133f8cc289db3a879b
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Thu Oct 22 12:34:14 2009 -0400
.gitignore: use common defaults with custom section # 24239
Using common defaults will reduce errors and maintenance.
Only the very small or inexistent custom section need periodic maintenance
when the structure of the component changes. Do not edit defaults.
commit 5104e9f3611733c8c0e8584ff2221698bb76726b
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Thu Oct 1 14:54:16 2009 -0700
Add README with pointers to mailing lists, bugzilla, & git
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
commit 51a24f2177b09f8ef63ba1e5b09028f0582e1138
Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
Date: Mon Jan 12 17:48:28 2009 -0200
Ansification and compile warning fixes.
This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, corrects
make distcheck and all gcc 4.3 and sparse warnings.
commit a9a8778a984e69007d77227969b0103b2a81e4c8
Author: Julien Cristau <jcristau@debian.org>
Date: Sun May 11 00:50:20 2008 +0200
Bump to 1.0.4
commit b3046750c37837dfe6d2a488361a1c78abdce138
Author: Juliusz Chroboczek <jch@pps.jussieu.fr>
Date: Sun May 11 00:46:52 2008 +0200
Use va_copy in vsprintf_alloc.
This avoids a crash on arches with an interesting implementation of va_list
(such as AMD64) but no vasprintf in their libc.
commit a0d110f283e387e9c594d422c5c75cb593def91e
Author: Julien Cristau <jcristau@debian.org>
Date: Sun May 11 00:45:51 2008 +0200
Add autoconf test for va_copy.
commit e583311c8a73a675fc3396fe24cdafcad53e60e5
Author: Julien Cristau <jcristau@debian.org>
Date: Sun May 11 00:32:05 2008 +0200
Use autoconf test instead of #ifdef GLIBC for vasprintf.
commit 8e36cc8647b27a4d14cf3f63045410db79fb98a3
Author: Juliusz Chroboczek <jch@pps.jussieu.fr>
Date: Sun May 11 00:30:12 2008 +0200
Rename *_reliable to *_alloc.
commit 867c33d332abe479ab088f98e01c06800203a3e0
Author: Juliusz Chroboczek <jch@pps.jussieu.fr>
Date: Sun May 11 00:01:38 2008 +0200
Update copyright date.
commit 4ecd697abe1026eb27e1373bf357ebca2ade4138
Author: Juliusz Chroboczek <jch@pps.jussieu.fr>
Date: Fri May 2 19:24:21 2008 +0200
Use asprintf on GNU platforms.
This fixes fonttosfnt on AMD64 with glibc. It will still break on
non-GNU RISC platforms, because I'm incompetent and cannot use va_copy.
commit 5cb6dcac85b89deea8263e1b7bcb7714e07063ff
Author: George Williams <gww@silcom.com>
Date: Fri May 2 19:14:58 2008 +0200
Fix handling for non-square pixels.
commit 95a16fb0001abcea6a12b4eb2e1a1d24ab83d5fa
Author: George Williams <gww@silcom.com>
Date: Fri May 2 19:09:09 2008 +0200
Fix off-by-one entrySel field.
commit bbab34919743990bf87935480092f7644f8f02fc
Author: James Cloos <cloos@jhcloos.com>
Date: Thu Mar 13 13:19:11 2008 -0400
Im not sure the PCLT table is needed by the fonts generated here, but
use a fixed 16 char string as the initializer for the PCLT Fontname field
to silence the warning (or error for some compilers) as reported in bugzilla:
http://bugs.freedesktop.org/show_bug.cgi?id=3928
commit 5bf16aed7ba59559a636552811f7267d79a746bb
Author: James Cloos <cloos@jhcloos.com>
Date: Mon Sep 3 05:51:00 2007 -0400
Add *~ to .gitignore to skip patch/emacs droppings
commit 64474e003376039cf485fa6eb41d241170397ab4
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Fri Aug 10 16:21:44 2007 -0700
Change fonttosfnt_CFLAGS to AM_CFLAGS to make automake-1.10 happier
commit 0c316fb4aadf26bea5784974cd484483d6322b5c
Author: Daniel Stone <daniel@fooishbar.org>
Date: Sat Dec 16 01:37:31 2006 +0200
bump to 1.0.3
commit 0eba2afb80bf17c0a2d2753ff92c1986211d92be
Author: Daniel Stone <daniel@fooishbar.org>
Date: Wed Dec 6 19:01:27 2006 +0200
Makefile.am: make ChangeLog hook safer
Make ChangeLog hook as safe as possible.
commit 8c2de974ec3df06a547906474ced5ffb4a07a6b5
Author: Juliusz Chroboczek <jch@pps.jussieu.fr>
Date: Tue Oct 31 01:48:49 2006 +0100
Fix author address in manual page, update COPYING.
commit e734cef9baff470a5e913f2e9ac7e0ce649ea7dc
Author: Adam Jackson <ajax@benzedrine.nwnk.net>
Date: Fri Oct 13 17:30:24 2006 -0400
Bump to 1.0.2
commit 72caf26ad336b3de9af3e640f939ea2cd0caa42b
Author: Adam Jackson <ajax@benzedrine.nwnk.net>
Date: Thu Oct 12 20:56:01 2006 -0400
Fix the ChangeLog hook to distcheck.
commit b30bd59af161fc0907d497101f10705c7b575008
Author: Matthieu Herrb <matthieu@reactor.herrb.com>
Date: Sun Jul 16 10:43:55 2006 +0200
Replace ChangeLog with a auto-generated git-log
commit f5d7f68599f4d2ec86df0910f8c823b8feabc6db
Author: Matthieu Herrb <matthieu@reactor.herrb.com>
Date: Sun Jul 16 10:32:52 2006 +0200
.cvsignore -> .gitignore
commit b651f24b766c9e76dec8a14c68623f4b7fa68141
Author: Matthieu Herrb <matthieu@reactor.herrb.com>
Date: Sun Jul 16 10:31:26 2006 +0200
Don't include freetype internal headers.
commit d00a25b26be87fdc06e20b0616f2fa34fe34e0b0
Author: Kevin E Martin <kem@kem.org>
Date: Wed Dec 21 02:29:42 2005 +0000
Update package version for X11R7 release.
commit 697369878ec5ce26d0ab88efd2b58129c5a56881
Author: Adam Jackson <ajax@nwnk.net>
Date: Mon Dec 19 16:22:40 2005 +0000
Stub COPYING files
commit 7aa1cd75f6164d1bf33e11464e7c4edb32f29dd6
Author: Kevin E Martin <kem@kem.org>
Date: Thu Dec 15 00:24:02 2005 +0000
Update package version number for final X11R7 release candidate.
commit 465400df7122f178102fac935ca6138d8a6cfbeb
Author: Kevin E Martin <kem@kem.org>
Date: Tue Dec 6 22:48:16 2005 +0000
Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
commit d76c640e4172b32112e527e83458345da3fc715c
Author: Kevin E Martin <kem@kem.org>
Date: Sat Dec 3 05:49:15 2005 +0000
Update package version number for X11R7 RC3 release.
commit 0f9a04d1abab2760d3cb145b0e907c8509c8d3e7
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
Date: Mon Nov 28 22:01:36 2005 +0000
Change *mandir targets to use new *_MAN_DIR variables set by xorg-macros.m4
update to fix bug #5167 (Linux prefers *.1x man pages in man1 subdir)
commit 7225a9cdbd7b683d78bca2464d89bbe51fe185cd
Author: Eric Anholt <anholt@freebsd.org>
Date: Mon Nov 21 10:34:55 2005 +0000
Another pass at .cvsignores for apps.
commit bc943ad21ca3c46b48dcec0954ed80129ac3d4ac
Author: Eric Anholt <anholt@freebsd.org>
Date: Sun Nov 20 22:08:48 2005 +0000
Add/improve .cvsignore files for apps.
commit 270074ea7d3194b91cd14c17f750c4965f7ba9fb
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
Date: Sun Nov 20 18:14:10 2005 +0000
fonttosfnt only depends on xproto headers, not x11 library
commit 8221726955cf4be32d56b63d95c119d0f5ad3749
Author: Kevin E Martin <kem@kem.org>
Date: Wed Nov 9 21:09:19 2005 +0000
Update package version number for X11R7 RC2 release.
commit 26f1c8de351a6c56aafa337b6002a345e835e017
Author: Kean Johnson <kean@armory.com>
Date: Tue Nov 8 06:33:31 2005 +0000
See ChangeLog entry 2005-11-07 for details.
commit 7827761d51b92f82e457df0c132b52817a5c2783
Author: Kevin E Martin <kem@kem.org>
Date: Wed Oct 19 02:47:48 2005 +0000
Update package version number for RC1 release.
commit 9d4c03cd1be37e2c300b45b250ed52bcfdda65f2
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
Date: Mon Oct 17 23:56:19 2005 +0000
Use @APP_MAN_SUFFIX@ instead of $(APP_MAN_SUFFIX) in macro substitutions to
work better with BSD make
commit 0dfc246519b4e2d4e2dee91835c762b1263c5a90
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
Date: Fri Oct 14 00:25:41 2005 +0000
Use sed to fill in variables in man page
commit 21d2888221fbb156398cb69d12798d2c16f3c8a0
Author: Matthieu Herrb <matthieu.herrb@laas.fr>
Date: Sun Sep 11 12:43:13 2005 +0000
change the order of option to prevent automake from inserting a line break
that causes problems with BSD make later.
commit fcfbfe0f7ddb621b1b0e99fba6b386221fb56263
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
Date: Mon Aug 1 20:25:27 2005 +0000
Install man pages to section 1 instead of section m (Patch from Donnie
Berkholz)
commit 257b9388fc234b2f8d515124784ce9e42db6bb0d
Author: Alan Coopersmith <Alan.Coopersmith@sun.com>
Date: Sat Jul 30 19:32:32 2005 +0000
Add -D flags to clear more compiler warnings (Stefan Dirsch)
commit 31913e37864f621db1bd6c7e578cad1ade060f84
Author: Kevin E Martin <kem@kem.org>
Date: Fri Jul 29 21:22:28 2005 +0000
Various changes preparing packages for RC0:
- Verify and update package version numbers as needed
- Implement versioning scheme
- Change bug address to point to bugzilla bug entry form
- Disable loadable i18n in libX11 by default (use --enable-loadable-i18n to
reenable it)
- Fix makedepend to use pkgconfig and pass distcheck
- Update build script to build macros first
- Update modular Xorg version
commit ed904c57d881eb9bcd09aeb8722fbb55687f3600
Author: Adam Jackson <ajax@nwnk.net>
Date: Wed Jul 20 19:31:48 2005 +0000
Use a unique token for PKG_CHECK_MODULES. Otherwise, if you use a global
configure cache, you cache it, and the cached value is probably wrong.
commit b209b9a7f683c10a77ed2e03da79b7ac1abc4844
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Wed Jul 6 19:46:18 2005 +0000
Build system for fonttosfnt
commit e8571878caa5d35f712e158a45391584da3d5e47
Author: Egbert Eich <eich@suse.de>
Date: Mon May 24 19:06:59 2004 +0000
Fix build glitches when building modules independently using Imake.
commit 417d53e38e84d63dfa2705f41d46ec1df777a8ad
Author: Egbert Eich <eich@suse.de>
Date: Fri Apr 23 19:54:32 2004 +0000
Merging XORG-CURRENT into trunk
commit 3d00e4afa32385f6926fcd61dfa071f263a773a3
Author: Egbert Eich <eich@suse.de>
Date: Sun Mar 14 08:34:50 2004 +0000
Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004
commit 7e303eeeac4b6ffd8b04f8372a7466d59acadbca
Author: Egbert Eich <eich@suse.de>
Date: Wed Mar 3 12:12:50 2004 +0000
Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004
commit 8e100bba2b23ab7f91e7635de5e36f82ecbebbee
Author: Egbert Eich <eich@suse.de>
Date: Thu Feb 26 13:36:15 2004 +0000
readding XFree86's cvs IDs
commit be4a578da6742e6298edae3ec9ba56c331c89ba4
Author: Egbert Eich <eich@suse.de>
Date: Thu Feb 26 09:23:54 2004 +0000
Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004
commit 24fddb6f3214189dae072f375403462d5e9f6091
Author: Kaleb Keithley <kaleb@freedesktop.org>
Date: Fri Dec 19 20:55:44 2003 +0000
XFree86 4.3.99.902 (RC 2)
commit f570299bb0f2a55e3059d1f4b42cb3d40a92793a
Author: Kaleb Keithley <kaleb@freedesktop.org>
Date: Tue Nov 25 19:29:02 2003 +0000
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks
commit a46389d96c54351cd95614f1e5eae495f51957f0
Author: Kaleb Keithley <kaleb@freedesktop.org>
Date: Tue Nov 25 19:29:02 2003 +0000
Initial revision

370
app/fonttosfnt/INSTALL Normal file
View file

@ -0,0 +1,370 @@
Installation Instructions
*************************
Copyright (C) 1994-1996, 1999-2002, 2004-2012 Free Software Foundation,
Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without warranty of any kind.
Basic Installation
==================
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package. Some packages provide this
`INSTALL' file but do not implement all of the features documented
below. The lack of an optional feature in a given package is not
necessarily a bug. More recommendations for GNU packages can be found
in *note Makefile Conventions: (standards)Makefile Conventions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package, generally using the just-built uninstalled binaries.
4. Type `make install' to install the programs and any data files and
documentation. When installing into a prefix owned by root, it is
recommended that the package be configured and built as a regular
user, and only the `make install' phase executed with root
privileges.
5. Optionally, type `make installcheck' to repeat any self-tests, but
this time using the binaries in their final installed location.
This target does not install anything. Running this target as a
regular user, particularly if the prior `make install' required
root privileges, verifies that the installation completed
correctly.
6. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
7. Often, you can also type `make uninstall' to remove the installed
files again. In practice, not all packages have tested that
uninstallation works correctly, even though it is required by the
GNU Coding Standards.
8. Some packages, particularly those that use Automake, provide `make
distcheck', which can by used by developers to test that all other
targets like `make install' and `make uninstall' work correctly.
This target is generally not run by end users.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'. This
is known as a "VPATH" build.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple `-arch' options to the
compiler but only a single `-arch' option to the preprocessor. Like
this:
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CPP="gcc -E" CXXCPP="g++ -E"
This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results
using the `lipo' tool if you have problems.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX', where PREFIX must be an
absolute file name.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them. In general, the
default for these options is expressed in terms of `${prefix}', so that
specifying just `--prefix' will affect all of the other directory
specifications that were not explicitly provided.
The most portable way to affect installation locations is to pass the
correct locations to `configure'; however, many packages provide one or
both of the following shortcuts of passing variable assignments to the
`make install' command line to change installation locations without
having to reconfigure or recompile.
The first method involves providing an override variable for each
affected directory. For example, `make install
prefix=/alternate/directory' will choose an alternate location for all
directory configuration variables that were expressed in terms of
`${prefix}'. Any directories that were specified during `configure',
but not in terms of `${prefix}', must each be overridden at install
time for the entire installation to be relocated. The approach of
makefile variable overrides for each directory variable is required by
the GNU Coding Standards, and ideally causes no recompilation.
However, some platforms have known limitations with the semantics of
shared libraries that end up requiring recompilation when using this
method, particularly noticeable in packages that use GNU Libtool.
The second method involves providing the `DESTDIR' variable. For
example, `make install DESTDIR=/alternate/directory' will prepend
`/alternate/directory' before all installation names. The approach of
`DESTDIR' overrides is not required by the GNU Coding Standards, and
does not work on platforms that have drive letters. On the other hand,
it does better at avoiding recompilation issues, and works well even
when some directory options were not specified in terms of `${prefix}'
at `configure' time.
Optional Features
=================
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Some packages offer the ability to configure how verbose the
execution of `make' will be. For these packages, running `./configure
--enable-silent-rules' sets the default to minimal output, which can be
overridden with `make V=1'; while running `./configure
--disable-silent-rules' sets the default to verbose, which can be
overridden with `make V=0'.
Particular systems
==================
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
HP-UX `make' updates targets which have the same time stamps as
their prerequisites, which makes it generally unusable when shipped
generated files such as `configure' are involved. Use GNU `make'
instead.
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its `<wchar.h>' header file. The option `-nodtk' can be used as
a workaround. If GNU CC is not installed, it is therefore recommended
to try
./configure CC="cc"
and if that doesn't work, try
./configure CC="cc -nodtk"
On Solaris, don't put `/usr/ucb' early in your `PATH'. This
directory contains several dysfunctional programs; working variants of
these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
in your `PATH', put it _after_ `/usr/bin'.
On Haiku, software installed for all users goes in `/boot/common',
not `/usr/local'. It is recommended to use the following options:
./configure --prefix=/boot/common
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS
KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf limitation. Until the limitation is lifted, you can use
this workaround:
CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of all of the options to `configure', and exit.
`--help=short'
`--help=recursive'
Print a summary of the options unique to this package's
`configure', and exit. The `short' variant lists options used
only in the top level, while the `recursive' variant lists options
also present in any nested packages.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--prefix=DIR'
Use DIR as the installation prefix. *note Installation Names::
for more details, including other options available for fine-tuning
the installation locations.
`--no-create'
`-n'
Run the configure checks, but stop before creating any output
files.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

View file

@ -0,0 +1,53 @@
#
# Copyright 2005 Red Hat, Inc.
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of Red Hat not be used in
# advertising or publicity pertaining to distribution of the software without
# specific, written prior permission. Red Hat makes no
# representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty.
#
# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
SUBDIRS = man
bin_PROGRAMS = fonttosfnt
AM_CFLAGS = -DXVENDORNAME=\"X.Org\ Foundation\" $(FONTTOSFNT_CFLAGS) -DXVENDORNAMESHORT=\"X.Org\" -D_DEFAULT_SOURCE -D_GNU_SOURCE $(CWARNFLAGS)
fonttosfnt_LDADD = $(FONTTOSFNT_LIBS) -lm
fonttosfnt_SOURCES = \
fonttosfnt.c \
fonttosfnt.h \
read.c \
struct.c \
util.c \
write.c
if NEED_SETENV
fonttosfnt_SOURCES += env.c
AM_CFLAGS += -DNEED_SETENV
endif
MAINTAINERCLEANFILES = ChangeLog INSTALL
.PHONY: ChangeLog INSTALL
INSTALL:
$(INSTALL_CMD)
ChangeLog:
$(CHANGELOG_CMD)
dist-hook: ChangeLog INSTALL
EXTRA_DIST = README.md

View file

@ -0,0 +1,3 @@
# $OpenBSD: Makefile.bsd-wrapper,v 1.2 2006/11/27 19:27:26 matthieu Exp $
.include <bsd.xorg.mk>

917
app/fonttosfnt/Makefile.in Normal file
View file

@ -0,0 +1,917 @@
# Makefile.in generated by automake 1.12.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Copyright 2005 Red Hat, Inc.
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of Red Hat not be used in
# advertising or publicity pertaining to distribution of the software without
# specific, written prior permission. Red Hat makes no
# representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty.
#
# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = fonttosfnt$(EXEEXT)
@NEED_SETENV_TRUE@am__append_1 = env.c
@NEED_SETENV_TRUE@am__append_2 = -DNEED_SETENV
subdir = .
DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/configure COPYING ChangeLog INSTALL NEWS compile \
config.guess config.sub depcomp install-sh missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
am__fonttosfnt_SOURCES_DIST = fonttosfnt.c fonttosfnt.h read.c \
struct.c util.c write.c env.c
@NEED_SETENV_TRUE@am__objects_1 = env.$(OBJEXT)
am_fonttosfnt_OBJECTS = fonttosfnt.$(OBJEXT) read.$(OBJEXT) \
struct.$(OBJEXT) util.$(OBJEXT) write.$(OBJEXT) \
$(am__objects_1)
fonttosfnt_OBJECTS = $(am_fonttosfnt_OBJECTS)
am__DEPENDENCIES_1 =
fonttosfnt_DEPENDENCIES = $(am__DEPENDENCIES_1)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(fonttosfnt_SOURCES)
DIST_SOURCES = $(am__fonttosfnt_SOURCES_DIST)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
cscope distdir dist dist-all distcheck
ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__post_remove_distdir = $(am__remove_distdir)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
GZIP_ENV = --best
DIST_TARGETS = dist-bzip2 dist-gzip
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHANGELOG_CMD = @CHANGELOG_CMD@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWARNFLAGS = @CWARNFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
FONTTOSFNT_CFLAGS = @FONTTOSFNT_CFLAGS@
FONTTOSFNT_LIBS = @FONTTOSFNT_LIBS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MAN_SUBSTS = @MAN_SUBSTS@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRICT_CFLAGS = @STRICT_CFLAGS@
STRIP = @STRIP@
VERSION = @VERSION@
XORG_MAN_PAGE = @XORG_MAN_PAGE@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = man
AM_CFLAGS = -DXVENDORNAME=\"X.Org\ Foundation\" $(FONTTOSFNT_CFLAGS) \
-DXVENDORNAMESHORT=\"X.Org\" -D_DEFAULT_SOURCE -D_GNU_SOURCE \
$(CWARNFLAGS) $(am__append_2)
fonttosfnt_LDADD = $(FONTTOSFNT_LIBS) -lm
fonttosfnt_SOURCES = fonttosfnt.c fonttosfnt.h read.c struct.c util.c \
write.c $(am__append_1)
MAINTAINERCLEANFILES = ChangeLog INSTALL
EXTRA_DIST = README.md
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
.SUFFIXES: .c .o .obj
am--refresh: Makefile
@:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
config.h: stamp-h1
@if test ! -f $@; then rm -f stamp-h1; else :; fi
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p; \
then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' `; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
fonttosfnt$(EXEEXT): $(fonttosfnt_OBJECTS) $(fonttosfnt_DEPENDENCIES) $(EXTRA_fonttosfnt_DEPENDENCIES)
@rm -f fonttosfnt$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(fonttosfnt_OBJECTS) $(fonttosfnt_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/env.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fonttosfnt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/struct.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/write.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
cscopelist-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscope: cscope.files
test ! -s cscope.files \
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
clean-cscope:
-rm -f cscope.files
cscope.files: clean-cscope cscopelist-recursive cscopelist
cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-hook
-test -n "$(am__skip_mode_fix)" \
|| find "$(distdir)" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__post_remove_distdir)
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__post_remove_distdir)
dist dist-all:
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
$(am__post_remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
&& cd "$$am__cwd" \
|| exit 1
$(am__post_remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@test -n '$(distuninstallcheck_dir)' || { \
echo 'ERROR: trying to run $@ with an empty' \
'$$(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
$(am__cd) '$(distuninstallcheck_dir)' || { \
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile $(PROGRAMS) config.h
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-recursive
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am: install-binPROGRAMS
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-binPROGRAMS
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
cscopelist-recursive ctags-recursive install-am install-strip \
tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-binPROGRAMS \
clean-cscope clean-generic cscope cscopelist \
cscopelist-recursive ctags ctags-recursive dist dist-all \
dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar dist-tarZ \
dist-xz dist-zip distcheck distclean distclean-compile \
distclean-generic distclean-hdr distclean-tags distcleancheck \
distdir distuninstallcheck dvi dvi-am html html-am info \
info-am install install-am install-binPROGRAMS install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-am uninstall-binPROGRAMS
.PHONY: ChangeLog INSTALL
INSTALL:
$(INSTALL_CMD)
ChangeLog:
$(CHANGELOG_CMD)
dist-hook: ChangeLog INSTALL
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

0
app/fonttosfnt/NEWS Normal file
View file

16
app/fonttosfnt/README.md Normal file
View file

@ -0,0 +1,16 @@
fonttosfnt wraps a set of bdf or pcf bitmap fonts in a sfnt (TrueType or
OpenType) wrapper.
All questions regarding this software should be directed at the
Xorg mailing list:
https://lists.x.org/mailman/listinfo/xorg
The master development code repository can be found at:
https://gitlab.freedesktop.org/xorg/app/fonttosfnt.git
For patch submission instructions, see:
https://www.x.org/wiki/Development/Documentation/SubmittingPatches

3238
app/fonttosfnt/aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load diff

490
app/fonttosfnt/compile Normal file
View file

@ -0,0 +1,490 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1999-2020 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN* | MSYS*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/* | msys/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then
found=yes
lib=$dir/lib$lib.a
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
#! /bin/sh
# Wrapper for compilers which do not understand `-c -o'.
scriptversion=2005-05-14.22
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand `-c -o'.
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file `INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
esac
ofile=
cfile=
eat=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as `compile cc -o foo foo.c'.
# So we strip `-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no `-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# `.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
# Create the lock directory.
# Note: use `[/.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

1541
app/fonttosfnt/config.guess vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,71 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the declaration of `va_copy', and to 0 if you
don't. */
#undef HAVE_DECL_VA_COPY
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `vasprintf' function. */
#undef HAVE_VASPRINTF
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Major version of this package */
#undef PACKAGE_VERSION_MAJOR
/* Minor version of this package */
#undef PACKAGE_VERSION_MINOR
/* Patch version of this package */
#undef PACKAGE_VERSION_PATCHLEVEL
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION

1793
app/fonttosfnt/config.sub vendored Normal file

File diff suppressed because it is too large Load diff

12083
app/fonttosfnt/configure vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,55 @@
dnl Copyright 2005 Red Hat, Inc.
dnl
dnl Permission to use, copy, modify, distribute, and sell this software and its
dnl documentation for any purpose is hereby granted without fee, provided that
dnl the above copyright notice appear in all copies and that both that
dnl copyright notice and this permission notice appear in supporting
dnl documentation, and that the name of Red Hat not be used in
dnl advertising or publicity pertaining to distribution of the software without
dnl specific, written prior permission. Red Hat makes no
dnl representations about the suitability of this software for any purpose. It
dnl is provided "as is" without express or implied warranty.
dnl
dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
dnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
dnl PERFORMANCE OF THIS SOFTWARE.
dnl
dnl Process this file with autoconf to create configure.
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT(fonttosfnt,[1.2.2], [https://gitlab.freedesktop.org/xorg/app/fonttosfnt/issues],fonttosfnt)
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
m4_ifndef([XORG_MACROS_VERSION],
[m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
AC_CHECK_FUNC(setenv, have_setenv=yes, have_setenv=no)
AC_CHECK_FUNCS([vasprintf])
AC_CHECK_DECLS([va_copy], [], [], [
AC_INCLUDES_DEFAULT
#include <stdarg.h>
])
AM_CONDITIONAL(NEED_SETENV, [test x$have_setenv = xno])
# Checks for pkg-config packages
PKG_CHECK_MODULES(FONTTOSFNT, xproto freetype2 fontenc)
AC_CONFIG_FILES([
Makefile
man/Makefile])
AC_OUTPUT

787
app/fonttosfnt/depcomp Normal file
View file

@ -0,0 +1,787 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2012-07-12.20; # UTC
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by 'PROGRAMS ARGS'.
object Object file output by 'PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputting dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
# A tabulation character.
tab=' '
# A newline character.
nl='
'
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Avoid interferences from the environment.
gccflag= dashmflag=
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
# This is just like msvc7 but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvc7
fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
## (see the conditional assignment to $gccflag above).
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say). Also, it might not be
## supported by the other compilers which use the 'gcc' depmode.
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' "$nl" < "$tmpdepfile" |
## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependent.h'.
# Do two passes, one to just change these to
# '$object: dependent.h' and one to simply 'dependent.h:'.
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
# However on
# $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\':
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
# tcc 0.9.26 (FIXME still under development at the moment of writing)
# will emit a similar output, but also prepend the continuation lines
# with horizontal tabulation characters.
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form 'foo.o: dependent.h',
# or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
# Do two passes, one to just change these to
# '$object: dependent.h' and one to simply 'dependent.h:'.
sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \
< "$tmpdepfile" > "$depfile"
sed '
s/[ '"$tab"'][ '"$tab"']*/ /g
s/^ *//
s/ *\\*$//
s/^[^:]*: *//
/^$/d
/:$/d
s/$/ :/
' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
## The order of this option in the case statement is important, since the
## shell code in configure will try each of these formats in the order
## listed in this file. A plain '-MD' option would be understood by many
## compilers, so we must ensure this comes after the gcc and icc options.
pgcc)
# Portland's C compiler understands '-MD'.
# Will always output deps to 'file.d' where file is the root name of the
# source file under compilation, even if file resides in a subdirectory.
# The object file name does not affect the name of the '.d' file.
# pgcc 10.2 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\' :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
# Use the source, not the object, to determine the base name, since
# that's sadly what pgcc will do too.
base=`echo "$source" | sed -e 's|^.*/||' -e 's/\.[-_a-zA-Z0-9]*$//'`
tmpdepfile="$base.d"
# For projects that build the same source file twice into different object
# files, the pgcc approach of using the *source* file root name can cause
# problems in parallel builds. Use a locking strategy to avoid stomping on
# the same $tmpdepfile.
lockdir="$base.d-lock"
trap "echo '$0: caught signal, cleaning up...' >&2; rm -rf $lockdir" 1 2 13 15
numtries=100
i=$numtries
while test $i -gt 0 ; do
# mkdir is a portable test-and-set.
if mkdir $lockdir 2>/dev/null; then
# This process acquired the lock.
"$@" -MD
stat=$?
# Release the lock.
rm -rf $lockdir
break
else
## the lock is being held by a different process,
## wait until the winning process is done or we timeout
while test -d $lockdir && test $i -gt 0; do
sleep 1
i=`expr $i - 1`
done
fi
i=`expr $i - 1`
done
trap - 1 2 13 15
if test $i -le 0; then
echo "$0: failed to acquire lock after $numtries attempts" >&2
echo "$0: check lockdir '$lockdir'" >&2
exit 1
fi
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mechanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
msvc7)
if test "$libtool" = yes; then
showIncludes=-Wc,-showIncludes
else
showIncludes=-showIncludes
fi
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
if test "$stat" = 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The first sed program below extracts the file names and escapes
# backslashes for cygpath. The second sed program outputs the file
# name when reading, but also accumulates all include files in the
# hold buffer in order to output them again at the end. This only
# works with sed implementations that can handle large buffers.
sed < "$tmpdepfile" -n '
/^Note: including file: *\(.*\)/ {
s//\1/
s/\\/\\\\/g
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvc7msys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for ':'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' "$nl" < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

151
app/fonttosfnt/env.c Normal file
View file

@ -0,0 +1,151 @@
/*
* Provide setenv() and unsetenv() on platforms that don't have them.
* From FreeBSD's libc.
*/
/*
* Copyright (c) 1987, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/* $XFree86: xc/programs/xedit/lisp/env.c,v 1.1 2002/03/05 03:52:34 dawes Exp $ */
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
extern char **environ;
extern int setenv(const char *name, const char *value, int overwrite);
extern void unsetenv(const char *name);
static char *
findenv(const char *name, int *offset)
{
int len, i;
const char *np;
char **p, *cp;
if (name == NULL || environ == NULL)
return NULL;
for (np = name; *np && *np != '='; ++np)
continue;
len = np - name;
for (p = environ; (cp = *p) != NULL; ++p) {
for (np = name, i = len; i && *cp; i--)
if (*cp++ != *np++)
break;
if (i == 0 && *cp++ == '=') {
*offset = p - environ;
return cp;
}
}
return NULL;
}
/*
* setenv --
* Set the value of the environmental variable "name" to be
* "value". If overwrite is set, replace any current value.
*/
int
setenv(const char *name, const char *value, int overwrite)
{
static char **alloced; /* if allocated space before */
char *c;
int l_value, offset;
if (*value == '=') /* no '=' in value */
++value;
l_value = strlen(value);
if ((c = findenv(name, &offset))) { /* find if already exists */
if (!overwrite)
return 0;
if (strlen(c) >= l_value) { /* old larger; copy over */
while ((*c++ = *value++))
;
return 0;
}
} else { /* create new slot */
int cnt;
char **p;
for (p = environ, cnt = 0; *p; ++p, ++cnt)
;
if (alloced == environ) { /* just increase size */
p = (char **)realloc((char *)environ,
sizeof(char *) * (cnt + 2));
if (!p)
return -1;
alloced = environ = p;
} else { /* get new space */
/* copy old entries into it */
p = malloc(sizeof(char *) * (cnt + 2));
if (!p)
return -1;
memcpy(p, environ, cnt * sizeof(char *));
alloced = environ = p;
}
environ[cnt + 1] = NULL;
offset = cnt;
}
for (c = (char *)name; *c && *c != '='; ++c) /* no '=' in name */
;
if (!(environ[offset] = /* name + '=' + value */
malloc((int)(c - name) + l_value + 2)))
return -1;
for (c = environ[offset]; (*c = *name++) && *c != '='; ++c)
;
for (*c++ = '='; (*c++ = *value++); )
;
return 0;
}
/*
* unsetenv(name) --
* Delete environmental variable "name".
*/
void
unsetenv(const char *name)
{
char **p;
int offset;
while (findenv(name, &offset)) /* if set multiple times */
for (p = &environ[offset];; ++p)
if (!(*p = *(p + 1)))
break;
}

128
app/fonttosfnt/fonttosfnt.c Normal file
View file

@ -0,0 +1,128 @@
/*
Copyright (c) 2002-2003 by Juliusz Chroboczek
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/* $XdotOrg: xc/programs/fonttosfnt/fonttosfnt.c,v 1.4 2003/12/19 02:16:36 dawes Exp $ */
/* $XFree86: xc/programs/fonttosfnt/fonttosfnt.c,v 1.3 2003/07/08 15:39:49 tsi Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "fonttosfnt.h"
int verbose_flag = 0;
int reencode_flag = 1;
int glyph_flag = 2;
int metrics_flag = 1;
int crop_flag = 1;
int bit_aligned_flag = 1;
static void
usage(void)
{
fprintf(stderr, "Usage:\n");
fprintf(stderr,
"fonttosfnt [ -v ] [ -c ] [ -b ] [ -r ] [ -g n ] [ -m n ] -o font.otb "
"[ -- ] [ font ] ...\n");
}
int
main(int argc, char **argv)
{
int i;
int rc;
char *output = NULL;
FontPtr font;
i = 1;
while(i < argc) {
if(argv[i][0] != '-')
break;
if(argv[i][1] == 'o') {
if(argv[i][2] == '\0') {
output = sprintf_alloc("%s", argv[i + 1]);
i += 2;
} else {
output = sprintf_alloc("%s", argv[i] + 2);
i++;
}
} else if(strcmp(argv[i], "-v") == 0) {
verbose_flag = 1;
i++;
} else if(strcmp(argv[i], "-c") == 0) {
crop_flag = 0;
i++;
} else if(strcmp(argv[i], "-b") == 0) {
bit_aligned_flag = 0;
i++;
} else if(strcmp(argv[i], "-r") == 0) {
reencode_flag = 0;
i++;
} else if(strcmp(argv[i], "-g") == 0) {
if(argc <= i + 1) {
usage();
exit(1);
}
glyph_flag = atoi(argv[i + 1]);
i += 2;
} else if(strcmp(argv[i], "-m") == 0) {
if(argc <= i + 1) {
usage();
exit(1);
}
metrics_flag = atoi(argv[i + 1]);
i += 2;
} else if(strcmp(argv[i], "--") == 0) {
i++;
break;
} else {
usage();
exit(1);
}
}
if(output == NULL) {
usage();
exit(1);
}
font = makeFont();
if(argc - i > 1)
fprintf(stderr,
"You are requesting to put more than one font into a single OpenType font.\n"
"This is not recommended. The global font metrics will not match every font face.\n"
"The creation of an OpenType font collection is recommended.\n");
if(i == argc) {
rc = readFile(NULL, font);
if(rc != 0)
exit(1);
} else while(i < argc) {
rc = readFile(argv[i], font);
if(rc != 0)
exit(1);
i++;
}
writeFile(output, font);
return 0;
}

200
app/fonttosfnt/fonttosfnt.h Normal file
View file

@ -0,0 +1,200 @@
/*
Copyright (c) 2002-2003 by Juliusz Chroboczek
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/* $XFree86: xc/programs/fonttosfnt/fonttosfnt.h,v 1.4 2003/10/24 20:38:11 tsi Exp $ */
#ifndef _FONTTOSFNT_H_
#define _FONTTOSFNT_H_ 1
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdarg.h>
#include <math.h>
#include <ft2build.h>
#include FT_FREETYPE_H
#define ROUND(x) ((double)(int)((x) + 0.5))
extern int verbose_flag;
extern int glyph_flag;
extern int metrics_flag;
extern int crop_flag;
extern int bit_aligned_flag;
extern int reencode_flag;
#define FONT_SEGMENT_SIZE 128
#define FONT_CODES 0x10000
#define FACE_BOLD 1
#define FACE_ITALIC 2
#define FACE_SYMBOL 4
#define STRIKE_BITMAP(s, i) \
((s)->bitmaps[(i)/FONT_SEGMENT_SIZE] ? \
(s)->bitmaps[(i)/FONT_SEGMENT_SIZE][(i)%FONT_SEGMENT_SIZE] : \
NULL)
#define SAME_METRICS(b1, b2) \
((b1)->advanceWidth == (b2)->advanceWidth && \
(b1)->horiBearingX == (b2)->horiBearingX && \
(b1)->horiBearingY == (b2)->horiBearingY && \
(b1)->width == (b2)->width && \
(b1)->height == (b2)->height)
/* bit at (x, y) of raster r with stride s */
#define BITREF(r, s, x, y) \
(((r)[(y) * (s) + (x) / 8] & (1 << (7 - (x) % 8))) != 0)
#define ONE_HALF (1 << 15)
#define TWO_SIXTEENTH (1 << 16)
#define UNITS_PER_EM 2048
#define UNDEF 0x80000000
/* Convert a fixed-point value into FUnits */
#define FONT_UNITS(x) \
round(((double)(x)) / TWO_SIXTEENTH * UNITS_PER_EM)
#define FONT_UNITS_FLOOR(x) \
floor(((double)(x)) / TWO_SIXTEENTH * UNITS_PER_EM)
#define FONT_UNITS_CEIL(x) \
ceil(((double)(x)) / TWO_SIXTEENTH * UNITS_PER_EM)
typedef struct _FontNameEntry {
int nid; /* name id */
int size; /* bytes in value */
char *value;
} FontNameEntryRec, *FontNameEntryPtr;
typedef struct _Metrics {
int height;
int size;
int maxX;
int minX;
int maxY;
int minY;
int xHeight;
int capHeight;
int maxAwidth;
int awidth;
int ascent;
int descent;
int underlinePosition;
int underlineThickness;
} MetricsRec, *MetricsPtr;
typedef struct _Font {
int numNames;
struct _FontNameEntry *names;
int flags;
int weight; /* as in the OS/2 table */
int width; /* as in the OS/2 table */
int italicAngle; /* degrees c-clockwise from the vertical */
MetricsRec pxMetrics;
MetricsRec metrics;
unsigned foundry;
struct _Strike *strikes;
} FontRec, *FontPtr;
typedef struct _Strike {
int sizeX;
int sizeY;
struct _Bitmap ***bitmaps;
struct _Strike *next;
int numSbits;
int bitmapSizeTableLocation;
int indexSubTableLocation;
struct _IndexSubTable *indexSubTables;
} StrikeRec, *StrikePtr;
typedef struct _Bitmap {
int index;
int advanceWidth;
int horiBearingX;
int horiBearingY;
int width;
int height;
int stride;
char *raster;
int location;
} BitmapRec, *BitmapPtr;
typedef struct _IndexSubTable {
int location;
int firstGlyphIndex;
int lastGlyphIndex;
int constantMetrics;
int lastLocation;
struct _IndexSubTable *next;
} IndexSubTableRec, *IndexSubTablePtr;
typedef struct _Cmap {
int startCode;
int endCode;
int index;
struct _Cmap *next;
int maxindex; /* only in the head segment*/
int *inverse;
} CmapRec, *CmapPtr;
FontPtr makeFont(void);
StrikePtr makeStrike(FontPtr, int, int);
BitmapPtr makeBitmap(StrikePtr, int,
int, int, int, int, int, int,
unsigned char*, int);
IndexSubTablePtr makeIndexSubTables(StrikePtr, CmapPtr);
int fontIndex(FontPtr, int);
CmapPtr makeCmap(FontPtr);
int findIndex(CmapPtr, int);
int findCode(CmapPtr, int);
BitmapPtr strikeBitmapIndex(StrikePtr, CmapPtr, int);
int strikeMaxWidth(StrikePtr);
int glyphMetrics(FontPtr, int, int*, int*, int*, int*, int*);
void fontMetrics(FontPtr);
int maxIndex(CmapPtr);
int readFile(char *filename, FontPtr);
int writeFile(char *filename, FontPtr);
/* util.c */
#define PROP_ATOM 1
#define PROP_INTEGER 2
#define PROP_CARDINAL 3
char *sprintf_alloc(const char *f, ...);
char *vsprintf_alloc(const char *f, va_list args);
char *makeUTF16(const char *);
unsigned makeName(const char*);
int macTime(int *, unsigned *);
unsigned faceFoundry(FT_Face);
char *faceEncoding(FT_Face);
int faceFlags(FT_Face);
int faceIntProp(FT_Face, const char *);
char *faceStringProp(FT_Face, const char *);
int faceWeight(FT_Face);
int faceWidth(FT_Face);
int faceItalicAngle(FT_Face);
int degreesToFraction(int, int*, int*);
#endif /* _FONTTOSFNT_H_ */

527
app/fonttosfnt/install-sh Normal file
View file

@ -0,0 +1,527 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2011-11-20.07; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names problematic for 'test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

View file

@ -0,0 +1,12 @@
appmandir = $(APP_MAN_DIR)
appman_PRE = fonttosfnt.man
appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX))
EXTRA_DIST = $(appman_PRE)
CLEANFILES = $(appman_DATA)
SUFFIXES = .$(APP_MAN_SUFFIX) .man
# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
.man.$(APP_MAN_SUFFIX):
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@

View file

@ -0,0 +1,458 @@
# Makefile.in generated by automake 1.12.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = man
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(appmandir)"
DATA = $(appman_DATA)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHANGELOG_CMD = @CHANGELOG_CMD@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWARNFLAGS = @CWARNFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
FONTTOSFNT_CFLAGS = @FONTTOSFNT_CFLAGS@
FONTTOSFNT_LIBS = @FONTTOSFNT_LIBS@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MAN_SUBSTS = @MAN_SUBSTS@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRICT_CFLAGS = @STRICT_CFLAGS@
STRIP = @STRIP@
VERSION = @VERSION@
XORG_MAN_PAGE = @XORG_MAN_PAGE@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
appmandir = $(APP_MAN_DIR)
appman_PRE = fonttosfnt.man
appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX))
EXTRA_DIST = $(appman_PRE)
CLEANFILES = $(appman_DATA)
SUFFIXES = .$(APP_MAN_SUFFIX) .man
all: all-am
.SUFFIXES:
.SUFFIXES: .$(APP_MAN_SUFFIX) .man
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign man/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-appmanDATA: $(appman_DATA)
@$(NORMAL_INSTALL)
@list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(appmandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(appmandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appmandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \
done
uninstall-appmanDATA:
@$(NORMAL_UNINSTALL)
@list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(appmandir)'; $(am__uninstall_files_from_dir)
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(DATA)
installdirs:
for dir in "$(DESTDIR)$(appmandir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-appmanDATA
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-appmanDATA
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic distclean \
distclean-generic distdir dvi dvi-am html html-am info info-am \
install install-am install-appmanDATA install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am uninstall uninstall-am uninstall-appmanDATA
# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
.man.$(APP_MAN_SUFFIX):
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View file

@ -0,0 +1,79 @@
.\" $XFree86$
.TH FONTTOSFNT 1 __vendorversion__
.SH NAME
fonttosfnt \- Wrap a bitmap font in a sfnt (OpenType) wrapper
.SH SYNOPSIS
.B fonttosfnt
[
.I options
]
.B \-o
.I file.otb
[
.B \-\-
] [
.IR font
] ...
.SH DESCRIPTION
Wrap a bitmap font or a set of bitmap fonts in a sfnt (TrueType or
OpenType) wrapper.
If no font is specified, a BDF font is read from standard input (stdin).
.SH OPTIONS
.TP
.B \-v
Be verbose.
.TP
.B \-c
Do not crop glyphs. This usually increases file size, but may
sometimes yield a modest decrease in file size for small character
cell fonts (terminal fonts).
.TP
.B \-b
Write byte-aligned glyph data. By default, unaligned data is written,
which yields a smaller file size.
.TP
.B \-r
Do not reencode fonts. By default, fonts are reencoded to Unicode
whenever possible.
.TP
.BI \-g " n"
Set the type of scalable glyphs that we write. If
.I n
is 0, no scalable glyphs are written; this is legal but confuses
most current software. If
.I n
is 1, a single scalable glyph (the undefined glyph) is written; this
is recommended, but triggers a bug in current versions of
.BR FreeType .
If
.I n
is 2 (the default), a sufficiently high number of blank glyphs are
written, which works with
.B FreeType
but increases file size.
.TP
.BI \-m " n"
Set the type of scalable metrics that we write. If
.I n
is 0, no scalable metrics are written, which may or may not be legal.
If
.I n
is 1, full metrics for a single glyph are written, and only left
sidebearing values are written for the other glyphs. If
.I n
is 2, scalable metrics for all glyphs are written, which increases
file size and is not recommended. The default is 1.
.TP
.B \-\-
End of options.
.SH BUGS
Some of the font-level values, notably sub- and superscript positions,
are dummy values.
.SH SEE ALSO
X(__miscmansuffix__), Xserver(__appmansuffix__), Xft(__libmansuffix__).
.I Fonts in X11.
.SH AUTHOR
The version of
.B Fonttosfnt
included in this X.Org Foundation release was originally written by
Juliusz Chroboczek <jch@freedesktop.org> for the XFree86 project.

330
app/fonttosfnt/missing Normal file
View file

@ -0,0 +1,330 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2012-01-06.18; # UTC
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try '$0 --help' for more information"
exit 1
fi
run=:
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, 'missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file 'aclocal.m4'
autoconf touch file 'configure'
autoheader touch file 'config.h.in'
autom4te touch the output file, or create a stub one
automake touch all 'Makefile.in' files
bison create 'y.tab.[ch]', if possible, from existing .[ch]
flex create 'lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create 'lex.yy.c', if possible, from existing .c
makeinfo touch the output file
yacc create 'y.tab.[ch]', if possible, from existing .[ch]
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
'g' are ignored when checking the name.
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: Unknown '$1' option"
echo 1>&2 "Try '$0 --help' for more information"
exit 1
;;
esac
# normalize program name to check for.
program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program). This is about non-GNU programs, so use $1 not
# $program.
case $1 in
lex*|yacc*)
# Not GNU programs, they don't have --version.
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running '$TOOL --version' or '$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case $program in
aclocal*)
echo 1>&2 "\
WARNING: '$1' is $msg. You should only need it if
you modified 'acinclude.m4' or '${configure_ac}'. You might want
to install the Automake and Perl packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf*)
echo 1>&2 "\
WARNING: '$1' is $msg. You should only need it if
you modified '${configure_ac}'. You might want to install the
Autoconf and GNU m4 packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader*)
echo 1>&2 "\
WARNING: '$1' is $msg. You should only need it if
you modified 'acconfig.h' or '${configure_ac}'. You might want
to install the Autoconf and GNU m4 packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: '$1' is $msg. You should only need it if
you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'.
You might want to install the Automake and Perl packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te*)
echo 1>&2 "\
WARNING: '$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get '$1' as part of Autoconf from any GNU
archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison*|yacc*)
echo 1>&2 "\
WARNING: '$1' $msg. You should only need it if
you modified a '.y' file. You may need the Bison package
in order for those modifications to take effect. You can get
Bison from any GNU archive site."
rm -f y.tab.c y.tab.h
if test $# -ne 1; then
eval LASTARG=\${$#}
case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if test ! -f y.tab.h; then
echo >y.tab.h
fi
if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex*|flex*)
echo 1>&2 "\
WARNING: '$1' is $msg. You should only need it if
you modified a '.l' file. You may need the Flex package
in order for those modifications to take effect. You can get
Flex from any GNU archive site."
rm -f lex.yy.c
if test $# -ne 1; then
eval LASTARG=\${$#}
case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man*)
echo 1>&2 "\
WARNING: '$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
Help2man package in order for those modifications to take
effect. You can get Help2man from any GNU archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit $?
fi
;;
makeinfo*)
echo 1>&2 "\
WARNING: '$1' is $msg. You should only need it if
you modified a '.texi' or '.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy 'make' (AIX,
DU, IRIX). You might want to install the Texinfo package or
the GNU make package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '
/^@setfilename/{
s/.* \([^ ]*\) *$/\1/
p
q
}' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
*)
echo 1>&2 "\
WARNING: '$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the 'README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing '$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

395
app/fonttosfnt/read.c Normal file
View file

@ -0,0 +1,395 @@
/* $XdotOrg: xc/programs/fonttosfnt/read.c,v 1.2 2004/04/23 19:54:32 eich Exp $ */
/*
Copyright (c) 2002 by Juliusz Chroboczek
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/* $XdotOrg: xc/programs/fonttosfnt/read.c,v 1.2 2004/04/23 19:54:32 eich Exp $ */
/* $XFree86: xc/programs/fonttosfnt/read.c,v 1.5 2003/12/19 02:05:39 dawes Exp $ */
#include <stdio.h>
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_MODULE_H
#include FT_BDF_H
#include FT_FONT_FORMATS_H
#include "X11/Xos.h"
#include "fonttosfnt.h"
#include "X11/fonts/fontenc.h"
#define FLOOR2(x, y) ((x) >= 0 ? (x) / (y) : -(((-(x)) + (y) - 1) / (y)))
#define CEIL2(x, y) (FLOOR2((x) + (y) - 1, (y)))
#define FT_Pos_DOWN(x) (FLOOR2((x),64))
#define FT_Pos_UP(x) (CEIL2((x), 64))
#define MIN(x, y) (((x) <= (y)) ? (x) : (y))
#define STREAM_FILE(stream) ((FILE*)stream->descriptor.pointer)
static int ft_inited = 0;
static FT_Library ft_library;
static int
FT_Ensure_Inited(void)
{
int rc;
if(ft_inited)
return 0;
rc = FT_Init_FreeType(&ft_library);
if(rc != 0)
return rc;
ft_inited = 1;
return 0;
}
static unsigned long
forwardRead(FT_Stream stream, unsigned long offset, unsigned char *buffer,
unsigned long count) {
unsigned char skip_buffer[BUFSIZ];
unsigned long skip_count;
FILE *file = STREAM_FILE(stream);
/* We may be asked to skip forward, but by not doing so we increase our
chance of survival. */
if(count == 0)
return ferror(file) == 0 ? 0 : 1;
if(offset < stream->pos) {
fprintf(stderr, "Cannot move backward in input stream.\n");
return 0;
}
while((skip_count = MIN(BUFSIZ, offset - stream->pos))) {
if(fread(skip_buffer, sizeof(*skip_buffer), skip_count, file) <
skip_count)
return 0;
stream->pos += sizeof(*skip_buffer) * skip_count;
}
return (unsigned long)fread(buffer, sizeof(*buffer), count, file);
}
static void
streamClose(FT_Stream stream) {
fclose(STREAM_FILE(stream));
stream->descriptor.pointer = NULL;
stream->size = 0;
}
int
readFile(char *filename, FontPtr font)
{
int j, k, index;
int rc;
FT_Open_Args input = { 0 };
FT_Face face;
StrikePtr strike;
BitmapPtr bitmap;
int symbol = 0;
int force_unicode = 1;
const char *family_name, *encoding_name, *file_format;
FontMapPtr mapping = NULL;
FontMapReversePtr reverse = NULL;
rc = FT_Ensure_Inited();
if(rc != 0)
return rc;
if(filename != NULL) {
input.pathname = filename;
input.flags = FT_OPEN_PATHNAME;
} else {
input.flags = FT_OPEN_STREAM | FT_OPEN_DRIVER;
input.driver = FT_Get_Module(ft_library, "bdf");
input.stream = calloc(1, sizeof(FT_StreamRec));
if(input.stream == NULL)
return -1;
input.stream->size = 0x7FFFFFFF;
input.stream->descriptor.pointer = stdin;
input.stream->read = forwardRead;
input.stream->close = streamClose;
}
rc = FT_Open_Face(ft_library, &input, 0, &face);
if(rc != 0) {
fprintf(stderr, "Couldn't open face %s.\n",
filename ? filename : "<stdin>");
return -1;
}
file_format = FT_Get_Font_Format(face);
if(strcmp(file_format, "BDF") != 0)
fprintf(stderr,
"font file %s is of format %s.\n"
"It's recommended to convert directly from a BDF font.\n"
"Some font properties may get lost when converting via a PCF font.\n",
filename ? filename : "<stdin>",
file_format);
/* FreeType will insist on encodings which are simple subsets of unicode
* to be read as unicode regardless of what we call them. */
for(j = 0; j < face->num_charmaps; ++j) {
if((face->charmaps[j]->encoding == ft_encoding_none) ||
(face->charmaps[j]->encoding == ft_encoding_adobe_standard)) {
force_unicode = 0;
break;
}
}
encoding_name = faceEncoding(face);
if(encoding_name == NULL) {
symbol = 1;
} else if(strcasecmp(encoding_name, "iso10646-1") != 0) {
if(reencode_flag)
mapping = FontEncMapFind(encoding_name,
FONT_ENCODING_UNICODE, 0, 0, NULL);
if(mapping == NULL) {
symbol = 1;
} else {
reverse = FontMapReverse(mapping);
if(reverse == NULL) {
fprintf(stderr, "Couldn't reverse mapping.\n");
return -1;
}
}
}
if(face->family_name)
family_name = face->family_name;
else
family_name = faceStringProp(face, "FONT");
if(verbose_flag) {
fprintf(stderr, "%s %s %s: %d sizes%s\n",
filename ? filename : "<stdin>",
face->family_name, face->style_name, face->num_fixed_sizes,
symbol ? " (symbol)" : "");
}
if(font->numNames == 0 && face->style_name && family_name) {
char *full_name, *unique_name, *buf;
int i;
if(strcmp(face->style_name, "Regular") == 0)
full_name = sprintf_alloc("%s", family_name);
else
full_name = sprintf_alloc("%s %s",
family_name, face->style_name);
/* The unique name doesn't actually need to be globally
unique; it only needs to be unique among all installed fonts on a
Windows system. We don't bother getting it quite right. */
if(face->num_fixed_sizes <= 0)
unique_name = sprintf_alloc("%s "XVENDORNAMESHORT" bitmap",
full_name);
else if(face->available_sizes[0].width ==
face->available_sizes[0].height)
unique_name = sprintf_alloc("%s "XVENDORNAMESHORT
" bitmap size %d",
full_name,
face->available_sizes[0].height);
else
unique_name = sprintf_alloc("%s "XVENDORNAMESHORT
" bitmap size %dx%d",
full_name,
face->available_sizes[0].width,
face->available_sizes[0].height);
font->names = malloc(10 * sizeof(FontNameEntryRec));
if(font->names == NULL) {
fprintf(stderr, "Couldn't allocate names.\n");
return -1;
}
i = 0;
buf = faceStringProp(face, "COPYRIGHT");
if(buf) {
font->names[i].nid = 0;
font->names[i].size = 2 * strlen(buf);
font->names[i].value = makeUTF16(buf);
free(buf);
i++;
}
font->names[i].nid = 1;
font->names[i].size = 2 * strlen(family_name);
font->names[i].value = makeUTF16(family_name);
i++;
font->names[i].nid = 2;
font->names[i].size = 2 * strlen(face->style_name);
font->names[i].value = makeUTF16(face->style_name);
i++;
font->names[i].nid = 3;
font->names[i].size = 2 * strlen(unique_name);
font->names[i].value = makeUTF16(unique_name);
i++;
font->names[i].nid = 4;
font->names[i].size = 2 * strlen(full_name);
font->names[i].value = makeUTF16(full_name);
i++;
font->names[i].nid = 5;
font->names[i].size = 2 * strlen("Version 0.0");
font->names[i].value = makeUTF16("Version 0.0");
i++;
buf = faceStringProp(face, "FOUNDRY");
if(buf) {
font->names[i].nid = 8;
font->names[i].size = 2 * strlen(buf);
font->names[i].value = makeUTF16(buf);
free(buf);
i++;
}
font->names[i].nid = 10;
font->names[i].size = 2 * strlen(XVENDORNAMESHORT
" converted bitmap font");
font->names[i].value = makeUTF16(XVENDORNAMESHORT
" converted bitmap font");
i++;
#ifdef __VENDORWEBSUPPORT__
font->names[i].nid = 11;
font->names[i].size = 2 * strlen(__VENDORWEBSUPPORT__);
font->names[i].value = makeUTF16(__VENDORWEBSUPPORT__);
i++;
#endif
font->numNames = i;
}
if(face->num_fixed_sizes == 0) {
fprintf(stderr, "No bitmaps in face.\n");
return -1;
}
if((!symbol && !mapping) || force_unicode) {
rc = FT_Select_Charmap(face, ft_encoding_unicode);
} else {
rc = FT_Select_Charmap(face, ft_encoding_none);
if(rc != 0) {
/* BDF will default to Adobe Standard even for nonstandard
* encodings, so try that as a last resort. */
rc = FT_Select_Charmap(face, ft_encoding_adobe_standard);
}
}
if(rc != 0) {
fprintf(stderr, "Couldn't select character map: %x.\n", rc);
return -1;
}
font->flags = faceFlags(face) | (symbol ? FACE_SYMBOL : 0);
font->weight = faceWeight(face);
font->width = faceWidth(face);
font->foundry = faceFoundry(face);
font->italicAngle = faceItalicAngle(face);
font->pxMetrics.height = face->available_sizes[0].height;
font->pxMetrics.size = faceIntProp(face, "PIXEL_SIZE");
font->pxMetrics.xHeight = faceIntProp(face, "X_HEIGHT");
font->pxMetrics.capHeight = faceIntProp(face, "CAP_HEIGHT");
font->pxMetrics.ascent = faceIntProp(face, "FONT_ASCENT");
font->pxMetrics.descent = faceIntProp(face, "FONT_DESCENT");
font->pxMetrics.underlinePosition = faceIntProp(face, "UNDERLINE_POSITION");
font->pxMetrics.underlineThickness = faceIntProp(face, "UNDERLINE_THICKNESS");
for(int i = 0; i < face->num_fixed_sizes; i++) {
if(verbose_flag)
fprintf(stderr, "size %d: %dx%d\n",
i,
(int)((face->available_sizes[i].x_ppem + 32) >> 6),
(int)((face->available_sizes[i].y_ppem + 32) >> 6));
rc = FT_Set_Pixel_Sizes(face,
(face->available_sizes[i].x_ppem + 32) >> 6,
(face->available_sizes[i].y_ppem + 32) >> 6);
if(rc != 0) {
fprintf(stderr, "Couldn't set size.\n");
return -1;
}
strike = makeStrike(font,
(face->available_sizes[i].x_ppem + 32) >> 6,
(face->available_sizes[i].y_ppem + 32) >> 6);
if(strike == NULL) {
fprintf(stderr, "Couldn't allocate strike.\n");
return -1;
}
for(j = 0; j < FONT_CODES; j++) {
if(mapping)
k = reverse->reverse(j, reverse->data);
else
k = j;
if(k <= 0 && j != 0)
continue;
index = FT_Get_Char_Index(face, k);
if(j != 0 && index == 0)
continue;
rc = FT_Load_Glyph(face, index,
FT_LOAD_RENDER | FT_LOAD_MONOCHROME);
if(rc != 0) {
fprintf(stderr, "Couldn't load glyph for U+%04X (%d)\n",
j, index);
continue;
}
bitmap = makeBitmap(strike, j,
FT_Pos_UP(face->glyph->metrics.horiAdvance),
FT_Pos_DOWN(face->glyph->metrics.horiBearingX),
FT_Pos_DOWN(face->glyph->metrics.horiBearingY),
face->glyph->bitmap.width,
face->glyph->bitmap.rows,
face->glyph->bitmap.pitch,
face->glyph->bitmap.buffer,
crop_flag);
if(bitmap == NULL) {
fprintf(stderr, "Couldn't create bitmap.\n");
return -1;
}
}
}
FT_Done_Face(face);
free(input.stream);
j = 0;
for(int i = 0; i < FONT_CODES; i++) {
int found = 0;
strike = font->strikes;
while(strike) {
bitmap = STRIKE_BITMAP(strike, i);
if(bitmap) {
bitmap->index = j;
found = 1;
} else {
if(i == 0) {
fprintf(stderr,
"Warning: no bitmap for the undefined glyph.\n");
found = 1;
}
}
strike = strike->next;
}
if(found)
j++;
}
return 0;
}

485
app/fonttosfnt/struct.c Normal file
View file

@ -0,0 +1,485 @@
/*
Copyright (c) 2002-2003 by Juliusz Chroboczek
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/* $XFree86: xc/programs/fonttosfnt/struct.c,v 1.3 2003/10/24 20:38:11 tsi Exp $ */
#include <stdlib.h>
#include <stdio.h>
#include <ft2build.h>
#include FT_FREETYPE_H
#include "fonttosfnt.h"
FontPtr
makeFont(void)
{
FontPtr font;
font = malloc(sizeof(FontRec));
if(font == NULL)
return NULL;
font->numNames = 0;
font->names = NULL;
font->flags = 0;
font->weight = 500;
font->width = 5;
font->italicAngle = 0;
font->pxMetrics.height = UNDEF;
font->pxMetrics.maxX = UNDEF;
font->pxMetrics.minX = UNDEF;
font->pxMetrics.maxY = UNDEF;
font->pxMetrics.minY = UNDEF;
font->pxMetrics.xHeight = UNDEF;
font->pxMetrics.capHeight = UNDEF;
font->pxMetrics.maxAwidth = UNDEF;
font->pxMetrics.awidth = UNDEF;
font->pxMetrics.ascent = UNDEF;
font->pxMetrics.descent = UNDEF;
font->pxMetrics.underlinePosition = UNDEF;
font->pxMetrics.underlineThickness = UNDEF;
font->metrics.height = UNDEF;
font->metrics.maxX = UNDEF;
font->metrics.minX = UNDEF;
font->metrics.maxY = UNDEF;
font->metrics.minY = UNDEF;
font->metrics.xHeight = UNDEF;
font->metrics.capHeight = UNDEF;
font->metrics.maxAwidth = UNDEF;
font->metrics.awidth = UNDEF;
font->metrics.ascent = UNDEF;
font->metrics.descent = UNDEF;
font->metrics.underlinePosition = UNDEF;
font->metrics.underlineThickness = UNDEF;
font->foundry = makeName("UNKN");
font->strikes = NULL;
return font;
}
StrikePtr
makeStrike(FontPtr font, int sizeX, int sizeY)
{
StrikePtr strike, last_strike;
strike = font->strikes;
last_strike = NULL;
while(strike) {
if(strike->sizeX == sizeX && strike->sizeY == sizeY)
return strike;
last_strike = strike;
strike = strike->next;
}
strike = malloc(sizeof(StrikeRec));
if(strike == NULL)
return NULL;
strike->sizeX = sizeX;
strike->sizeY = sizeY;
strike->bitmaps =
calloc(FONT_CODES / FONT_SEGMENT_SIZE, sizeof(BitmapPtr*));
if(strike->bitmaps == NULL) {
free(strike);
return NULL;
}
strike->numSbits = 0;
strike->next = NULL;
strike->bitmapSizeTableLocation = 0xDEADFACE;
strike->indexSubTables = NULL;
if(last_strike)
last_strike->next = strike;
else
font->strikes = strike;
return strike;
}
BitmapPtr
makeBitmap(StrikePtr strike, int code,
int advanceWidth, int horiBearingX, int horiBearingY,
int width, int height, int stride, unsigned char *raster, int crop)
{
BitmapPtr bitmap;
int i, j, x, y;
int dx, dy, new_width, new_height;
bitmap = malloc(sizeof(BitmapRec));
if(bitmap == NULL)
return NULL;
bitmap->index = -1;
bitmap->width = 0;
bitmap->height = 0;
bitmap->stride = 0;
bitmap->raster = NULL;
bitmap->location = 0xDEADFACE;
i = code / FONT_SEGMENT_SIZE;
j = code % FONT_SEGMENT_SIZE;
if(strike->bitmaps[i] == NULL) {
strike->bitmaps[i] = calloc(FONT_SEGMENT_SIZE, sizeof(BitmapPtr));
}
if(strike->bitmaps[i] == NULL) {
free(bitmap);
return NULL;
}
if(strike->bitmaps[i][j] != NULL) {
if(verbose_flag)
fprintf(stderr, "Duplicate bitmap %d.\n", code);
free(bitmap);
return strike->bitmaps[i][j];
}
dx = 0;
dy = 0;
new_width = width;
new_height = height;
if(crop) {
int empty;
while(new_width > 0) {
empty = 1;
x = new_width - 1;
for(y = 0; y < new_height; y++) {
if(BITREF(raster, stride, x + dx, y + dy)) {
empty = 0;
break;
}
}
if(empty)
new_width--;
else
break;
}
while(new_height > 0) {
empty = 1;
y = new_height - 1;
for(x = 0; x < new_width; x++) {
if(BITREF(raster, stride, x + dx, y + dy)) {
empty = 0;
break;
}
}
if(empty)
new_height--;
else
break;
}
while(new_width > 0) {
empty = 1;
x = 0;
for(y = 0; y < new_height; y++) {
if(BITREF(raster, stride, x + dx, y + dy)) {
empty = 0;
break;
}
}
if(empty) {
dx++;
new_width--;
} else
break;
}
while(new_height > 0) {
empty = 1;
y = 0;
for(x = 0; x < new_width; x++) {
if(BITREF(raster, stride, x + dx, y + dy)) {
empty = 0;
break;
}
}
if(empty) {
dy++;
new_height--;
} else
break;
}
}
bitmap->advanceWidth = advanceWidth;
bitmap->horiBearingX = horiBearingX + dx;
bitmap->horiBearingY = horiBearingY - dy;
bitmap->width = new_width;
bitmap->height = new_height;
bitmap->stride = (new_width + 7) / 8;
bitmap->raster = malloc(bitmap->height * bitmap->stride);
if(bitmap->raster == NULL) {
free(bitmap);
return NULL;
}
memset(bitmap->raster, 0, bitmap->height * bitmap->stride);
for(y = 0; y < new_height; y++) {
for(x = 0; x < new_width; x++) {
if(BITREF(raster, stride, x + dx, y + dy))
bitmap->raster[y * bitmap->stride + x / 8] |=
1 << (7 - (x % 8));
}
}
strike->bitmaps[i][j] = bitmap;
strike->numSbits++;
return bitmap;
}
IndexSubTablePtr
makeIndexSubTables(StrikePtr strike, CmapPtr cmap)
{
IndexSubTablePtr table, first, last;
BitmapPtr bitmap0, bitmap;
int index, n;
first = NULL;
last = NULL;
/* Assuming that we're writing bit-aligned data, small metrics
and short offsets, a constant metrics segment saves 5 bytes
per glyph in the EBDT table, and 2 bytes per glyph in the EBLC
table. On the other hand, the overhead for a supplementary
type 2 indexSubTable is 8 bytes for the indexSubTableArray
entry and 20 bytes for the subtable itself. It's worth
splitting at 5 glyphs. There's no analogue of a type 2
indexSubTable with byte-aligned data, so we don't bother
splitting when byte-aligning. */
index = 0;
while(index < 0xFFFF) {
int constantMetrics = 1;
bitmap0 = strikeBitmapIndex(strike, cmap, index);
if(bitmap0 == NULL) {
index++;
continue;
}
n = 1;
while((bitmap = strikeBitmapIndex(strike, cmap, index + n)) != NULL) {
if(constantMetrics) {
if(!SAME_METRICS(bitmap0, bitmap)) {
if(bit_aligned_flag && n >= 4)
break;
else
constantMetrics = 0;
}
} else if(bit_aligned_flag) {
BitmapPtr b1 = strikeBitmapIndex(strike, cmap, index + n + 1);
BitmapPtr b2 = strikeBitmapIndex(strike, cmap, index + n + 2);
BitmapPtr b3 = strikeBitmapIndex(strike, cmap, index + n + 3);
BitmapPtr b4 = strikeBitmapIndex(strike, cmap, index + n + 4);
if(b1 && b2 && b3 && b4 &&
SAME_METRICS(bitmap, b1) &&
SAME_METRICS(bitmap, b2) &&
SAME_METRICS(bitmap, b3) &&
SAME_METRICS(bitmap, b4)) {
break;
}
}
n++;
}
if(n <= 1)
constantMetrics = 0;
table = malloc(sizeof(IndexSubTableRec));
table->firstGlyphIndex = index;
table->lastGlyphIndex = index + n - 1;
table->constantMetrics = constantMetrics;
table->location = 0xDEADFACE;
table->lastLocation = 0xDEADFACE;
table->next = NULL;
if(first == NULL) {
first = table;
last = table;
} else {
last->next = table;
last = table;
}
index += n;
}
return first;
}
int
fontIndex(FontPtr font, int code)
{
StrikePtr strike;
BitmapPtr bitmap;
if(code == 0)
return 0;
strike = font->strikes;
while(strike) {
bitmap = STRIKE_BITMAP(strike, code);
if(bitmap)
return bitmap->index;
strike = strike->next;
}
return -1;
}
CmapPtr
makeCmap(FontPtr font)
{
CmapPtr cmap_head = NULL;
CmapPtr cmap_last = NULL;
CmapPtr cmap;
int code, i, index, maxindex = 0;
code = 0;
while(code < FONT_CODES) {
index = fontIndex(font, code);
if(index < 0) {
code++;
continue;
}
i = 1;
while(code + i < FONT_CODES &&
fontIndex(font, code + i) == index + i) {
i++;
}
cmap = malloc(sizeof(CmapRec));
if(cmap == NULL)
return NULL;
cmap->startCode = code;
cmap->endCode = code + i - 1;
cmap->index = index;
cmap->next = NULL;
cmap->maxindex = 0;
if(maxindex < index + i - 1)
maxindex = index + i - 1;
if(cmap_head == NULL)
cmap_head = cmap;
else
cmap_last->next = cmap;
cmap_last = cmap;
code += i;
}
cmap_head->maxindex = maxindex;
cmap_head->inverse = calloc(maxindex + 1, sizeof(int));
cmap = cmap_head;
while(cmap) {
for(i = cmap->index;
i <= cmap->endCode - cmap->startCode + cmap->index; i++) {
cmap_head->inverse[i] =
i - cmap->index + cmap->startCode;
}
cmap = cmap->next;
}
return cmap_head;
}
int
findIndex(CmapPtr cmap_head, int code)
{
CmapPtr cmap;
cmap = cmap_head;
while(cmap) {
if(cmap->endCode > code)
return -1;
if(cmap->startCode <= code)
return cmap->index + code - cmap->startCode;
cmap = cmap->next;
}
return -1;
}
int
findCode(CmapPtr cmap_head, int index)
{
if(index < 0 || index > cmap_head->maxindex)
return -1;
return cmap_head->inverse[index];
}
int
maxIndex(CmapPtr cmap_head)
{
return cmap_head->maxindex;
}
BitmapPtr
strikeBitmapIndex(StrikePtr strike, CmapPtr cmap, int index)
{
int code = findCode(cmap, index);
if(code < 0)
return NULL;
return STRIKE_BITMAP(strike, code);
}
int
strikeMaxWidth(StrikePtr strike)
{
BitmapPtr bitmap;
int i;
int width_max = 0;
for(i = 0; i < FONT_CODES; i++) {
bitmap = STRIKE_BITMAP(strike, i);
if(!bitmap)
continue;
if(bitmap->advanceWidth > width_max)
width_max = bitmap->advanceWidth;
}
return width_max;
}
int
glyphMetrics(FontPtr font, int code,
int *width_return,
int *x_min_return, int *y_min_return,
int *x_max_return, int *y_max_return)
{
StrikePtr strike;
BitmapPtr bitmap;
strike = font->strikes;
while(strike) {
bitmap = STRIKE_BITMAP(strike, code);
if(bitmap) {
if(width_return)
*width_return =
(((float)bitmap->advanceWidth) / strike->sizeX) *
TWO_SIXTEENTH;
if(x_min_return)
*x_min_return =
((float)bitmap->horiBearingX / strike->sizeX) *
TWO_SIXTEENTH;
if(y_min_return)
*y_min_return =
(((float)bitmap->horiBearingY - bitmap->height)
/ strike->sizeY) * TWO_SIXTEENTH;
if(x_max_return)
*x_max_return =
(((float)bitmap->horiBearingX + bitmap->width)
/ strike->sizeX) * TWO_SIXTEENTH;
if(y_max_return)
*y_max_return =
(((float)bitmap->horiBearingY) / strike->sizeY) *
TWO_SIXTEENTH;
return 1;
}
strike = strike->next;
}
return -1;
}

477
app/fonttosfnt/util.c Normal file
View file

@ -0,0 +1,477 @@
/*
Copyright (c) 2002-2003 by Juliusz Chroboczek
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/* $XdotOrg: xc/programs/fonttosfnt/util.c,v 1.11 2003/12/19 02:16:36 dawes Exp $ */
/* $XFree86: xc/programs/fonttosfnt/util.c,v 1.10 2003/12/19 02:05:39 dawes Exp $ */
#include <time.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#ifndef __UNIXOS2__
# include <math.h>
#else
# include <float.h>
#endif
#include <stdarg.h>
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_BDF_H
#include "X11/Xos.h"
#include "X11/Xfuncproto.h" /* for _X_ATTRIBUTE_PRINTF */
#include "fonttosfnt.h"
#ifdef NEED_SNPRINTF
#undef SCOPE
#define SCOPE static
#include "snprintf.c"
#endif
#ifdef __GLIBC__
#define HAVE_TIMEGM
#define HAVE_TM_GMTOFF
#endif
#ifdef BSD
#define HAVE_TM_GMTOFF
#define GMTOFFMEMBER tm_gmtoff
#endif
#ifdef __SCO__
#define HAVE_TM_GMTOFF
#define GMTOFFMEMBER tm_tzadj
#endif
/* That's in POSIX */
#define HAVE_TZSET
#ifdef NEED_SETENV
extern int setenv(const char *name, const char *value, int overwrite);
extern void unsetenv(const char *name);
#endif
char*
sprintf_alloc(const char *f, ...)
{
char *s;
va_list args;
va_start(args, f);
s = vsprintf_alloc(f, args);
va_end(args);
return s;
}
#if HAVE_VASPRINTF
_X_ATTRIBUTE_PRINTF(1, 0)
char*
vsprintf_alloc(const char *f, va_list args)
{
char *r;
int rc;
rc = vasprintf(&r, f, args);
if(rc < 0)
return NULL;
return r;
}
#else
_X_ATTRIBUTE_PRINTF(1, 0)
char*
vsprintf_alloc(const char *f, va_list args)
{
int n, size = 12;
char *string;
va_list args_copy;
while(1) {
if(size > 4096)
return NULL;
string = malloc(size);
if(!string)
return NULL;
#if HAVE_DECL_VA_COPY
va_copy(args_copy, args);
n = vsnprintf(string, size, f, args_copy);
#else
n = vsnprintf(string, size, f, args);
#endif
if(n >= 0 && n < size)
return string;
else if(n >= size)
size = n + 1;
else
size = size * 3 / 2 + 1;
free(string);
}
/* NOTREACHED */
}
#endif
/* Build a UTF-16 string from a Latin-1 string.
Result is not NUL-terminated. */
char *
makeUTF16(const char *string)
{
int i;
int n = strlen(string);
char *value = malloc(2 * n);
if(!value)
return NULL;
for(i = 0; i < n; i++) {
value[2 * i] = '\0';
value[2 * i + 1] = string[i];
}
return value;
}
unsigned
makeName(const char *s)
{
return s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3];
}
/* Like mktime(3), but UTC rather than local time */
#if defined(HAVE_TIMEGM)
static time_t
mktime_gmt(struct tm *tm)
{
return timegm(tm);
}
#elif defined(HAVE_TM_GMTOFF)
static time_t
mktime_gmt(struct tm *tm)
{
time_t t;
struct tm *ltm;
t = mktime(tm);
if(t < 0)
return -1;
ltm = localtime(&t);
if(ltm == NULL)
return -1;
return t + ltm->GMTOFFMEMBER;
}
#elif defined(HAVE_TZSET)
/* Taken from the Linux timegm(3) man page */
static time_t
mktime_gmt(struct tm *tm)
{
time_t t;
char *tz;
tz = getenv("TZ");
setenv("TZ", "", 1);
tzset();
t = mktime(tm);
if(tz)
setenv("TZ", tz, 1);
else
unsetenv("TZ");
tzset();
return t;
}
#else
#error no mktime_gmt implementation on this platform
#endif
/* Return the current time as a signed 64-bit number of seconds since
midnight, 1 January 1904. This is apparently when the Macintosh
was designed. */
int
macTime(int *hi, unsigned *lo)
{
unsigned long diff; /* Not time_t */
time_t macEpoch, current;
struct tm tm;
tm.tm_sec = 0;
tm.tm_min = 0;
tm.tm_hour = 0;
tm.tm_mday = 1;
tm.tm_mon = 1;
tm.tm_year = 4;
tm.tm_isdst = -1;
macEpoch = mktime_gmt(&tm);
if(macEpoch == -1) return -1;
current = time(NULL);
if(current == -1)
return -1;
if(current < macEpoch) {
errno = EINVAL;
return -1;
}
diff = current - macEpoch;
#if INT_MAX == LONG_MAX
*hi = 0;
#else
*hi = diff >> 32;
#endif
*lo = diff & 0xFFFFFFFF;
return 0;
}
unsigned
faceFoundry(FT_Face face)
{
int rc;
BDF_PropertyRec prop;
rc = FT_Get_BDF_Property(face, "FOUNDRY", &prop);
if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM && prop.u.atom) {
if(strcasecmp(prop.u.atom, "adobe") == 0)
return makeName("ADBE");
else if(strcasecmp(prop.u.atom, "agfa") == 0)
return makeName("AGFA");
else if(strcasecmp(prop.u.atom, "altsys") == 0)
return makeName("ALTS");
else if(strcasecmp(prop.u.atom, "apple") == 0)
return makeName("APPL");
else if(strcasecmp(prop.u.atom, "arphic") == 0)
return makeName("ARPH");
else if(strcasecmp(prop.u.atom, "alltype") == 0)
return makeName("ATEC");
else if(strcasecmp(prop.u.atom, "b&h") == 0)
return makeName("B&H ");
else if(strcasecmp(prop.u.atom, "bitstream") == 0)
return makeName("BITS");
else if(strcasecmp(prop.u.atom, "dynalab") == 0)
return makeName("DYNA");
else if(strcasecmp(prop.u.atom, "ibm") == 0)
return makeName("IBM ");
else if(strcasecmp(prop.u.atom, "itc") == 0)
return makeName("ITC ");
else if(strcasecmp(prop.u.atom, "interleaf") == 0)
return makeName("LEAF");
else if(strcasecmp(prop.u.atom, "impress") == 0)
return makeName("IMPR");
else if(strcasecmp(prop.u.atom, "larabiefonts") == 0)
return makeName("LARA");
else if(strcasecmp(prop.u.atom, "linotype") == 0)
return makeName("LINO");
else if(strcasecmp(prop.u.atom, "monotype") == 0)
return makeName("MT ");
else if(strcasecmp(prop.u.atom, "microsoft") == 0)
return makeName("MS ");
else if(strcasecmp(prop.u.atom, "urw") == 0)
return makeName("URW ");
else if(strcasecmp(prop.u.atom, "y&y") == 0)
return makeName("Y&Y ");
else {
char buf[5];
snprintf(buf, sizeof(buf), "%-4s", prop.u.atom);
return makeName(buf);
}
}
/* For now */
return makeName("UNKN");
}
int
faceWeight(FT_Face face)
{
int rc;
BDF_PropertyRec prop;
rc = FT_Get_BDF_Property(face, "WEIGHT_NAME", &prop);
if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM && prop.u.atom) {
if(strcasecmp(prop.u.atom, "thin") == 0)
return 100;
else if(strcasecmp(prop.u.atom, "extralight") == 0)
return 200;
else if(strcasecmp(prop.u.atom, "light") == 0)
return 300;
else if(strcasecmp(prop.u.atom, "medium") == 0)
return 400;
else if(strcasecmp(prop.u.atom, "semibold") == 0)
return 600;
else if(strcasecmp(prop.u.atom, "bold") == 0)
return 700;
else if(strcasecmp(prop.u.atom, "extrabold") == 0)
return 800;
else if(strcasecmp(prop.u.atom, "black") == 0)
return 900;
else
return 400;
} else
return 400; /* for now */
}
int
faceWidth(FT_Face face)
{
int rc;
BDF_PropertyRec prop;
rc = FT_Get_BDF_Property(face, "SETWIDTH_NAME", &prop);
if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM && prop.u.atom) {
if(strcasecmp(prop.u.atom, "ultracondensed") == 0)
return 1;
else if(strcasecmp(prop.u.atom, "extracondensed") == 0)
return 2;
else if(strcasecmp(prop.u.atom, "condensed") == 0)
return 3;
else if(strcasecmp(prop.u.atom, "semicondensed") == 0)
return 4;
else if(strcasecmp(prop.u.atom, "normal") == 0)
return 5;
else if(strcasecmp(prop.u.atom, "semiexpanded") == 0)
return 6;
else if(strcasecmp(prop.u.atom, "expanded") == 0)
return 7;
else if(strcasecmp(prop.u.atom, "extraexpanded") == 0)
return 8;
else if(strcasecmp(prop.u.atom, "ultraexpanded") == 0)
return 9;
else
return 5;
} else
return 5; /* for now */
}
int
faceItalicAngle(FT_Face face)
{
int rc;
BDF_PropertyRec prop;
rc = FT_Get_BDF_Property(face, "ITALIC_ANGLE", &prop);
if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_INTEGER) {
return (prop.u.integer - 64 * 90) * (TWO_SIXTEENTH / 64);
}
rc = FT_Get_BDF_Property(face, "SLANT", &prop);
if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM && prop.u.atom) {
if(strcasecmp(prop.u.atom, "i") == 0 ||
strcasecmp(prop.u.atom, "s") == 0)
return -30 * TWO_SIXTEENTH;
else
return 0;
} else
return 0; /* for now */
}
int
faceFlags(FT_Face face)
{
int flags = 0;
BDF_PropertyRec prop;
int rc;
if(faceWeight(face) >= 650)
flags |= FACE_BOLD;
rc = FT_Get_BDF_Property(face, "SLANT", &prop);
if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM && prop.u.atom) {
if(strcasecmp(prop.u.atom, "i") == 0 ||
strcasecmp(prop.u.atom, "s") == 0)
flags |= FACE_ITALIC;
}
return flags;
}
int
faceIntProp(FT_Face face, const char *name)
{
int rc;
BDF_PropertyRec prop;
rc = FT_Get_BDF_Property(face, name, &prop);
if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_INTEGER)
return prop.u.integer;
else
return UNDEF;
}
char *
faceStringProp(FT_Face face, const char *name)
{
int rc;
BDF_PropertyRec prop;
char *buf = NULL;
rc = FT_Get_BDF_Property(face, name, &prop);
if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM) {
buf = sprintf_alloc("%s", prop.u.atom ? prop.u.atom : "");
if(buf == NULL) {
perror("sprintf_alloc failed");
exit(1);
}
}
return buf;
}
char *
faceEncoding(FT_Face face)
{
BDF_PropertyRec p1, p2;
int rc;
rc = FT_Get_BDF_Property(face, "CHARSET_REGISTRY", &p1);
if(rc != 0 || p1.type != BDF_PROPERTY_TYPE_ATOM)
return NULL;
rc = FT_Get_BDF_Property(face, "CHARSET_ENCODING", &p2);
if(rc != 0 || p2.type != BDF_PROPERTY_TYPE_ATOM)
return NULL;
if(!(p1.u.atom && p2.u.atom))
return NULL;
return sprintf_alloc("%s-%s", p1.u.atom, p2.u.atom);
}
int
degreesToFraction(int deg, int *num, int *den)
{
double n, d;
double rad, val;
int i;
if(deg <= -(60 * TWO_SIXTEENTH) || deg >= (60 * TWO_SIXTEENTH))
goto fail;
rad = (((double)deg) / TWO_SIXTEENTH) / 180.0 * M_PI;
n = sin(-rad);
d = cos(rad);
if(d < 0.001)
goto fail;
val = atan2(n, d);
/* There must be a cleaner way */
for(i = 1; i < 10000; i++) {
if((int)(d * i) != 0.0 &&
fabs(atan2(ROUND(n * i), ROUND(d * i)) - val) < 0.05) {
*num = (int)ROUND(n * i);
*den = (int)ROUND(d * i);
return 0;
}
}
fail:
*den = 1;
*num = 0;
return -1;
}

1203
app/fonttosfnt/write.c Normal file

File diff suppressed because it is too large Load diff