40#ifndef INCLUDED_VCL_INC_SFT_HXX
41#define INCLUDED_VCL_INC_SFT_HXX
129 std::unique_ptr<sal_uInt8[]>
ptr;
446constexpr sal_uInt32
T_OS2 = 0x4F532F32;
448constexpr sal_uInt32
T_cvt = 0x63767420;
451constexpr sal_uInt32
T_CFF = 0x43464620;
500 std::optional<std::bitset<UnicodeCoverage::MAX_UC_ENUM>> & rUnicodeCoverage,
501 std::optional<std::bitset<CodePageCoverage::MAX_CP_ENUM>> & rCodePageCoverage,
502 const unsigned char* pTable,
size_t nLength);
605 std::vector<sal_uInt8>& rOutBuffer,
606 sal_uInt16
const *glyphArray,
611 std::vector<sal_uInt8>& rOutBuffer,
638 sal_uInt16
const *glyphArray,
710 std::string
const &
fileName()
const {
return m_sFileName; }
712 sal_uInt32 glyphOffset(sal_uInt32 glyphID)
const;
749 inline const sal_uInt8*
table(sal_uInt32 ord, sal_uInt32& size)
const override;
virtual bool hasTable(sal_uInt32 ord) const =0
sal_uInt32 m_nHorzMetrics
sal_uInt32 vertMetricCount() const
std::string const & fileName() const
bool m_bMicrosoftSymbolEncoded
sal_uInt32 horzMetricCount() const
sal_uInt32 m_nVertMetrics
virtual const sal_uInt8 * table(sal_uInt32 ord, sal_uInt32 &size) const =0
sal_uInt32 glyphCount() const
bool IsMicrosoftSymbolEncoded() const
FontCharMapRef m_xCharMap
std::vector< sal_uInt32 > m_aGlyphOffsets
sal_uInt32 unitsPerEm() const
const sal_uInt8 * table(sal_uInt32 ord, sal_uInt32 &size) const override
bool hasTable(sal_uInt32 ord) const override
TrueTypeFont(const char *pFileName=nullptr, const FontCharMapRef xCharMap=nullptr)
SFErrCodes open(sal_uInt32 facenum)
std::array< struct TTFontTable_, NUM_TAGS > m_aTableList
SFErrCodes 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.
void GetTTGlobalFontInfo(AbstractTrueTypeFont *ttf, TTGlobalFontInfo *info)
Returns global font information about the TrueType font.
SFErrCodes OpenTTFontBuffer(const void *pBuffer, sal_uInt32 nLen, sal_uInt32 facenum, TrueTypeFont **ttf, const FontCharMapRef xCharMap)
TrueTypeFont constructor.
int CountTTCFonts(const char *fname)
Get the number of fonts contained in a TrueType collection.
int 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.
bool 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.
int 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.
void CloseTTFont(TrueTypeFont *ttf)
TrueTypeFont destructor.
std::unique_ptr< GlyphData > GetTTRawGlyphData(AbstractTrueTypeFont *ttf, sal_uInt32 glyphID)
Extracts raw glyph data from the 'glyf' table and returns it in an allocated GlyphData structure.
SFErrCodes 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.
void 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.
SFErrCodes OpenTTFontFile(const char *fname, sal_uInt32 facenum, TrueTypeFont **ttf, const FontCharMapRef xCharMap)
TrueTypeFont constructor.
SFErrCodes 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.
constexpr int HHEA_ascender_offset
constexpr int OS2_ulCodePageRange1_offset
constexpr int HEAD_glyphDataFormat_offset
constexpr int OS2_ulUnicodeRange4_offset
constexpr int OS2_fsType_offset
constexpr sal_uInt32 T_ttcf
constexpr int HHEA_lineGap_offset
constexpr int OS2_typoDescender_offset
constexpr int HEAD_lowestRecPPEM_offset
constexpr int OS2_Legacy_length
constexpr int OS2_usWeightClass_offset
constexpr int HEAD_fontRevision_offset
constexpr sal_uInt32 T_post
constexpr sal_uInt32 T_cvt
constexpr sal_uInt32 T_vhea
constexpr sal_uInt32 T_loca
constexpr int HEAD_majorVersion_offset
constexpr int HHEA_Length
constexpr int OS2_winAscent_offset
constexpr int HEAD_yMax_offset
constexpr int HHEA_caretSlopeRise_offset
constexpr sal_uInt32 T_otto
constexpr int GLYF_xMax_offset
SFErrCodes
Return value of OpenTTFont() and CreateT3FromTTGlyphs()
@ FontNo
incorrect logical font number of a TTC font
@ TtFormat
incorrect TrueType font format
@ GlyphNum
incorrect number of glyphs
@ BadArg
incorrect arguments
constexpr int OS2_typoAscender_offset
constexpr int MAXP_maxCompositePoints_offset
constexpr int GLYF_Length
struct TTGlobalFontInfo_ TTGlobalFontInfo
Return value of GetTTGlobalFontInfo()
constexpr int OS2_typoLineGap_offset
constexpr sal_uInt32 T_true
constexpr sal_uInt32 T_prep
constexpr sal_uInt32 T_glyf
constexpr int OS2_ulUnicodeRange3_offset
constexpr int MAXP_Version1Length
constexpr int GLYF_numberOfContours_offset
constexpr int OS2_ulCodePageRange2_offset
constexpr sal_uInt32 T_hhea
constexpr int MAXP_maxCompositeContours_offset
constexpr int OS2_panoseNbBytes_offset
constexpr int MAXP_maxPoints_offset
constexpr int OS2_fsSelection_offset
constexpr int OS2_ulUnicodeRange2_offset
constexpr int HEAD_created_offset
constexpr int GLYF_yMax_offset
constexpr int HHEA_caretSlopeRun_offset
constexpr int HEAD_flags_offset
constexpr int HEAD_unitsPerEm_offset
WidthClass
Value of the width member of the TTGlobalFontInfo struct.
@ FWIDTH_CONDENSED
75% of normal
@ FWIDTH_ULTRA_CONDENSED
50% of normal
@ FWIDTH_SEMI_EXPANDED
112.5% of normal
@ FWIDTH_EXTRA_EXPANDED
150% of normal
@ FWIDTH_EXPANDED
125% of normal
@ FWIDTH_EXTRA_CONDENSED
62.5% of normal
@ FWIDTH_ULTRA_EXPANDED
200% of normal
@ FWIDTH_NORMAL
Medium, 100%
@ FWIDTH_SEMI_CONDENSED
87.5% of normal
bool 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)
constexpr int HEAD_xMax_offset
constexpr sal_uInt32 T_head
constexpr int HEAD_yMin_offset
constexpr int MAXP_maxContours_offset
constexpr int HEAD_fontDirectionHint_offset
constexpr int HEAD_xMin_offset
constexpr int MAXP_numGlyphs_offset
constexpr int POST_isFixedPitch_offset
constexpr int POST_underlinePosition_offset
constexpr int GLYF_yMin_offset
constexpr int HEAD_magicNumber_offset
bool CreateTTFfontSubset(vcl::AbstractTrueTypeFont &rTTF, std::vector< sal_uInt8 > &rOutBuffer, const sal_GlyphId *pGlyphIds, const sal_uInt8 *pEncoding, const int nOrigGlyphCount, FontSubsetInfo &rInfo)
constexpr int OS2_V1_length
constexpr int POST_italicAngle_offset
constexpr sal_uInt32 T_maxp
constexpr sal_uInt32 T_OS2
constexpr sal_uInt32 T_CFF
constexpr int GLYF_xMin_offset
constexpr int HEAD_indexToLocFormat_offset
constexpr sal_uInt32 T_hmtx
constexpr sal_uInt32 T_name
constexpr int HEAD_macStyle_offset
constexpr sal_uInt32 T_fpgm
constexpr int POST_underlineThickness_offset
constexpr int HHEA_descender_offset
constexpr int OS2_ulUnicodeRange1_offset
constexpr int HEAD_Length
constexpr int OS2_panose_offset
constexpr sal_uInt32 T_cmap
constexpr sal_uInt32 T_vmtx
constexpr int OS2_winDescent_offset
WeightClass
Value of the weight member of the TTGlobalFontInfo struct.
@ FW_SEMIBOLD
Semi-bold (Demi-bold)
@ FW_NORMAL
Normal (Regular)
@ FW_EXTRALIGHT
Extra-light (Ultra-light)
@ FW_EXTRABOLD
Extra-bold (Ultra-bold)
constexpr int OS2_usWidthClass_offset
CompositeFlags
Composite glyph flags definition.
@ WE_HAVE_AN_X_AND_Y_SCALE
sal_Int32 F16Dot16
fixed: 16.16
constexpr int OS2_V0_length
ControlPoint structure used by GetTTGlyphPoints()
sal_Int16 y
Y coordinate in EmSquare units
sal_Int16 x
X coordinate in EmSquare units
sal_uInt32 flags
00000000 00000000 e0000000 bbbbbbbb
Structure used by the TrueType Creator and GetRawGlyphData()
sal_uInt32 glyphID
glyph ID
bool compflag
false- if non-composite
sal_uInt16 ncontours
number of contours
sal_uInt16 npoints
number of points
sal_uInt16 aw
advance width
sal_uInt32 newID
used internally by the TTCR
sal_uInt16 nbytes
number of bytes in glyph data
sal_Int16 lsb
left sidebearing
std::unique_ptr< sal_uInt8[]> ptr
pointer to glyph data
Structure used by the TrueType Creator and CreateTTFromTTGlyphs()
sal_uInt16 encodingID
Platform-specific encoding ID
LanguageType languageID
Language ID
sal_uInt16 platformID
Platform ID
std::vector< sal_uInt8 > sptr
string data (not zero-terminated!)
Return value of GetTTGlobalFontInfo()
int italicAngle
in counter-clockwise degrees * 65536
OString family
family name
int ascender
typographic ascent.
int typoDescender
OS/2 portable typographic descender
int yMin
global bounding box: yMin
int winAscent
ascender metric for Windows
int xMin
global bounding box: xMin
int typoAscender
OS/2 portable typographic ascender
sal_uInt8 panose[10]
PANOSE classification number
int width
value of WidthClass or 0 if can't be determined
int typoLineGap
OS/2 portable typographic line gap
int weight
value of WeightClass or 0 if can't be determined
int xMax
global bounding box: xMax
sal_uInt32 typeFlags
type flags (copyright bits)
OUString usubfamily
subfamily name UCS2
int winDescent
descender metric for Windows
OString psname
PostScript name
int linegap
typographic line gap. Negative values are treated as zero in Win 3.1, System 6 and System 7.
int descender
typographic descent.
OUString ufamily
family name UCS2
bool microsoftSymbolEncoded
true: MS symbol encoded
int pitch
0: proportional font, otherwise: monospaced
sal_uInt16 fsSelection
OS/2 fsSelection.
sal_uInt16 macStyle
macstyle bits from 'HEAD' table
OString subfamily
subfamily name
int yMax
global bounding box: yMax
Structure used by GetTTSimpleCharMetrics() functions.
sal_Int16 sb
left or top sidebearing
sal_uInt16 adv
advance width or height