aboutsummaryrefslogtreecommitdiff
path: root/libXfont
diff options
context:
space:
mode:
Diffstat (limited to 'libXfont')
-rw-r--r--libXfont/config.h29
-rw-r--r--libXfont/src/FreeType/ftenc.c2
-rw-r--r--libXfont/src/FreeType/ftfuncs.c4
-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.c1
-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/fontdir.c2
-rw-r--r--libXfont/src/fontfile/fontfile.c35
-rw-r--r--libXfont/src/fontfile/fontscale.c4
-rw-r--r--libXfont/src/fontfile/makefile26
-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
-rw-r--r--libXfont/src/util/miscutil.c2
23 files changed, 212 insertions, 11 deletions
diff --git a/libXfont/config.h b/libXfont/config.h
new file mode 100644
index 000000000..5f85c98d4
--- /dev/null
+++ b/libXfont/config.h
@@ -0,0 +1,29 @@
+/* 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
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/ftfuncs.c b/libXfont/src/FreeType/ftfuncs.c
index 47ebac737..655afa407 100644
--- a/libXfont/src/FreeType/ftfuncs.c
+++ b/libXfont/src/FreeType/ftfuncs.c
@@ -37,6 +37,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>
@@ -133,6 +134,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/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 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/bitscale.c b/libXfont/src/bitmap/bitscale.c
index a4d991d3b..1ef21c336 100644
--- a/libXfont/src/bitmap/bitscale.c
+++ b/libXfont/src/bitmap/bitscale.c
@@ -60,6 +60,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 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..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/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/fontscale.c b/libXfont/src/fontfile/fontscale.c
index 8002dde81..cdc43082f 100644
--- a/libXfont/src/fontfile/fontscale.c
+++ b/libXfont/src/fontfile/fontscale.c
@@ -37,6 +37,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..6468ff9b5
--- /dev/null
+++ b/libXfont/src/fontfile/makefile
@@ -0,0 +1,26 @@
+
+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 := ../.. $(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/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 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..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
diff --git a/libXfont/src/util/miscutil.c b/libXfont/src/util/miscutil.c
index 1e76b4b65..d87f9a0c1 100644
--- a/libXfont/src/util/miscutil.c
+++ b/libXfont/src/util/miscutil.c
@@ -48,8 +48,10 @@ from The Open Group.
extern void BuiltinRegisterFpeFunctions(void);
+#ifndef _MSC_VER
/* make sure everything initializes themselves at least once */
weak long serverGeneration = 1;
+#endif
weak void
register_fpe_functions (void)