LibreOffice Module vcl (master)  1
Classes | Namespaces | Macros | Enumerations | 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 <sft.hxx>
#include "ttcr.hxx"
#include "xlat.hxx"
#include <rtl/crc.h>
#include <rtl/ustring.hxx>
#include <sal/log.hxx>
#include <o3tl/safeint.hxx>
#include <osl/endian.h>
#include <algorithm>
Include dependency graph for sft.cxx:

Go to the source code of this file.

Classes

struct  vcl::PSPathElement
 
struct  vcl::TTGlyphMetrics
 
struct  vcl::HexFmt
 
struct  vcl::GlyphOffsets
 
struct  vcl::subHeader2
 

Namespaces

 vcl
 

Macros

#define HFORMAT_LINELEN   64
 
#define MISSING_GLYPH_INDEX   0
 

Enumerations

enum  PathSegmentType
 
enum  cmapType
 

Functions

static voidvcl::smalloc (size_t size)
 
static voidvcl::scalloc (size_t n, size_t size)
 
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 sal_uInt16 vcl::Int16FromMOTA (sal_uInt16 a)
 
static sal_uInt32 vcl::Int32FromMOTA (sal_uInt32 a)
 
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 const sal_uInt8vcl::getTable (TrueTypeFont const *ttf, sal_uInt32 ord)
 
static sal_uInt32 vcl::getTableSize (TrueTypeFont const *ttf, sal_uInt32 ord)
 
static char vcl::toHex (sal_uInt8 nIndex)
 
static HexFmt * vcl::HexFmtNew (FILE *outf)
 
static bool vcl::HexFmtFlush (HexFmt *_this)
 
static void vcl::HexFmtOpenString (HexFmt *_this)
 
static void vcl::HexFmtCloseString (HexFmt *_this)
 
static void vcl::HexFmtDispose (HexFmt *_this)
 
static void vcl::HexFmtBlockWrite (HexFmt *_this, const void *ptr, sal_uInt32 size)
 
static void vcl::GetMetrics (TrueTypeFont const *ttf, sal_uInt32 glyphID, TTGlyphMetrics *metrics)
 
static int vcl::GetTTGlyphOutline (TrueTypeFont *, sal_uInt32, ControlPoint **, TTGlyphMetrics *, std::vector< sal_uInt32 > *)
 
static int vcl::GetSimpleTTOutline (TrueTypeFont const *ttf, sal_uInt32 glyphID, ControlPoint **pointArray, TTGlyphMetrics *metrics)
 
static F16Dot16 vcl::fromF2Dot14 (sal_Int16 n)
 
static int vcl::GetCompoundTTOutline (TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPoint **pointArray, TTGlyphMetrics *metrics, std::vector< sal_uInt32 > &glyphlist)
 
static int vcl::BSplineToPSPath (ControlPoint const *srcA, int srcCount, PSPathElement **path)
 
