aboutsummaryrefslogtreecommitdiff
path: root/libXfont
diff options
context:
space:
mode:
Diffstat (limited to 'libXfont')
-rw-r--r--libXfont/config.h31
-rw-r--r--libXfont/src/FreeType/ftenc.c2
-rw-r--r--libXfont/src/FreeType/ftfuncs.c4
-rw-r--r--libXfont/src/FreeType/fttools.c7
-rw-r--r--libXfont/src/FreeType/makefile15
-rw-r--r--libXfont/src/bitmap/bitmapfunc.c4
-rw-r--r--libXfont/src/bitmap/bitmaputil.c4
-rw-r--r--libXfont/src/bitmap/bitscale.c4
-rw-r--r--libXfont/src/bitmap/makefile16
-rw-r--r--libXfont/src/builtins/dir.c1
-rw-r--r--libXfont/src/builtins/makefile10
-rw-r--r--libXfont/src/fc/fsio.c2
-rw-r--r--libXfont/src/fc/fstrans.c1
-rw-r--r--libXfont/src/fc/makefile10
-rw-r--r--libXfont/src/fontfile/catalogue.c5
-rw-r--r--libXfont/src/fontfile/fontfile.c35
-rw-r--r--libXfont/src/fontfile/fontscale.c4
-rw-r--r--libXfont/src/fontfile/makefile24
-rw-r--r--libXfont/src/fontfile/renderers.c1
-rw-r--r--libXfont/src/stubs/makefile26
-rw-r--r--libXfont/src/util/fontxlfd.c4
-rw-r--r--libXfont/src/util/makefile17
22 files changed, 217 insertions, 10 deletions
diff --git a/libXfont/config.h b/libXfont/config.h
new file mode 100644
index 000000000..2f66903bc
--- /dev/null
+++ b/libXfont/config.h
@@ -0,0 +1,31 @@
+/* Support bdf format bitmap font files */
+#define XFONT_BDFFORMAT 1
+
+/* Support bitmap font files */
+#define XFONT_BITMAP 1
+
+/* Support built-in fonts */
+#define XFONT_BUILTINS 1
+
+/* Support the X Font Services Protocol */
+#define XFONT_FC 1
+
+/* Support fonts in files */
+#define XFONT_FONTFILE 1
+
+/* Support FreeType rasterizer for nearly all font file formats */
+#define XFONT_FREETYPE 1
+
+/* Support pcf format bitmap font files */
+#define XFONT_PCFFORMAT 1
+
+/* Support snf format bitmap font files */
+#define XFONT_SNFFORMAT 1
+
+/* Support bzip2 for bitmap fonts */
+#undef X_BZIP2_FONT_COMPRESSION
+
+/* Support gzip for bitmap fonts */
+#define X_GZIP_FONT_COMPRESSION 1
+
+#include <dix-config.h>
diff --git a/libXfont/src/FreeType/ftenc.c b/libXfont/src/FreeType/ftenc.c
index 9e31d7529..08e206c2a 100644
--- a/libXfont/src/FreeType/ftenc.c
+++ b/libXfont/src/FreeType/ftenc.c
@@ -31,7 +31,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/ftfuncs.c b/libXfont/src/FreeType/ftfuncs.c
index 918e3f37e..f14ca6f84 100644
--- a/libXfont/src/FreeType/ftfuncs.c
+++ b/libXfont/src/FreeType/ftfuncs.c
@@ -34,6 +34,7 @@ THE SOFTWARE.
#include <string.h>
#include <math.h>
#include <ctype.h>
+#include <unistd.h>
#include <X11/fonts/fntfilst.h>
#include <X11/fonts/fontutil.h>
@@ -130,6 +131,9 @@ sfnt_get_ushort( FT_Face face,
#define sfnt_get_short(f,t,o) ((FT_Short)sfnt_get_ushort((f),(t),(o)))
+#ifdef _MSC_VER
+#define hypot _hypot
+#endif
static int ftypeInitP = 0; /* is the engine initialised? */
FT_Library ftypeLibrary;
diff --git a/libXfont/src/FreeType/fttools.c b/libXfont/src/FreeType/fttools.c
index bc75b7e4f..a0e34d021 100644
--- a/libXfont/src/FreeType/fttools.c
+++ b/libXfont/src/FreeType/fttools.c
@@ -40,6 +40,13 @@
#define MSBFirst 1
#endif
+#ifdef LOBYTE
+#undef LOBYTE
+#endif
+#ifdef HIBYTE
+#undef HIBYTE
+#endif
+
#define LOBYTE(s,byte) ((byte)==LSBFirst?*(char*)(s):*((char*)(s)+1))
#define HIBYTE(s,byte) ((byte)==LSBFirst?*((char*)(s)+1):*(char*)(s))
diff --git a/libXfont/src/FreeType/makefile b/libXfont/src/FreeType/makefile
new file mode 100644
index 000000000..8d4fee2b6
--- /dev/null
+++ b/libXfont/src/FreeType/makefile
@@ -0,0 +1,15 @@
+LIBRARY = libft
+
+CSRCS = \
+ ftenc.c \
+ ftfuncs.c \
+ fttools.c \
+ xttcap.c
+
+INCLUDES += $(MHMAKECONF)\freetype\include\freetype $(MHMAKECONF)\freetype\include
+
+DEFINES += strcasecmp=_stricmp
+
+INCLUDES := ../.. $(INCLUDES)
+
+
diff --git a/libXfont/src/bitmap/bitmapfunc.c b/libXfont/src/bitmap/bitmapfunc.c
index 47ce488d0..653ff5d55 100644
--- a/libXfont/src/bitmap/bitmapfunc.c
+++ b/libXfont/src/bitmap/bitmapfunc.c
@@ -101,6 +101,7 @@ static BitmapFileFunctionsRec readers[] = {
{ bdfReadFont, bdfReadFontInfo} ,
# endif
#endif
+ { NULL, NULL }
};
@@ -229,9 +230,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 0a1c87e73..7ac94b3fb 100644
--- a/libXfont/src/bitmap/bitmaputil.c
+++ b/libXfont/src/bitmap/bitmaputil.c
@@ -34,13 +34,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/bitscale.c b/libXfont/src/bitmap/bitscale.c
index e89ba7ce0..130dffd86 100644
--- a/libXfont/src/bitmap/bitscale.c
+++ b/libXfont/src/bitmap/bitscale.c
@@ -59,6 +59,10 @@ from The Open Group.
#define MAX(a,b) (((a)>(b)) ? a : b)
#endif
+#ifdef _MSC_VER
+#define hypot _hypot
+#endif
+
/* Should get this from elsewhere */
extern unsigned long serverGeneration;
diff --git a/libXfont/src/bitmap/makefile b/libXfont/src/bitmap/makefile
new file mode 100644
index 000000000..f7ea10fdc
--- /dev/null
+++ b/libXfont/src/bitmap/makefile
@@ -0,0 +1,16 @@
+LIBRARY = libbitmap
+
+CSRCS = \
+ bdfread.c \
+ bdfutils.c \
+ bitmap.c \
+ bitmapfunc.c \
+ bitmaputil.c \
+ bitscale.c \
+ fontink.c \
+ pcfread.c \
+ pcfwrite.c \
+ snfread.c
+
+INCLUDES := ../.. $(INCLUDES)
+
diff --git a/libXfont/src/builtins/dir.c b/libXfont/src/builtins/dir.c
index bf351b147..cd50cef56 100644
--- a/libXfont/src/builtins/dir.c
+++ b/libXfont/src/builtins/dir.c
@@ -25,6 +25,7 @@
#include <config.h>
#endif
#include "builtin.h"
+#include <unistd.h>
static BuiltinDirPtr
BuiltinDirsDup (const BuiltinDirPtr a_dirs,
diff --git a/libXfont/src/builtins/makefile b/libXfont/src/builtins/makefile
new file mode 100644
index 000000000..dac4fcf8c
--- /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 := ../.. $(INCLUDES)
+
diff --git a/libXfont/src/fc/fsio.c b/libXfont/src/fc/fsio.c
index 03a689f6e..1c6a8cb6c 100644
--- a/libXfont/src/fc/fsio.c
+++ b/libXfont/src/fc/fsio.c
@@ -32,6 +32,7 @@
#ifdef WIN32
#define _WILLWINSOCK_
+#include "X11/Xwinsock.h"
#include "X11/Xwindows.h"
#endif
@@ -57,6 +58,7 @@
#endif
#include <errno.h>
#ifdef WIN32
+#undef EWOULDBLOCK
#define EWOULDBLOCK WSAEWOULDBLOCK
#undef EINTR
#define EINTR WSAEINTR
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..a4b105d26
--- /dev/null
+++ b/libXfont/src/fc/makefile
@@ -0,0 +1,10 @@
+
+INCLUDES := ../.. $(INCLUDES)
+
+LIBRARY = libfc
+
+CSRCS =\
+ fsconvert.c \
+ fserve.c \
+ fsio.c \
+ fstrans.c
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/fontfile.c b/libXfont/src/fontfile/fontfile.c
index eb37a8705..7372d3ece 100644
--- a/libXfont/src/fontfile/fontfile.c
+++ b/libXfont/src/fontfile/fontfile.c
@@ -36,6 +36,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)
@@ -49,7 +55,7 @@ ISOLatin1ToLower(unsigned char source)
return source;
}
-_X_HIDDEN void
+void
CopyISOLatin1Lowered(char *dest, char *source, int length)
{
int i;
@@ -71,6 +77,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
@@ -83,6 +115,7 @@ FontFileNameCheck (char *name)
#else
return ((strcmp(name, "built-ins") == 0) || (*name == '/'));
#endif
+#endif
}
int
diff --git a/libXfont/src/fontfile/fontscale.c b/libXfont/src/fontfile/fontscale.c
index 55aca298a..eb8d0bb58 100644
--- a/libXfont/src/fontfile/fontscale.c
+++ b/libXfont/src/fontfile/fontscale.c
@@ -34,6 +34,10 @@ in this Software without prior written authorization from The Open Group.
#include <X11/fonts/fntfilst.h>
#include <math.h>
+#ifdef _MSC_VER
+#define hypot _hypot
+#endif
+
Bool
FontFileAddScaledInstance (FontEntryPtr entry, FontScalablePtr vals,
FontPtr pFont, char *bitmapName)
diff --git a/libXfont/src/fontfile/makefile b/libXfont/src/fontfile/makefile
new file mode 100644
index 000000000..619cdbdbb
--- /dev/null
+++ b/libXfont/src/fontfile/makefile
@@ -0,0 +1,24 @@
+
+LIBRARY = libfontfile
+
+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 := ../.. $(INCLUDES)
+
+
diff --git a/libXfont/src/fontfile/renderers.c b/libXfont/src/fontfile/renderers.c
index a9e4bef53..e17d6a77e 100644
--- a/libXfont/src/fontfile/renderers.c
+++ b/libXfont/src/fontfile/renderers.c
@@ -32,6 +32,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/stubs/makefile b/libXfont/src/stubs/makefile
new file mode 100644
index 000000000..e028dd5db
--- /dev/null
+++ b/libXfont/src/stubs/makefile
@@ -0,0 +1,26 @@
+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 := ../.. $(INCLUDES)
+
+
diff --git a/libXfont/src/util/fontxlfd.c b/libXfont/src/util/fontxlfd.c
index 974128ee3..ace87809b 100644
--- a/libXfont/src/util/fontxlfd.c
+++ b/libXfont/src/util/fontxlfd.c
@@ -33,6 +33,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>
@@ -194,7 +195,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... */
@@ -234,7 +234,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..53b5560a3
--- /dev/null
+++ b/libXfont/src/util/makefile
@@ -0,0 +1,17 @@
+LIBRARY = libutil
+
+INCLUDES += ../stubs
+
+INCLUDES := ../.. $(INCLUDES)
+
+CSRCS = \
+ atom.c \
+ fontaccel.c \
+ fontnames.c \
+ fontutil.c \
+ fontxlfd.c \
+ format.c \
+ miscutil.c \
+ patcache.c \
+ private.c \
+ utilbitmap.c