aboutsummaryrefslogtreecommitdiff
path: root/libXfont
diff options
context:
space:
mode:
Diffstat (limited to 'libXfont')
-rw-r--r--libXfont/src/FreeType/ftenc.c2
-rw-r--r--libXfont/src/FreeType/makefile14
-rw-r--r--libXfont/src/bitmap/bitmapfunc.c4
-rw-r--r--libXfont/src/bitmap/bitmaputil.c4
-rw-r--r--libXfont/src/bitmap/makefile20
-rw-r--r--libXfont/src/builtins/makefile10
-rw-r--r--libXfont/src/fc/fsio.c1
-rw-r--r--libXfont/src/fc/fstrans.c1
-rw-r--r--libXfont/src/fc/makefile9
-rw-r--r--libXfont/src/fontfile/catalogue.c5
-rw-r--r--libXfont/src/fontfile/fontdir.c2
-rw-r--r--libXfont/src/fontfile/fontfile.c35
-rw-r--r--libXfont/src/fontfile/makefile25
-rw-r--r--libXfont/src/fontfile/renderers.c1
-rw-r--r--libXfont/src/makefile66
-rw-r--r--libXfont/src/stubs/makefile25
-rw-r--r--libXfont/src/util/fontxlfd.c4
-rw-r--r--libXfont/src/util/makefile10
18 files changed, 227 insertions, 11 deletions
diff --git a/libXfont/src/FreeType/ftenc.c b/libXfont/src/FreeType/ftenc.c
index 27964b003..d8529d47f 100644
--- a/libXfont/src/FreeType/ftenc.c
+++ b/libXfont/src/FreeType/ftenc.c
@@ -32,7 +32,7 @@ THE SOFTWARE.
#include <X11/fonts/fontmisc.h>
#include <X11/fonts/fontenc.h>
-#include <ft2build.h>
+#include <config/ftheader.h>
#include FT_FREETYPE_H
#include FT_TRUETYPE_IDS_H
#include FT_TRUETYPE_TABLES_H
diff --git a/libXfont/src/FreeType/makefile b/libXfont/src/FreeType/makefile
new file mode 100644
index 000000000..a1f05a560
--- /dev/null
+++ b/libXfont/src/FreeType/makefile
@@ -0,0 +1,14 @@
+LIBRARY = libft
+
+CSRCS = \
+ ftenc.c \
+ ftfuncs.c \
+ fttools.c \
+ xttcap.c
+
+INCLUDES += $(MHMAKECONF)\freetype\include\freetype $(MHMAKECONF)\freetype\include
+
+DEFINES += strcasecmp=_stricmp
+
+INCLUDES := ../../../../build $(INCLUDES)
+
diff --git a/libXfont/src/bitmap/bitmapfunc.c b/libXfont/src/bitmap/bitmapfunc.c
index 80d7da19d..a171d8436 100644
--- a/libXfont/src/bitmap/bitmapfunc.c
+++ b/libXfont/src/bitmap/bitmapfunc.c
@@ -105,6 +105,7 @@ static BitmapFileFunctionsRec readers[] = {
{ bdfReadFont, bdfReadFontInfo} ,
# endif
#endif
+ { NULL, NULL }
};
@@ -233,9 +234,10 @@ static FontRendererRec renderers[] = {
CAPABILITIES },
# endif
#endif
+ { NULL, 0, NULL, 0, NULL, NULL, 0, 0 }
};
-#define numRenderers (sizeof renderers / sizeof renderers[0])
+#define numRenderers (sizeof renderers / sizeof renderers[0] - 1)
void
BitmapRegisterFontFileFunctions (void)
diff --git a/libXfont/src/bitmap/bitmaputil.c b/libXfont/src/bitmap/bitmaputil.c
index 3a7bbc7a0..545a547c2 100644
--- a/libXfont/src/bitmap/bitmaputil.c
+++ b/libXfont/src/bitmap/bitmaputil.c
@@ -37,13 +37,9 @@ from The Open Group.
#include <X11/fonts/bitmap.h>
#include <X11/fonts/bdfint.h>
-#ifndef MAXSHORT
#define MAXSHORT 32767
-#endif
-#ifndef MINSHORT
#define MINSHORT -32768
-#endif
static xCharInfo initMinMetrics = {
MAXSHORT, MAXSHORT, MAXSHORT, MAXSHORT, MAXSHORT, 0xFFFF};
diff --git a/libXfont/src/bitmap/makefile b/libXfont/src/bitmap/makefile
new file mode 100644
index 000000000..9faa86a30
--- /dev/null
+++ b/libXfont/src/bitmap/makefile
@@ -0,0 +1,20 @@
+LIBRARY = libbitmap
+
+CSRCS = \
+ bdfread.c \
+ bdfutils.c \
+ bitmap.c \
+ bitmapfunc.c \
+ bitmaputil.c \
+ bitscale.c \
+ fontink.c \
+ pcfread.c \
+ pcfwrite.c \
+ snfread.c
+
+#DEFINES += XFONT_PCFFORMAT XFONT_SNFFORMAT XFONT_BDFFORMAT X_GZIP_FONT_COMPRESSION
+
+INCLUDES := ../../../../build $(INCLUDES)
+
+#INCLUDE=$(INCLUDE);..\..\include\X11;..\..\src\xlibi18n;..\..\src
+
diff --git a/libXfont/src/builtins/makefile b/libXfont/src/builtins/makefile
new file mode 100644
index 000000000..bde6d880f
--- /dev/null
+++ b/libXfont/src/builtins/makefile
@@ -0,0 +1,10 @@
+LIBRARY = libbuiltins
+
+CSRCS = dir.c \
+ file.c \
+ fonts.c \
+ fpe.c \
+ render.c
+
+INCLUDES := ../../../../build $(INCLUDES)
+
diff --git a/libXfont/src/fc/fsio.c b/libXfont/src/fc/fsio.c
index 79dc0d695..438418c72 100644
--- a/libXfont/src/fc/fsio.c
+++ b/libXfont/src/fc/fsio.c
@@ -34,6 +34,7 @@
#ifdef WIN32
#define _WILLWINSOCK_
+#include "X11/Xwinsock.h"
#include "X11/Xwindows.h"
#endif
diff --git a/libXfont/src/fc/fstrans.c b/libXfont/src/fc/fstrans.c
index c334c2504..74a884e63 100644
--- a/libXfont/src/fc/fstrans.c
+++ b/libXfont/src/fc/fstrans.c
@@ -22,6 +22,7 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
+#include <dix-config.h>
#endif
#define FONT_t
#define TRANS_CLIENT
diff --git a/libXfont/src/fc/makefile b/libXfont/src/fc/makefile
new file mode 100644
index 000000000..51b78369c
--- /dev/null
+++ b/libXfont/src/fc/makefile
@@ -0,0 +1,9 @@
+LIBRARY = libfc
+
+CSRCS = fsconvert.c \
+ fserve.c \
+ fsio.c \
+ fstrans.c
+
+INCLUDES := ../../../../build $(INCLUDES)
+
diff --git a/libXfont/src/fontfile/catalogue.c b/libXfont/src/fontfile/catalogue.c
index 3a04a754d..5ce8a0799 100644
--- a/libXfont/src/fontfile/catalogue.c
+++ b/libXfont/src/fontfile/catalogue.c
@@ -27,6 +27,7 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
+#include <X11/Xwindows.h>
#include <X11/fonts/fntfilst.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -140,7 +141,7 @@ CatalogueRescan (FontPathElementPtr fpe, Bool forceScan)
int pathlen;
path = fpe->name + strlen(CataloguePrefix);
- if (stat(path, &statbuf) < 0 || !S_ISDIR(statbuf.st_mode))
+ if (stat(path, &statbuf) < 0 || (statbuf.st_mode&_S_IFDIR))
return BadFontPath;
if ((forceScan == FALSE) && (statbuf.st_mtime <= cat->mtime))
@@ -154,6 +155,7 @@ CatalogueRescan (FontPathElementPtr fpe, Bool forceScan)
}
CatalogueUnrefFPEs (fpe);
+ #ifndef _MSC_VER
while (entry = readdir(dir), entry != NULL)
{
snprintf(link, sizeof link, "%s/%s", path, entry->d_name);
@@ -218,6 +220,7 @@ CatalogueRescan (FontPathElementPtr fpe, Bool forceScan)
continue;
}
}
+ #endif
closedir(dir);
diff --git a/libXfont/src/fontfile/fontdir.c b/libXfont/src/fontfile/fontdir.c
index 70f1b0f44..b820c50b2 100644
--- a/libXfont/src/fontfile/fontdir.c
+++ b/libXfont/src/fontfile/fontdir.c
@@ -347,7 +347,7 @@ SetupWildMatch(FontTablePtr table, FontNamePtr pat,
result = strcmpn(name, table->entries[center].name.name);
if (result == 0)
return center;
- if (result < 0)
+ if (result < 0)
right = center;
else
left = center + 1;
diff --git a/libXfont/src/fontfile/fontfile.c b/libXfont/src/fontfile/fontfile.c
index a738c4d34..b56d76a9c 100644
--- a/libXfont/src/fontfile/fontfile.c
+++ b/libXfont/src/fontfile/fontfile.c
@@ -41,6 +41,12 @@ in this Software without prior written authorization from The Open Group.
#ifdef WIN32
#include <ctype.h>
#endif
+#ifdef _MSC_VER
+#define BOOL W32BOOL
+#include <windows.h>
+#undef _X_HIDDEN
+#define _X_HIDDEN static
+#endif
static unsigned char
ISOLatin1ToLower(unsigned char source)
@@ -54,7 +60,7 @@ ISOLatin1ToLower(unsigned char source)
return source;
}
-_X_HIDDEN void
+void
CopyISOLatin1Lowered(char *dest, char *source, int length)
{
int i;
@@ -76,6 +82,32 @@ static int FontFileOpenBitmapNCF (FontPathElementPtr fpe, FontPtr *pFont,
int
FontFileNameCheck (char *name)
{
+#ifdef _MSC_VER
+ WIN32_FIND_DATA FindData;
+ HANDLE hFind;
+ char Tmp;
+ int LenName=strlen(name)-1;
+ Tmp=name[LenName];
+ if (Tmp=='/')
+ name[LenName]=0;
+ hFind=FindFirstFile(name,&FindData);
+ name[LenName]=Tmp;
+
+ if (hFind==INVALID_HANDLE_VALUE)
+ {
+ return 0;
+ }
+ else
+ {
+ FindClose(hFind);
+ if (FindData.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
+ {
+ return 1;
+ }
+ return 0;
+ }
+
+#else
#ifndef NCD
#if defined(WIN32)
/* OS/2 uses D:/... as a path name for fonts, so accept this as a valid
@@ -88,6 +120,7 @@ FontFileNameCheck (char *name)
#else
return ((strcmp(name, "built-ins") == 0) || (*name == '/'));
#endif
+#endif
}
int
diff --git a/libXfont/src/fontfile/makefile b/libXfont/src/fontfile/makefile
new file mode 100644
index 000000000..12e289d30
--- /dev/null
+++ b/libXfont/src/fontfile/makefile
@@ -0,0 +1,25 @@
+
+LIBRARY = libfontfile
+
+INCLUDES += $(MHMAKECONF)\zlib\src\zlib-1.2.3
+
+DEFINES += X_GZIP_FONT_COMPRESSION
+
+CSRCS = bitsource.c \
+ bufio.c \
+ decompress.c \
+ defaults.c \
+ dirfile.c \
+ fileio.c \
+ filewr.c \
+ fontdir.c \
+ fontencc.c \
+ fontfile.c \
+ fontscale.c \
+ gunzip.c \
+ register.c \
+ renderers.c \
+ catalogue.c
+
+INCLUDES := ../../../../build $(INCLUDES)
+
diff --git a/libXfont/src/fontfile/renderers.c b/libXfont/src/fontfile/renderers.c
index bf82c1c1e..f75faea0a 100644
--- a/libXfont/src/fontfile/renderers.c
+++ b/libXfont/src/fontfile/renderers.c
@@ -33,6 +33,7 @@ in this Software without prior written authorization from The Open Group.
#include <config.h>
#endif
#include <X11/fonts/fntfilst.h>
+#include <unistd.h>
extern void ErrorF(const char *f, ...);
static FontRenderersRec renderers;
diff --git a/libXfont/src/makefile b/libXfont/src/makefile
new file mode 100644
index 000000000..3bc7fb3e7
--- /dev/null
+++ b/libXfont/src/makefile
@@ -0,0 +1,66 @@
+#
+# Copyright © 2003 Keith Packard, Noah Levitt
+#
+# 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 Keith Packard not be used in
+# advertising or publicity pertaining to distribution of the software without
+# specific, written prior permission. Keith Packard makes no
+# representations about the suitability of this software for any purpose. It
+# is provided "as is" without express or implied warranty.
+#
+# KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+# EVENT SHALL KEITH PACKARD 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.
+
+lib_LTLIBRARIES = libXfont.la
+
+if XFONT_FONTFILE
+FONTFILE_DIR = fontfile
+FONTFILE_LIB = fontfile/libfontfile.la
+endif
+
+if XFONT_FREETYPE
+FREETYPE_DIR = FreeType
+FREETYPE_LIB = FreeType/libft.la
+endif
+
+if XFONT_BITMAP
+BITMAP_DIR = bitmap
+BITMAP_LIB = bitmap/libbitmap.la
+endif
+
+if XFONT_BUILTINS
+BUILTINS_DIR = builtins
+BUILTINS_LIB = builtins/libbuiltins.la
+endif
+
+if XFONT_FC
+FC_DIR = fc
+FC_LIB = fc/libfc.la
+endif
+
+UTIL_DIR = util
+UTIL_LIB = util/libutil.la
+
+STUBS_LIB = stubs/libstubs.la
+STUBS_DIR = stubs
+
+SUBDIRS=\
+ $(FONTFILE_DIR) $(FREETYPE_DIR) $(BITMAP_DIR) \
+ $(BUILTINS_DIR) $(FC_DIR) $(UTIL_DIR) $(STUBS_DIR)
+
+libXfont_la_LIBADD = \
+ $(FONTFILE_LIB) $(FREETYPE_LIB) $(BITMAP_LIB) \
+ $(BUILTINS_LIB) $(FC_LIB) $(UTIL_LIB) $(STUBS_LIB) \
+ $(FREETYPE_LIBS) $(Z_LIBS) $(MATH_LIBS) $(XFONT_LIBS)
+
+libXfont_la_SOURCES = dummy.c
+
+libXfont_la_LDFLAGS = -version-number 1:4:1 -no-undefined
diff --git a/libXfont/src/stubs/makefile b/libXfont/src/stubs/makefile
new file mode 100644
index 000000000..64e4a33b9
--- /dev/null
+++ b/libXfont/src/stubs/makefile
@@ -0,0 +1,25 @@
+LIBRARY = libstubs
+
+CSRCS = \
+ cauthgen.c \
+ csignal.c \
+ delfntcid.c \
+ errorf.c \
+ fatalerror.c \
+ findoldfnt.c \
+ getcres.c \
+ getdefptsize.c \
+ getnewfntcid.c \
+ gettime.c \
+ initfshdl.c \
+ regfpefunc.c \
+ rmfshdl.c \
+ servclient.c \
+ setfntauth.c \
+ stfntcfnt.c \
+ stubs.h
+
+CSRCS:=$(filter-out %.h,$(CSRCS))
+
+INCLUDES := ../../../../build $(INCLUDES)
+
diff --git a/libXfont/src/util/fontxlfd.c b/libXfont/src/util/fontxlfd.c
index 462554006..664d7598f 100644
--- a/libXfont/src/util/fontxlfd.c
+++ b/libXfont/src/util/fontxlfd.c
@@ -36,6 +36,7 @@ from The Open Group.
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
+#include <float.h>
#include <X11/fonts/fontmisc.h>
#include <X11/fonts/fontstruct.h>
#include <X11/fonts/fontxlfd.h>
@@ -202,7 +203,6 @@ xlfd_round_double(double x)
defined(__hppa__) || \
defined(__amd64__) || defined(__amd64) || \
defined(sgi)
-#include <float.h>
/* if we have IEEE 754 fp, we can round to binary digits... */
@@ -242,7 +242,7 @@ xlfd_round_double(double x)
j = 1 << ((DBL_MANT_DIG-XLFD_NDIGITS_2) & 0x07);
for (; i<7; i++) {
k = d.b[i] + j;
- d.b[i] = k;
+ d.b[i] = k&0xff;
if (k & 0x100) j = 1;
else break;
}
diff --git a/libXfont/src/util/makefile b/libXfont/src/util/makefile
new file mode 100644
index 000000000..69cbeac95
--- /dev/null
+++ b/libXfont/src/util/makefile
@@ -0,0 +1,10 @@
+LIBRARY = libutil
+
+INCLUDES += ../stubs
+
+CSRCS = atom.c fontaccel.c fontnames.c fontutil.c fontxlfd.c format.c miscutil.c \
+ patcache.c private.c utilbitmap.c
+
+INCLUDES := ../../../../build $(INCLUDES)
+
+