LibreOffice Module vcl (master) 1
|
Functions | |
int | vcl::CountTTCFonts (const char *fname) |
Get the number of fonts contained in a TrueType collection. More... | |
SFErrCodes | vcl::OpenTTFontBuffer (const void *pBuffer, sal_uInt32 nLen, sal_uInt32 facenum, TrueTypeFont **ttf, const FontCharMapRef xCharMap=nullptr) |
TrueTypeFont constructor. More... | |
SFErrCodes | vcl::OpenTTFontFile (const char *fname, 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... | |
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... | |
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... | |
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... | |
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... | |
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... | |
void | vcl::GetTTGlobalFontInfo (AbstractTrueTypeFont *ttf, TTGlobalFontInfo *info) |
Returns global font information about the TrueType font. 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_DLLPUBLIC vcl::CloseTTFont | ( | TrueTypeFont * | ) |
TrueTypeFont destructor.
Deallocates the memory.
Definition at line 1258 of file sft.cxx.
Referenced by EmbeddedFontsHelper::sufficientTTFRights(), and TestFontSubset().
int vcl::CountTTCFonts | ( | const char * | fname | ) |
Get the number of fonts contained in a TrueType collection.
fname | - file name |
Definition at line 1074 of file sft.cxx.
References FILE, vcl::GetUInt32(), n, SAL_WARN, and vcl::T_ttcf.
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.
This function substitutes glyph 0 for all glyphIDs that are not found in the font.
ttf | pointer to the TrueTypeFont structure |
outf | the resulting font is written to this stream |
fname | font name for the new font. If it is NULL the PostScript name of the original font will be used |
glyphArray | pointer to an array of glyphs that are to be extracted from ttf |
encoding | array of encoding values. encoding[i] specifies the position of the glyph glyphArray[i] in the encoding vector of the resulting Type3 font |
nGlyphs | number of glyph IDs in glyphArray and encoding values in encoding |
wmode | writing mode for the output file: 0 - horizontal, 1 - vertical |
Definition at line 1564 of file sft.cxx.
References vcl::BadArg, vcl::BSplineToPSPath(), vcl::TrueTypeFont::fsize, vcl::GetInt16(), vcl::GetTTGlyphOutline(), vcl::GetUInt16(), vcl::AbstractTrueTypeFont::glyphCount(), vcl::GlyphNum, i, vcl::modextra, vcl::modname, vcl::modver, n, vcl::O_head, vcl::Ok, vcl::AbstractTrueTypeFont::psname, vcl::TrueTypeFont::ptr, table, vcl::TrueTypeFont::table(), type, vcl::AbstractTrueTypeFont::unitsPerEm(), SvStream::WriteOString(), and vcl::XUnits().
Referenced by FontSubsetInfo::CreateFontSubsetFromSfnt().
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.
This function substitutes glyph 0 for all glyphIDs that are not found in the font.
ttf | pointer to the TrueTypeFont structure |
outf | output stream for a resulting font |
psname | PostScript name of the resulting font |
glyphArray | pointer to an array of glyphs that are to be extracted from ttf. The first element of this array has to be glyph 0 (default glyph) |
encoding | array of encoding values. encoding[i] specifies character code for the glyphID glyphArray[i]. Character code 0 usually points to a default glyph (glyphID 0) |
nGlyphs | number of glyph IDs in glyphArray and encoding values in encoding |
hhea
maxp
cvt
prep
fpgm
glyf
Definition at line 2131 of file sft.cxx.
References vcl::TrueTypeCreator::AddTable(), vcl::DumpSfnts(), vcl::AbstractTrueTypeFont::family, vcl::AbstractTrueTypeFont::fileName(), vcl::TrueTypeFont::fsize, vcl::GetInt16(), vcl::GetInt32(), vcl::GetTTRawGlyphData(), vcl::GetUInt16(), vcl::GlyphNum, vcl::HEAD_created_offset, vcl::HEAD_flags_offset, vcl::HEAD_fontDirectionHint_offset, vcl::HEAD_fontRevision_offset, vcl::HEAD_lowestRecPPEM_offset, vcl::HEAD_macStyle_offset, vcl::HEAD_majorVersion_offset, vcl::HEAD_unitsPerEm_offset, vcl::HEAD_xMax_offset, vcl::HEAD_xMin_offset, vcl::HEAD_yMax_offset, vcl::HEAD_yMin_offset, vcl::HHEA_ascender_offset, vcl::HHEA_caretSlopeRise_offset, vcl::HHEA_caretSlopeRun_offset, vcl::HHEA_descender_offset, vcl::HHEA_lineGap_offset, i, vcl::modextra, vcl::modname, vcl::modver, vcl::O_cvt, vcl::O_fpgm, vcl::O_head, vcl::O_hhea, vcl::O_maxp, vcl::O_prep, vcl::Ok, p, vcl::AbstractTrueTypeFont::psname, vcl::TrueTypeFont::ptr, vcl::TrueTypeCreator::StreamToMemory(), vcl::AbstractTrueTypeFont::subfamily, vcl::T_cvt, vcl::T_fpgm, vcl::T_prep, vcl::T_true, vcl::TrueTypeFont::table(), vcl::AbstractTrueTypeFont::unitsPerEm(), SvStream::WriteOString(), and vcl::XUnits().
Referenced by FontSubsetInfo::CreateFontSubsetFromSfnt().
VCL_DLLPUBLIC 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.
This function substitutes glyph 0 for all glyphIDs that are not found in the font.
ttf | pointer to the TrueTypeFont structure |
fname | file name for the output TrueType font file |
glyphArray | pointer to an array of glyphs that are to be extracted from ttf. The first element of this array has to be glyph 0 (default glyph) |
encoding | array of encoding values. encoding[i] specifies character code for the glyphID glyphArray[i]. Character code 0 usually points to a default glyph (glyphID 0) |
nGlyphs | number of glyph IDs in glyphArray and encoding values in encoding |
flags | or'ed TTCreationFlags |
name
maxp
hhea
head
glyf
cmap
cvt
prep
fpgm
post
Definition at line 1746 of file sft.cxx.
References vcl::TrueTypeCreator::AddTable(), vcl::GetInt16(), vcl::GetInt32(), vcl::GetTTNameRecords(), vcl::GetTTRawGlyphData(), vcl::GetUInt16(), vcl::GetUInt32(), vcl::HEAD_created_offset, vcl::HEAD_flags_offset, vcl::HEAD_fontDirectionHint_offset, vcl::HEAD_fontRevision_offset, vcl::HEAD_lowestRecPPEM_offset, vcl::HEAD_macStyle_offset, vcl::HEAD_unitsPerEm_offset, vcl::HHEA_ascender_offset, vcl::HHEA_caretSlopeRise_offset, vcl::HHEA_caretSlopeRun_offset, vcl::HHEA_descender_offset, vcl::HHEA_lineGap_offset, i, name, vcl::O_cvt, vcl::O_fpgm, vcl::O_head, vcl::O_hhea, vcl::O_maxp, vcl::O_post, vcl::O_prep, vcl::Ok, p, vcl::POST_isFixedPitch_offset, vcl::POST_italicAngle_offset, vcl::POST_underlinePosition_offset, vcl::POST_underlineThickness_offset, SAL_WARN_IF, vcl::TrueTypeCreator::StreamToMemory(), vcl::T_cvt, vcl::T_fpgm, vcl::T_prep, vcl::T_true, and vcl::AbstractTrueTypeFont::table().
Referenced by vcl::CreateTTFfontSubset(), and TestFontSubset().
VCL_DLLPUBLIC 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.
Just implemented separate, because this info not available via Qt API.
ttf | pointer to a AbstractTrueTypeFont structure |
xMin | global glyph bounding box min X |
yMin | global glyph bounding box min Y |
xMax | global glyph bounding box max X |
yMax | global glyph bounding box max Y |
macStyle | encoded Mac style flags of the font |
Definition at line 2263 of file sft.cxx.
References vcl::GetInt16(), vcl::GetUInt16(), vcl::HEAD_macStyle_offset, vcl::HEAD_xMax_offset, vcl::HEAD_xMin_offset, vcl::HEAD_yMax_offset, vcl::HEAD_yMin_offset, vcl::O_head, table, vcl::AbstractTrueTypeFont::table(), vcl::AbstractTrueTypeFont::unitsPerEm(), and vcl::XUnits().
Referenced by vcl::GetTTGlobalFontInfo().
VCL_DLLPUBLIC void vcl::GetTTGlobalFontInfo | ( | AbstractTrueTypeFont * | ttf, |
TTGlobalFontInfo * | info | ||
) |
Returns global font information about the TrueType font.
ttf | pointer to a TrueTypeFont structure |
info | pointer to a TTGlobalFontInfo structure |
Definition at line 2281 of file sft.cxx.
References vcl::TTGlobalFontInfo_::ascender, vcl::TTGlobalFontInfo_::descender, vcl::TTGlobalFontInfo_::family, vcl::AbstractTrueTypeFont::family, vcl::GetInt16(), vcl::GetInt32(), vcl::GetTTGlobalFontHeadInfo(), vcl::GetUInt16(), vcl::GetUInt32(), vcl::HHEA_ascender_offset, vcl::HHEA_descender_offset, vcl::HHEA_lineGap_offset, vcl::AbstractTrueTypeFont::IsMicrosoftSymbolEncoded(), vcl::TTGlobalFontInfo_::italicAngle, vcl::TTGlobalFontInfo_::linegap, vcl::TTGlobalFontInfo_::macStyle, vcl::TTGlobalFontInfo_::microsoftSymbolEncoded, vcl::O_hhea, vcl::O_OS2, vcl::O_post, vcl::OS2_fsType_offset, vcl::OS2_panose_offset, vcl::OS2_panoseNbBytes_offset, vcl::OS2_typoAscender_offset, vcl::OS2_typoDescender_offset, vcl::OS2_typoLineGap_offset, vcl::OS2_usWeightClass_offset, vcl::OS2_usWidthClass_offset, vcl::OS2_V0_length, vcl::OS2_winAscent_offset, vcl::OS2_winDescent_offset, vcl::TTGlobalFontInfo_::panose, vcl::TTGlobalFontInfo_::pitch, vcl::POST_isFixedPitch_offset, vcl::POST_italicAngle_offset, vcl::TTGlobalFontInfo_::psname, vcl::AbstractTrueTypeFont::psname, vcl::TTGlobalFontInfo_::subfamily, vcl::AbstractTrueTypeFont::subfamily, table, vcl::AbstractTrueTypeFont::table(), vcl::TTGlobalFontInfo_::typeFlags, vcl::TTGlobalFontInfo_::typoAscender, vcl::TTGlobalFontInfo_::typoDescender, vcl::TTGlobalFontInfo_::typoLineGap, vcl::TTGlobalFontInfo_::ufamily, vcl::AbstractTrueTypeFont::ufamily, vcl::AbstractTrueTypeFont::unitsPerEm(), vcl::TTGlobalFontInfo_::usubfamily, vcl::AbstractTrueTypeFont::usubfamily, vcl::TTGlobalFontInfo_::weight, vcl::TTGlobalFontInfo_::width, vcl::TTGlobalFontInfo_::winAscent, vcl::TTGlobalFontInfo_::winDescent, vcl::TTGlobalFontInfo_::xMax, vcl::TTGlobalFontInfo_::xMin, vcl::XUnits(), vcl::TTGlobalFontInfo_::yMax, and vcl::TTGlobalFontInfo_::yMin.
Referenced by EmbeddedFontsHelper::sufficientTTFRights(), and TestFontSubset().
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.
If the glyph is a single glyph it has one component glyph (which is added to the list) and the function returns 1. For a composite glyphs it returns the number of component glyphs and adds all of them to the list.
ttf | pointer to the TrueTypeFont structure |
glyphID | Glyph ID |
glyphlist | list of glyphs |
Definition at line 1487 of file sft.cxx.
References vcl::ARG_1_AND_2_ARE_WORDS, vcl::GetInt16(), vcl::GetTTGlyphComponents(), vcl::GetUInt16(), vcl::AbstractTrueTypeFont::glyphCount(), vcl::AbstractTrueTypeFont::glyphOffset(), index, vcl::MORE_COMPONENTS, n, vcl::O_glyf, SAL_WARN, vcl::AbstractTrueTypeFont::table(), vcl::WE_HAVE_A_SCALE, vcl::WE_HAVE_A_TWO_BY_TWO, and vcl::WE_HAVE_AN_X_AND_Y_SCALE.
Referenced by vcl::GetTTGlyphComponents(), and vcl::TrueTypeTableGlyf::glyfAdd().
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.
This function returns the number of extracted points.
ttf | pointer to the TrueTypeFont structure |
glyphID | Glyph ID |
pointArray | Return value - address of the pointer to the first element of the array of points allocated by the function |
Definition at line 1482 of file sft.cxx.
References vcl::GetTTGlyphOutline().
Referenced by vcl::GetTTRawGlyphData().
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.
ttf | pointer to the TrueTypeFont struct |
nr | reference to the vector of NameRecord structs |
Definition at line 2422 of file sft.cxx.
References vcl::AbstractTrueTypeFont::fileName(), vcl::GetUInt16(), i, n, vcl::O_name, SAL_WARN, table, and vcl::AbstractTrueTypeFont::table().
Referenced by vcl::CreateTTFromTTGlyphs().
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.
ttf | pointer to the TrueTypeFont structure |
glyphID | Glyph ID |
Definition at line 2332 of file sft.cxx.
References d, vcl::GetInt16(), vcl::GetTTGlyphPoints(), vcl::GetUInt16(), vcl::AbstractTrueTypeFont::glyphCount(), vcl::AbstractTrueTypeFont::glyphOffset(), vcl::AbstractTrueTypeFont::horzMetricCount(), i, length, m, n, vcl::O_glyf, vcl::O_hmtx, SAL_WARN, and vcl::AbstractTrueTypeFont::table().
Referenced by vcl::CreateT42FromTTGlyphs(), vcl::CreateTTFromTTGlyphs(), and vcl::TrueTypeTableGlyf::glyfAdd().
SFErrCodes VCL_DLLPUBLIC vcl::OpenTTFontBuffer | ( | const void * | pBuffer, |
sal_uInt32 | nLen, | ||
sal_uInt32 | facenum, | ||
TrueTypeFont ** | ttf, | ||
const FontCharMapRef | xCharMap = nullptr |
||
) |
TrueTypeFont constructor.
The font file has to be provided as a memory buffer and length
pBuffer | - memory buffer |
nLen | - size of memory buffer |
facenum | - logical font number within a TTC file. This value is ignored for TrueType fonts |
ttf | - returns the opened TrueTypeFont |
xCharMap | - optional parsed character map |
Definition at line 1194 of file sft.cxx.
References vcl::Memory, and vcl::Ok.
Referenced by EmbeddedFontsHelper::sufficientTTFRights(), and TestFontSubset().
SFErrCodes VCL_DLLPUBLIC vcl::OpenTTFontFile | ( | const char * | fname, |
sal_uInt32 | facenum, | ||
TrueTypeFont ** | ttf, | ||
const FontCharMapRef | xCharMap = nullptr |
||
) |
TrueTypeFont constructor.
Reads the font file and allocates the memory for the structure. on WIN32 the font has to be provided as a memory buffer and length
fname | - name of TrueType font file |
facenum | - logical font number within a TTC file. This value is ignored for TrueType fonts |
ttf | - returns the opened TrueTypeFont |
xCharMap | - optional parsed character map |
Definition at line 1126 of file sft.cxx.
References vcl::BadFile, cleanup(), close, vcl::FileIo, vcl::Memory, n, and vcl::Ok.