Kaydet (Commit) c4beee99 authored tarafından Tor Lillqvist's avatar Tor Lillqvist Kaydeden (comit) Andras Timar

No NO_MAPPERS, NO_TYPE3, NO_TYPE42 or NO_TTCR anywhere

Change-Id: Icab5608900108c89e649e78a2e35d02e941d0ac0
Signed-off-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst 001ba1b8
...@@ -23,16 +23,6 @@ ...@@ -23,16 +23,6 @@
* @author Alexander Gelfenbain * @author Alexander Gelfenbain
*/ */
/*
* If NO_MAPPERS is defined, MapChar() and MapString() and consequently GetTTSimpleCharMetrics()
* don't get compiled in. This is done to avoid including a large chunk of code (TranslateXY() from
* xlat.c in the projects that don't require it.
*
* If NO_TYPE3 is defined CreateT3FromTTGlyphs() does not get compiled in.
* If NO_TYPE42 is defined Type42-related code is excluded
* If NO_TTCR is defined TrueType creation related code is excluded\
*/
/* /*
* Generated fonts contain an XUID entry in the form of: * Generated fonts contain an XUID entry in the form of:
* *
...@@ -140,7 +130,6 @@ namespace vcl ...@@ -140,7 +130,6 @@ namespace vcl
OVERLAP_COMPOUND = 1<<10 OVERLAP_COMPOUND = 1<<10
}; };
#ifndef NO_TTCR
/** Flags for TrueType generation */ /** Flags for TrueType generation */
enum TTCreationFlags { enum TTCreationFlags {
TTCF_AutoName = 1, /**< Automatically generate a compact 'name' table. TTCF_AutoName = 1, /**< Automatically generate a compact 'name' table.
...@@ -156,7 +145,6 @@ namespace vcl ...@@ -156,7 +145,6 @@ namespace vcl
TTCF_IncludeOS2 = 2 /** If this flag is set OS/2 table from the original font will be TTCF_IncludeOS2 = 2 /** If this flag is set OS/2 table from the original font will be
copied to the subset */ copied to the subset */
}; };
#endif
/** Structure used by GetTTSimpleGlyphMetrics() and GetTTSimpleCharMetrics() functions */ /** Structure used by GetTTSimpleGlyphMetrics() and GetTTSimpleCharMetrics() functions */
typedef struct { typedef struct {
...@@ -364,7 +352,6 @@ namespace vcl ...@@ -364,7 +352,6 @@ namespace vcl
*/ */
void DisposeNameRecords(NameRecord* nr, int n); void DisposeNameRecords(NameRecord* nr, int n);
#ifndef NO_TYPE3
/** /**
* Generates a new PostScript Type 3 font and dumps it to <b>outf</b> file. * Generates a new PostScript Type 3 font and dumps it to <b>outf</b> file.
* This function substitutes glyph 0 for all glyphIDs that are not found in the font. * This function substitutes glyph 0 for all glyphIDs that are not found in the font.
...@@ -383,9 +370,7 @@ namespace vcl ...@@ -383,9 +370,7 @@ namespace vcl
* *
*/ */
int CreateT3FromTTGlyphs(TrueTypeFont *ttf, FILE *outf, const char *fname, sal_uInt16 *glyphArray, sal_uInt8 *encoding, int nGlyphs, int wmode); int CreateT3FromTTGlyphs(TrueTypeFont *ttf, FILE *outf, const char *fname, sal_uInt16 *glyphArray, sal_uInt8 *encoding, int nGlyphs, int wmode);
#endif
#ifndef NO_TTCR
/** /**
* Generates a new TrueType font and dumps it to <b>outf</b> file. * Generates a new TrueType font and dumps it to <b>outf</b> file.
* This function substitutes glyph 0 for all glyphIDs that are not found in the font. * This function substitutes glyph 0 for all glyphIDs that are not found in the font.
...@@ -414,9 +399,7 @@ namespace vcl ...@@ -414,9 +399,7 @@ namespace vcl
int nNameRecs, int nNameRecs,
NameRecord *nr, NameRecord *nr,
sal_uInt32 flags); sal_uInt32 flags);
#endif
#ifndef NO_TYPE42
/** /**
* Generates a new PostScript Type42 font and dumps it to <b>outf</b> file. * Generates a new PostScript Type42 font and dumps it to <b>outf</b> file.
* This function substitutes glyph 0 for all glyphIDs that are not found in the font. * This function substitutes glyph 0 for all glyphIDs that are not found in the font.
...@@ -443,7 +426,6 @@ namespace vcl ...@@ -443,7 +426,6 @@ namespace vcl
sal_uInt16 *glyphArray, sal_uInt16 *glyphArray,
sal_uInt8 *encoding, sal_uInt8 *encoding,
int nGlyphs); int nGlyphs);
#endif
/** /**
* Queries glyph metrics. Allocates an array of TTSimpleGlyphMetrics structs and returns it. * Queries glyph metrics. Allocates an array of TTSimpleGlyphMetrics structs and returns it.
...@@ -457,7 +439,6 @@ namespace vcl ...@@ -457,7 +439,6 @@ namespace vcl
*/ */
TTSimpleGlyphMetrics *GetTTSimpleGlyphMetrics(TrueTypeFont *ttf, sal_uInt16 *glyphArray, int nGlyphs, bool vertical); TTSimpleGlyphMetrics *GetTTSimpleGlyphMetrics(TrueTypeFont *ttf, sal_uInt16 *glyphArray, int nGlyphs, bool vertical);
#ifndef NO_MAPPERS
/** /**
* Queries glyph metrics. Allocates an array of TTSimpleGlyphMetrics structs and returns it. * Queries glyph metrics. Allocates an array of TTSimpleGlyphMetrics structs and returns it.
* This function behaves just like GetTTSimpleGlyphMetrics() but it takes a range of Unicode * This function behaves just like GetTTSimpleGlyphMetrics() but it takes a range of Unicode
...@@ -512,8 +493,6 @@ namespace vcl ...@@ -512,8 +493,6 @@ namespace vcl
*/ */
int DoesVerticalSubstitution( TrueTypeFont *ttf, int bvertical); int DoesVerticalSubstitution( TrueTypeFont *ttf, int bvertical);
#endif
/** /**
* Returns global font information about the TrueType font. * Returns global font information about the TrueType font.
* @see TTGlobalFontInfo * @see TTGlobalFontInfo
......
...@@ -35,15 +35,9 @@ ...@@ -35,15 +35,9 @@
#endif #endif
#include "sft.hxx" #include "sft.hxx"
#include "gsub.h" #include "gsub.h"
#if ! (defined(NO_TTCR) && defined(NO_TYPE42))
#include "ttcr.hxx" #include "ttcr.hxx"
#endif
#ifndef NO_MAPPERS /* include MapChar() and MapString() */
#include "xlat.hxx" #include "xlat.hxx"
#endif
#ifndef NO_TYPE3 /* include CreateT3FromTTGlyphs() */
#include <rtl/crc.h> #include <rtl/crc.h>
#endif
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
#include <osl/endian.h> #include <osl/endian.h>
...@@ -308,7 +302,6 @@ _inline sal_uInt32 getTableSize(TrueTypeFont *ttf, sal_uInt32 ord) ...@@ -308,7 +302,6 @@ _inline sal_uInt32 getTableSize(TrueTypeFont *ttf, sal_uInt32 ord)
return ttf->tlens[ord]; return ttf->tlens[ord];
} }
#ifndef NO_TYPE42
/* Hex Formatter functions */ /* Hex Formatter functions */
static const char HexChars[] = "0123456789ABCDEF"; static const char HexChars[] = "0123456789ABCDEF";
...@@ -371,7 +364,6 @@ static void HexFmtBlockWrite(HexFmt *_this, const void *ptr, sal_uInt32 size) ...@@ -371,7 +364,6 @@ static void HexFmtBlockWrite(HexFmt *_this, const void *ptr, sal_uInt32 size)
} }
_this->total += size; _this->total += size;
} }
#endif
/* Outline Extraction functions */ /* Outline Extraction functions */
...@@ -724,8 +716,6 @@ static int GetTTGlyphOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPoint ...@@ -724,8 +716,6 @@ static int GetTTGlyphOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPoint
return res; return res;
} }
#ifndef NO_TYPE3
/*- returns the number of items in the path -*/ /*- returns the number of items in the path -*/
static int BSplineToPSPath(ControlPoint *srcA, int srcCount, PSPathElement **path) static int BSplineToPSPath(ControlPoint *srcA, int srcCount, PSPathElement **path)
...@@ -854,8 +844,6 @@ static int BSplineToPSPath(ControlPoint *srcA, int srcCount, PSPathElement **pat ...@@ -854,8 +844,6 @@ static int BSplineToPSPath(ControlPoint *srcA, int srcCount, PSPathElement **pat
return nPathCount; return nPathCount;
} }
#endif
/*- Extracts a string from the name table and allocates memory for it -*/ /*- Extracts a string from the name table and allocates memory for it -*/
static char *nameExtract( const sal_uInt8* name, int nTableSize, int n, int dbFlag, sal_uInt16** ucs2result ) static char *nameExtract( const sal_uInt8* name, int nTableSize, int n, int dbFlag, sal_uInt16** ucs2result )
...@@ -1814,7 +1802,6 @@ int GetTTGlyphComponents(TrueTypeFont *ttf, sal_uInt32 glyphID, std::vector< sal ...@@ -1814,7 +1802,6 @@ int GetTTGlyphComponents(TrueTypeFont *ttf, sal_uInt32 glyphID, std::vector< sal
return n; return n;
} }
#ifndef NO_TYPE3
int CreateT3FromTTGlyphs(TrueTypeFont *ttf, FILE *outf, const char *fname, int CreateT3FromTTGlyphs(TrueTypeFont *ttf, FILE *outf, const char *fname,
sal_uInt16 *glyphArray, sal_uInt8 *encoding, int nGlyphs, sal_uInt16 *glyphArray, sal_uInt8 *encoding, int nGlyphs,
int wmode) int wmode)
...@@ -1966,9 +1953,7 @@ int CreateT3FromTTGlyphs(TrueTypeFont *ttf, FILE *outf, const char *fname, ...@@ -1966,9 +1953,7 @@ int CreateT3FromTTGlyphs(TrueTypeFont *ttf, FILE *outf, const char *fname,
return SF_OK; return SF_OK;
} }
#endif
#ifndef NO_TTCR
int CreateTTFromTTGlyphs(TrueTypeFont *ttf, int CreateTTFromTTGlyphs(TrueTypeFont *ttf,
const char *fname, const char *fname,
sal_uInt16 *glyphArray, sal_uInt16 *glyphArray,
...@@ -2112,9 +2097,7 @@ int CreateTTFromTTGlyphs(TrueTypeFont *ttf, ...@@ -2112,9 +2097,7 @@ int CreateTTFromTTGlyphs(TrueTypeFont *ttf,
return res; return res;
} }
#endif
#ifndef NO_TYPE42
static GlyphOffsets *GlyphOffsetsNew(sal_uInt8 *sfntP, sal_uInt32 sfntLen) static GlyphOffsets *GlyphOffsetsNew(sal_uInt8 *sfntP, sal_uInt32 sfntLen)
{ {
GlyphOffsets* res = static_cast<GlyphOffsets*>(smalloc(sizeof(GlyphOffsets))); GlyphOffsets* res = static_cast<GlyphOffsets*>(smalloc(sizeof(GlyphOffsets)));
...@@ -2372,9 +2355,7 @@ int CreateT42FromTTGlyphs(TrueTypeFont *ttf, ...@@ -2372,9 +2355,7 @@ int CreateT42FromTTGlyphs(TrueTypeFont *ttf,
free(sfntP); free(sfntP);
return SF_OK; return SF_OK;
} }
#endif
#ifndef NO_MAPPERS
int MapString(TrueTypeFont *ttf, sal_uInt16 *str, int nchars, sal_uInt16 *glyphArray, bool bvertical) int MapString(TrueTypeFont *ttf, sal_uInt16 *str, int nchars, sal_uInt16 *glyphArray, bool bvertical)
{ {
int i; int i;
...@@ -2460,8 +2441,6 @@ int DoesVerticalSubstitution( TrueTypeFont *ttf, int bvertical) ...@@ -2460,8 +2441,6 @@ int DoesVerticalSubstitution( TrueTypeFont *ttf, int bvertical)
return nRet; return nRet;
} }
#endif
int GetTTGlyphCount( TrueTypeFont* ttf ) int GetTTGlyphCount( TrueTypeFont* ttf )
{ {
return ttf->nglyphs; return ttf->nglyphs;
...@@ -2532,7 +2511,6 @@ TTSimpleGlyphMetrics *GetTTSimpleGlyphMetrics(TrueTypeFont *ttf, sal_uInt16 *gly ...@@ -2532,7 +2511,6 @@ TTSimpleGlyphMetrics *GetTTSimpleGlyphMetrics(TrueTypeFont *ttf, sal_uInt16 *gly
return res; return res;
} }
#ifndef NO_MAPPERS
TTSimpleGlyphMetrics *GetTTSimpleCharMetrics(TrueTypeFont * ttf, sal_uInt16 firstChar, int nChars, bool vertical) TTSimpleGlyphMetrics *GetTTSimpleCharMetrics(TrueTypeFont * ttf, sal_uInt16 firstChar, int nChars, bool vertical)
{ {
TTSimpleGlyphMetrics *res = 0; TTSimpleGlyphMetrics *res = 0;
...@@ -2550,7 +2528,6 @@ TTSimpleGlyphMetrics *GetTTSimpleCharMetrics(TrueTypeFont * ttf, sal_uInt16 firs ...@@ -2550,7 +2528,6 @@ TTSimpleGlyphMetrics *GetTTSimpleCharMetrics(TrueTypeFont * ttf, sal_uInt16 firs
return res; return res;
} }
#endif
void GetTTGlobalFontInfo(TrueTypeFont *ttf, TTGlobalFontInfo *info) void GetTTGlobalFontInfo(TrueTypeFont *ttf, TTGlobalFontInfo *info)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment