40 #ifndef INCLUDED_VCL_INC_SFT_HXX
41 #define INCLUDED_VCL_INC_SFT_HXX
428 constexpr sal_uInt32
T_true = 0x74727565;
429 constexpr sal_uInt32
T_ttcf = 0x74746366;
430 constexpr sal_uInt32
T_otto = 0x4f54544f;
433 constexpr sal_uInt32
T_maxp = 0x6D617870;
434 constexpr sal_uInt32
T_glyf = 0x676C7966;
435 constexpr sal_uInt32
T_head = 0x68656164;
436 constexpr sal_uInt32
T_loca = 0x6C6F6361;
437 constexpr sal_uInt32
T_name = 0x6E616D65;
438 constexpr sal_uInt32
T_hhea = 0x68686561;
439 constexpr sal_uInt32
T_hmtx = 0x686D7478;
440 constexpr sal_uInt32
T_cmap = 0x636D6170;
441 constexpr sal_uInt32
T_vhea = 0x76686561;
442 constexpr sal_uInt32
T_vmtx = 0x766D7478;
443 constexpr sal_uInt32
T_OS2 = 0x4F532F32;
444 constexpr sal_uInt32
T_post = 0x706F7374;
445 constexpr sal_uInt32
T_cvt = 0x63767420;
446 constexpr sal_uInt32
T_prep = 0x70726570;
447 constexpr sal_uInt32
T_fpgm = 0x6670676D;
448 constexpr sal_uInt32
T_gsub = 0x47535542;
449 constexpr sal_uInt32
T_CFF = 0x43464620;
498 std::optional<std::bitset<UnicodeCoverage::MAX_UC_ENUM>> & rUnicodeCoverage,
499 std::optional<std::bitset<CodePageCoverage::MAX_CP_ENUM>> & rCodePageCoverage,
500 const unsigned char* pTable,
size_t nLength);
615 sal_uInt16
const *glyphArray,
642 sal_uInt16
const *glyphArray,
696 const uint8_t *pOs2,
size_t nOs2,
738 const char*
fileName()
const {
return m_pFileName; }
740 sal_uInt32
glyphOffset(sal_uInt32 glyphID)
const {
return m_pGlyphOffsets[glyphID]; }
746 virtual bool hasTable(sal_uInt32 ord)
const = 0;
747 virtual const sal_uInt8*
table(sal_uInt32 ord, sal_uInt32& size)
const = 0;
777 bool hasTable(sal_uInt32 ord)
const override {
return m_aTableList[ord].pData !=
nullptr; }
778 inline const sal_uInt8*
table(sal_uInt32 ord, sal_uInt32& size)
const override;
796 #endif // INCLUDED_VCL_INC_SFT_HXX
Extra-light (Ultra-light)
int winDescent
descender metric for Windows
constexpr int HEAD_yMax_offset
constexpr int HEAD_magicNumber_offset
constexpr sal_uInt32 T_head
bool symbolEncoded
true: MS symbol encoded
sal_Int32 F16Dot16
fixed: 16.16
sal_Unicode * usubfamily
subfamily name UCS2
int pitch
0: proportional font, otherwise: monospaced
constexpr int OS2_ulCodePageRange2_offset
sal_Int16 sb
left or top sidebearing
sal_uInt16 ncontours
number of contours
SFErrCodes CreateTTFromTTGlyphs(AbstractTrueTypeFont *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.
sal_uInt32 unitsPerEm() const
constexpr int OS2_ulCodePageRange1_offset
constexpr sal_uInt32 T_OS2
constexpr sal_uInt32 T_gsub
bool compflag
false- if non-composite
sal_uInt16 fsSelection
OS/2 fsSelection.
constexpr int HEAD_unitsPerEm_offset
int CountTTCFonts(const char *fname)
Get the number of fonts contained in a TrueType collection.
sal_Int16 y
Y coordinate in EmSquare units.
std::unique_ptr< sal_uInt16[]> GetTTSimpleGlyphMetrics(AbstractTrueTypeFont const *ttf, const sal_uInt16 *glyphArray, int nGlyphs, bool vertical)
Queries glyph metrics.
constexpr int MAXP_Version1Length
constexpr sal_uInt32 T_hhea
void DisposeNameRecords(NameRecord *nr, int n)
Deallocates previously allocated array of NameRecords.
SFErrCodes
Return value of OpenTTFont() and CreateT3FromTTGlyphs()
struct TTGlobalFontInfo_ TTGlobalFontInfo
Return value of GetTTGlobalFontInfo()
constexpr int OS2_ulUnicodeRange1_offset
char * subfamily
subfamily name
char * psname
PostScript name.
sal_uInt32 glyphCount() const
WidthClass
Value of the width member of the TTGlobalFontInfo struct.
void CloseTTFont(TrueTypeFont *ttf)
TrueTypeFont destructor.
SFErrCodes OpenTTFontFile(const char *fname, sal_uInt32 facenum, TrueTypeFont **ttf, const FontCharMapRef xCharMap)
TrueTypeFont constructor.
constexpr sal_uInt32 T_true
constexpr int HHEA_descender_offset
constexpr sal_uInt32 T_loca
sal_uInt16 adv
advance width or height
constexpr int HEAD_created_offset
constexpr int POST_underlineThickness_offset
constexpr int HEAD_macStyle_offset
constexpr int OS2_fsType_offset
constexpr sal_uInt32 T_vhea
constexpr int OS2_ulUnicodeRange3_offset
exports com.sun.star. table
sal_uInt32 m_nHorzMetrics
constexpr int HEAD_lowestRecPPEM_offset
bool hasTable(sal_uInt32 ord) const override
constexpr int HEAD_Length
constexpr int HEAD_xMax_offset
Structure used by the TrueType Creator and GetRawGlyphData()
sal_uInt16 nbytes
number of bytes in glyph data
incorrect logical font number of a TTC font
int width
value of WidthClass or 0 if can't be determined
constexpr int GLYF_numberOfContours_offset
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.
constexpr int MAXP_maxCompositePoints_offset
sal_uInt8 panose[10]
PANOSE classification number.
sal_Int16 x
X coordinate in EmSquare units.
constexpr int OS2_panoseNbBytes_offset
constexpr int HEAD_fontDirectionHint_offset
constexpr int GLYF_Length
constexpr int OS2_typoAscender_offset
constexpr sal_uInt32 T_cmap
int yMin
global bounding box: yMin
const char * fileName() const
FontCharMapRef GetCharMap() const
SFErrCodes open(sal_uInt32 facenum)
constexpr int OS2_usWidthClass_offset
sal_uInt32 vertMetricCount() const
TrueTypeFont(const char *pFileName=nullptr, const FontCharMapRef xCharMap=nullptr)
SFErrCodes 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.
constexpr int MAXP_maxContours_offset
constexpr int OS2_Legacy_length
constexpr sal_uInt32 T_prep
int winAscent
ascender metric for Windows
constexpr int OS2_typoDescender_offset
constexpr int HHEA_caretSlopeRise_offset
void GetTTGlobalFontInfo(TrueTypeFont *ttf, TTGlobalFontInfo *info)
Returns global font information about the TrueType font.
void GetTTFontMetrics(const uint8_t *pHhea, size_t nHhea, const uint8_t *pOs2, size_t nOs2, TTGlobalFontInfo *info)
Returns fonts metrics.
CompositeFlags
Composite glyph flags definition.
GlyphData * GetTTRawGlyphData(AbstractTrueTypeFont *ttf, sal_uInt32 glyphID)
Extracts raw glyph data from the 'glyf' table and returns it in an allocated GlyphData structure...
sal_uInt32 typeFlags
type flags (copyright bits)
constexpr sal_uInt32 T_maxp
constexpr int HEAD_yMin_offset
ControlPoint structure used by GetTTGlyphPoints()
constexpr sal_uInt32 T_glyf
constexpr sal_uInt32 T_cvt
constexpr int OS2_winAscent_offset
constexpr int HHEA_Length
int typoAscender
OS/2 portable typographic ascender.
constexpr int HHEA_ascender_offset
sal_uInt32 newID
used internally by the TTCR
int ascender
typographic ascent.
constexpr int HHEA_lineGap_offset
int GetTTNameRecords(AbstractTrueTypeFont const *ttf, NameRecord **nr)
Extracts all Name Records from the font and stores them in an allocated array of NameRecord structs...
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 descender
typographic descent.
incorrect number of glyphs
constexpr int HEAD_indexToLocFormat_offset
constexpr int HEAD_flags_offset
int italicAngle
in counter-clockwise degrees * 65536
constexpr int HEAD_glyphDataFormat_offset
constexpr sal_uInt32 T_hmtx
sal_uInt32 horzMetricCount() const
sal_uInt16 platformID
Platform ID.
sal_uInt8 * sptr
Pointer to string data (not zero-terminated!)
constexpr int HEAD_fontRevision_offset
constexpr sal_uInt32 T_fpgm
int typoLineGap
OS/2 portable typographic line gap.
int weight
value of WeightClass or 0 if can't be determined
constexpr int GLYF_xMin_offset
int yMax
global bounding box: yMax
constexpr int GLYF_yMax_offset
constexpr int OS2_V0_length
constexpr int POST_isFixedPitch_offset
const sal_uInt8 * table(sal_uInt32 ord, sal_uInt32 &size) const override
constexpr int GLYF_xMax_offset
std::array< struct TTFontTable_, NUM_TAGS > m_aTableList
constexpr int OS2_typoLineGap_offset
int xMax
global bounding box: xMax
sal_uInt16 macStyle
macstyle bits from 'HEAD' table
int xMin
global bounding box: xMin
Structure used by the TrueType Creator and CreateTTFromTTGlyphs()
incorrect TrueType font format
sal_uInt32 glyphOffset(sal_uInt32 glyphID) const
sal_Int16 lsb
left sidebearing
WeightClass
Value of the weight member of the TTGlobalFontInfo struct.
Structure used by GetTTSimpleCharMetrics() functions.
constexpr int HEAD_xMin_offset
constexpr int MAXP_maxPoints_offset
sal_uInt16 encodingID
Platform-specific encoding ID.
LanguageType languageID
Language ID.
constexpr int OS2_V1_length
constexpr sal_uInt32 T_name
constexpr sal_uInt32 T_otto
constexpr sal_uInt32 T_post
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 OS2_winDescent_offset
constexpr int OS2_panose_offset
constexpr sal_uInt32 T_ttcf
sal_Unicode * ufamily
family name UCS2
constexpr int POST_underlinePosition_offset
sal_uInt16 slen
String length in bytes.
sal_uInt16 npoints
number of points
constexpr int MAXP_maxCompositeContours_offset
constexpr sal_uInt32 T_CFF
int linegap
typographic line gap. Negative values are treated as zero in Win 3.1, System 6 and System 7...
constexpr int OS2_fsSelection_offset
int GetTTGlyphPoints(AbstractTrueTypeFont *ttf, sal_uInt32 glyphID, ControlPoint **pointArray)
Extracts TrueType control points, and stores them in an allocated array pointed to by *pointArray...
sal_uInt16 aw
advance width
sal_uInt32 glyphID
glyph ID
SFErrCodes 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.
sal_uInt32 flags
00000000 00000000 e0000000 bbbbbbbb
sal_uInt16 nameID
Name ID.
sal_uInt32 m_nVertMetrics
constexpr int HEAD_majorVersion_offset
constexpr int HHEA_caretSlopeRun_offset
constexpr int POST_italicAngle_offset
constexpr int OS2_usWeightClass_offset
int typoDescender
OS/2 portable typographic descender.
constexpr int OS2_ulUnicodeRange2_offset
Return value of GetTTGlobalFontInfo()
constexpr int MAXP_numGlyphs_offset
constexpr sal_uInt32 T_vmtx
sal_uInt32 * m_pGlyphOffsets
constexpr int GLYF_yMin_offset
constexpr int OS2_ulUnicodeRange4_offset
sal_uInt8 * ptr
pointer to glyph data
FontCharMapRef m_xCharMap
SFErrCodes OpenTTFontBuffer(const void *pBuffer, sal_uInt32 nLen, sal_uInt32 facenum, TrueTypeFont **ttf, const FontCharMapRef xCharMap)
TrueTypeFont constructor.