LibreOffice Module vcl (master) 1
Namespaces | Functions | Variables
sft.cxx File Reference
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sft.hxx>
#include <impfontcharmap.hxx>
#include <tools/fix16.hxx>
#include "ttcr.hxx"
#include "xlat.hxx"
#include <rtl/crc.h>
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
#include <sal/log.hxx>
#include <o3tl/safeint.hxx>
#include <osl/endian.h>
#include <osl/thread.h>
#include <unotools/tempfile.hxx>
#include <fontsubset.hxx>
#include <algorithm>
#include <memory>
Include dependency graph for sft.cxx:

Go to the source code of this file.

Namespaces

namespace  vcl
 

Functions

static sal_Int16 vcl::GetInt16 (const sal_uInt8 *ptr, size_t offset)
 
static sal_uInt16 vcl::GetUInt16 (const sal_uInt8 *ptr, size_t offset)
 
static sal_Int32 vcl::GetInt32 (const sal_uInt8 *ptr, size_t offset)
 
static sal_uInt32 vcl::GetUInt32 (const sal_uInt8 *ptr, size_t offset)
 
static F16Dot16 vcl::fixedMul (F16Dot16 a, F16Dot16 b)
 
static F16Dot16 vcl::fixedDiv (F16Dot16 a, F16Dot16 b)
 
static F16Dot16 vcl::fixedMulDiv (F16Dot16 a, F16Dot16 b, F16Dot16 c)
 
static int vcl::XUnits (int unitsPerEm, int n)
 
static char vcl::toHex (sal_uInt8 nIndex)
 
static void vcl::GetMetrics (AbstractTrueTypeFont const *ttf, sal_uInt32 glyphID, TTGlyphMetrics *metrics)
 
static int vcl::GetTTGlyphOutline (AbstractTrueTypeFont *, sal_uInt32, std::vector< ControlPoint > &, TTGlyphMetrics *, std::vector< sal_uInt32 > *)
 
static int vcl::GetSimpleTTOutline (AbstractTrueTypeFont const *ttf, sal_uInt32 glyphID, std::vector< ControlPoint > &pointArray, TTGlyphMetrics *metrics)
 
static F16Dot16 vcl::fromF2Dot14 (sal_Int16 n)
 
static int vcl::GetCompoundTTOutline (AbstractTrueTypeFont *ttf, sal_uInt32 glyphID, std::vector< ControlPoint > &pointArray, TTGlyphMetrics *metrics, std::vector< sal_uInt32 > &glyphlist)
 
static int vcl::BSplineToPSPath (ControlPoint const *srcA, int srcCount, std::unique_ptr< PSPathElement[]> &path)
 
static OString vcl::nameExtract (const sal_uInt8 *name, int nTableSize, int n, int dbFlag, OUString *ucs2result)
 
static int vcl::findname (const sal_uInt8 *name, sal_uInt16 n, sal_uInt16 platformID, sal_uInt16 encodingID, sal_uInt16 languageID, sal_uInt16 nameID)
 
static void vcl::GetNames (AbstractTrueTypeFont *t)
 
int vcl::CountTTCFonts (const char *fname)
 Get the number of fonts contained in a TrueType collection. More...
 
SFErrCodes vcl::OpenTTFontFile (const char *fname, sal_uInt32 facenum, TrueTypeFont **ttf, const FontCharMapRef xCharMap=nullptr)
 TrueTypeFont constructor. More...
 
SFErrCodes vcl::OpenTTFontBuffer (const void *pBuffer, sal_uInt32 nLen, sal_uInt32 facenum, TrueTypeFont **ttf, const FontCharMapRef xCharMap=nullptr)
 TrueTypeFont constructor. More...
 
void vcl::CloseTTFont (TrueTypeFont *)
 TrueTypeFont destructor. More...
 
int vcl::GetTTGlyphPoints (AbstractTrueTypeFont *ttf, sal_uInt32 glyphID, std::vector< ControlPoint > &pointArray)
 Extracts TrueType control points, and stores them in an allocated array pointed to by *pointArray. More...
 
int vcl::GetTTGlyphComponents (AbstractTrueTypeFont *ttf, sal_uInt32 glyphID, std::vector< sal_uInt32 > &glyphlist)
 For a specified glyph adds all component glyphs IDs to the list and return their number. More...
 
SFErrCodes vcl::CreateT3FromTTGlyphs (TrueTypeFont *ttf, SvStream *outf, const char *fname, sal_uInt16 const *glyphArray, sal_uInt8 *encoding, int nGlyphs, int wmode)
 Generates a new PostScript Type 3 font and dumps it to outf file. More...
 
SFErrCodes vcl::CreateTTFromTTGlyphs (AbstractTrueTypeFont *ttf, std::vector< sal_uInt8 > &rOutBuffer, sal_uInt16 const *glyphArray, sal_uInt8 const *encoding, int nGlyphs)
 Generates a new TrueType font and dumps it to outf file. More...
 
bool vcl::CreateTTFfontSubset (vcl::AbstractTrueTypeFont &rTTF, std::vector< sal_uInt8 > &rOutBuffer, const sal_GlyphId *pGlyphIds, const sal_uInt8 *pEncoding, const int nOrigGlyphCount, FontSubsetInfo &rInfo)
 
static void vcl::DumpSfnts (SvStream *outf, sal_uInt8 *sfntP, sal_uInt32 sfntLen)
 
SFErrCodes vcl::CreateT42FromTTGlyphs (TrueTypeFont *ttf, SvStream *outf, const char *psname, sal_uInt16 const *glyphArray, sal_uInt8 *encoding, int nGlyphs)
 Generates a new PostScript Type42 font and dumps it to outf file. More...
 
bool vcl::GetTTGlobalFontHeadInfo (const AbstractTrueTypeFont *ttf, int &xMin, int &yMin, int &xMax, int &yMax, sal_uInt16 &macStyle)
 Returns part of the head table info, normally collected by GetTTGlobalFontInfo. More...
 
void vcl::GetTTGlobalFontInfo (AbstractTrueTypeFont *ttf, TTGlobalFontInfo *info)
 Returns global font information about the TrueType font. More...
 
std::unique_ptr< GlyphData > vcl::GetTTRawGlyphData (AbstractTrueTypeFont *ttf, sal_uInt32 glyphID)
 Extracts raw glyph data from the 'glyf' table and returns it in an allocated GlyphData structure. More...
 
void vcl::GetTTNameRecords (AbstractTrueTypeFont const *ttf, std::vector< NameRecord > &nr)
 Extracts all Name Records from the font and stores them in an allocated array of NameRecord structs. More...
 
template<size_t N>
static void vcl::append (std::bitset< N > &rSet, size_t const nOffset, sal_uInt32 const nValue)
 
bool vcl::getTTCoverage (std::optional< std::bitset< UnicodeCoverage::MAX_UC_ENUM > > &rUnicodeRange, std::optional< std::bitset< CodePageCoverage::MAX_CP_ENUM > > &rCodePageRange, const unsigned char *pTable, size_t nLength)
 
int TestFontSubset (const void *data, sal_uInt32 size)
 

Variables

const char *const vcl::modname = "SunTypeTools-TT"
 
const char *const vcl::modver = "1.0"
 
const char *const vcl::modextra = "gelf"
 

Function Documentation

◆ TestFontSubset()

int TestFontSubset ( const void *  data,
sal_uInt32  size 
)