static char * vcl::nameExtract (const sal_uInt8 *name, int nTableSize, int n, int dbFlag, sal_Unicode **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 (TrueTypeFont *t)
 
static sal_uInt32 vcl::getGlyph0 (const sal_uInt8 *cmap, sal_uInt32, sal_uInt32 c)
 
static sal_uInt32 vcl::getGlyph2 (const sal_uInt8 *cmap, const sal_uInt32 nMaxCmapSize, sal_uInt32 c)
 
static sal_uInt32 vcl::getGlyph6 (const sal_uInt8 *cmap, sal_uInt32, sal_uInt32 c)
 
static sal_uInt16 vcl::GEbinsearch (sal_uInt16 const *ar, sal_uInt16 length, sal_uInt16 toSearch)
 
static sal_uInt32 vcl::getGlyph4 (const sal_uInt8 *cmap, const sal_uInt32 nMaxCmapSize, sal_uInt32 c)
 
static sal_uInt32 vcl::getGlyph12 (const sal_uInt8 *pCmap, sal_uInt32, sal_uInt32 cChar)
 
static void vcl::FindCmap (TrueTypeFont *ttf)
 
int vcl::CountTTCFonts (const char *fname)
 Get the number of fonts contained in a TrueType collection. More...
 
static void vcl::allocTrueTypeFont (TrueTypeFont **ttf)
 
static SFErrCodes vcl::doOpenTTFont (sal_uInt32 facenum, TrueTypeFont *t)
 
SFErrCodes vcl::OpenTTFontFile (const char *fname, sal_uInt32 facenum, TrueTypeFont **ttf)
 TrueTypeFont constructor. More...
 
SFErrCodes vcl::OpenTTFontBuffer (const void *pBuffer, sal_uInt32 nLen, sal_uInt32 facenum, TrueTypeFont **ttf)
 TrueTypeFont constructor. More...
 
void vcl::CloseTTFont (TrueTypeFont *)
 TrueTypeFont destructor. More...
 
int vcl::GetTTGlyphPoints (TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPoint **pointArray)
 Extracts TrueType control points, and stores them in an allocated array pointed to by *pointArray. More...
 
int vcl::GetTTGlyphComponents (TrueTypeFont *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, FILE *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 (TrueTypeFont *ttf, const char *fname, sal_uInt16 const *glyphArray, sal_uInt8 const *encoding, int nGlyphs)
 Generates a new TrueType font and dumps it to outf file. More...
 
static GlyphOffsets * vcl::GlyphOffsetsNew (sal_uInt8 *sfntP, sal_uInt32 sfntLen)
 
static void vcl::GlyphOffsetsDispose (GlyphOffsets *_this)
 
static void vcl::DumpSfnts (FILE *outf, sal_uInt8 *sfntP, sal_uInt32 sfntLen)
 
SFErrCodes vcl::CreateT42FromTTGlyphs (TrueTypeFont *ttf, FILE *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...
 
int vcl::GetTTGlyphCount (TrueTypeFont const *ttf)
 returns the number of glyphs in a font More...
 
bool vcl::GetSfntTable (TrueTypeFont const *ttf, int nSubtableIndex, const sal_uInt8 **ppRawBytes, int *pRawLength)
 provide access to the raw data of a SFNT-container's subtable More...
 
std::unique_ptr< sal_uInt16[]> vcl::GetTTSimpleGlyphMetrics (TrueTypeFont const *ttf, const sal_uInt16 *glyphArray, int nGlyphs, bool vertical)
 Queries glyph metrics. More...
 
void vcl::GetTTFontMetrics (const uint8_t *pHhea, size_t nHhea, const uint8_t *pOs2, size_t nOs2, TTGlobalFontInfo *info)
 Returns fonts metrics. More...
 
void vcl::GetTTGlobalFontInfo (TrueTypeFont *ttf, TTGlobalFontInfo *info)
 Returns global font information about the TrueType font. More...
 
GlyphData * vcl::GetTTRawGlyphData (TrueTypeFont *ttf, sal_uInt32 glyphID)
 Extracts raw glyph data from the 'glyf' table and returns it in an allocated GlyphData structure. More...
 
int vcl::GetTTNameRecords (TrueTypeFont const *ttf, NameRecord **nr)
 Extracts all Name Records from the font and stores them in an allocated array of NameRecord structs. More...
 
void vcl::DisposeNameRecords (NameRecord *nr, int n)
 Deallocates previously allocated array of NameRecords. More...
 
template<size_t N>
static void vcl::append (std::bitset< N > &rSet, size_t const nOffset, sal_uInt32 const nValue)
 
bool vcl::getTTCoverage (boost::optional< std::bitset< UnicodeCoverage::MAX_UC_ENUM >> &rUnicodeRange, boost::optional< std::bitset< CodePageCoverage::MAX_CP_ENUM >> &rCodePageRange, const unsigned char *pTable, size_t nLength)
 

Variables

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

Macro Definition Documentation

#define HFORMAT_LINELEN   64

Definition at line 96 of file sft.cxx.

Referenced by vcl::HexFmtBlockWrite().

#define MISSING_GLYPH_INDEX   0