LibreOffice Module vcl (master) 1
|
#include <LogicalFontInstance.hxx>
Classes | |
struct | MapEntry |
Public Member Functions | |
virtual | ~LogicalFontInstance () override |
void | AddFallbackForUnicode (sal_UCS4 cChar, FontWeight eWeight, const OUString &rFontName, bool bEmbolden, const ItalicMatrix &rMatrix) |
bool | GetFallbackForUnicode (sal_UCS4 cInChar, FontWeight eInWeight, OUString *pOutFontName, bool *pOutEmbolden, ItalicMatrix *pOutItalicMatrix) const |
void | IgnoreFallbackForUnicode (sal_UCS4, FontWeight eWeight, std::u16string_view rFontName) |
hb_font_t * | GetHbFont () |
bool | IsGraphiteFont () |
bool | NeedOffsetCorrection (sal_Int32 nYOffset) |
void | SetAverageWidthFactor (double nFactor) |
double | GetAverageWidthFactor () const |
const vcl::font::FontSelectPattern & | GetFontSelectPattern () const |
const vcl::font::PhysicalFontFace * | GetFontFace () const |
vcl::font::PhysicalFontFace * | GetFontFace () |
const ImplFontCache * | GetFontCache () const |
bool | GetGlyphBoundRect (sal_GlyphId, tools::Rectangle &, bool) const |
virtual bool | GetGlyphOutline (sal_GlyphId, basegfx::B2DPolyPolygon &, bool) const =0 |
basegfx::B2DPolyPolygon | GetGlyphOutlineUntransformed (sal_GlyphId) const |
sal_GlyphId | GetGlyphIndex (uint32_t, uint32_t=0) const |
double | GetGlyphWidth (sal_GlyphId, bool=false, bool=true) const |
double | GetKashidaWidth () const |
void | GetScale (double *nXScale, double *nYScale) const |
bool | NeedsArtificialItalic () const |
bool | NeedsArtificialBold () const |
Public Member Functions inherited from salhelper::SimpleReferenceObject | |
SimpleReferenceObject () | |
void | acquire () |
void | release () |
Public Attributes | |
FontMetricDataRef | mxFontMetric |
const ConvertChar * | mpConversion |
tools::Long | mnLineHeight |
Degree10 | mnOwnOrientation |
Degree10 | mnOrientation |
bool | mbInit |
Protected Member Functions | |
LogicalFontInstance (const vcl::font::PhysicalFontFace &, const vcl::font::FontSelectPattern &) | |
hb_font_t * | InitHbFont () |
virtual void | ImplInitHbFont (hb_font_t *) |
Protected Member Functions inherited from salhelper::SimpleReferenceObject | |
virtual | ~SimpleReferenceObject () COVERITY_NOEXCEPT_FALSE |
Private Types | |
enum class | FontFamilyEnum { Unclassified , DFKaiSB } |
typedef ::std::unordered_map<::std::pair< sal_UCS4, FontWeight >, MapEntry > | UnicodeFallbackList |
Private Member Functions | |
hb_font_t * | GetHbFontUntransformed () const |
Private Attributes | |
UnicodeFallbackList | maUnicodeFallbackList |
ImplFontCache * | mpFontCache |
const vcl::font::FontSelectPattern | m_aFontSelData |
hb_font_t * | m_pHbFont |
hb_font_t * | m_pHbFontUntransformed = nullptr |
double | m_nAveWidthFactor |
rtl::Reference< vcl::font::PhysicalFontFace > | m_pFontFace |
std::optional< bool > | m_xbIsGraphiteFont |
std::optional< FontFamilyEnum > | m_xeFontFamilyEnum |
hb_draw_funcs_t * | m_pHbDrawFuncs = nullptr |
basegfx::B2DPolygon | m_aDrawPolygon |
Friends | |
class | vcl::font::PhysicalFontFace |
class | ImplFontCache |
Additional Inherited Members | |
Static Public Member Functions inherited from salhelper::SimpleReferenceObject | |
static void * | operator new (std::size_t nSize) |
static void * | operator new (std::size_t nSize, std::nothrow_t const &rNothrow) |
static void | operator delete (void *pPtr) |
static void | operator delete (void *pPtr, std::nothrow_t const &rNothrow) |
Protected Attributes inherited from salhelper::SimpleReferenceObject | |
oslInterlockedCount | m_nCount |
Definition at line 67 of file LogicalFontInstance.hxx.
|
private |
Definition at line 138 of file LogicalFontInstance.hxx.
|
strongprivate |
Enumerator | |
---|---|
Unclassified | |
DFKaiSB |
Definition at line 148 of file LogicalFontInstance.hxx.
|
overridevirtual |
Definition at line 45 of file LogicalFontInstance.cxx.
References m_pHbDrawFuncs, m_pHbFont, m_pHbFontUntransformed, maUnicodeFallbackList, mpFontCache, and mxFontMetric.
|
explicitprotected |
Definition at line 29 of file LogicalFontInstance.cxx.
void LogicalFontInstance::AddFallbackForUnicode | ( | sal_UCS4 | cChar, |
FontWeight | eWeight, | ||
const OUString & | rFontName, | ||
bool | bEmbolden, | ||
const ItalicMatrix & | rMatrix | ||
) |
Definition at line 131 of file LogicalFontInstance.cxx.
References LogicalFontInstance::MapEntry::aItalicMatrix, LogicalFontInstance::MapEntry::bEmbolden, maUnicodeFallbackList, and LogicalFontInstance::MapEntry::sFontName.
Referenced by vcl::font::PhysicalFontCollection::GetGlyphFallbackFont().
|
inline |
Definition at line 97 of file LogicalFontInstance.hxx.
bool LogicalFontInstance::GetFallbackForUnicode | ( | sal_UCS4 | cInChar, |
FontWeight | eInWeight, | ||
OUString * | pOutFontName, | ||
bool * | pOutEmbolden, | ||
ItalicMatrix * | pOutItalicMatrix | ||
) | const |
Definition at line 141 of file LogicalFontInstance.cxx.
References LogicalFontInstance::MapEntry::aItalicMatrix, LogicalFontInstance::MapEntry::bEmbolden, maUnicodeFallbackList, and LogicalFontInstance::MapEntry::sFontName.
Referenced by vcl::font::PhysicalFontCollection::GetGlyphFallbackFont().
|
inline |
Definition at line 102 of file LogicalFontInstance.hxx.
Referenced by ImplFontCache::CacheGlyphBoundRect(), and ImplFontCache::GetCachedGlyphBoundRect().
|
inline |
Definition at line 101 of file LogicalFontInstance.hxx.
|
inline |
Definition at line 100 of file LogicalFontInstance.hxx.
Referenced by vcl::PDFWriterImpl::createDefaultCheckBoxAppearance(), vcl::PDFWriterImpl::drawLayout(), WinFontInstance::GetFontFace(), OutputDevice::GetFontFeatures(), GetScale(), vcl::PDFWriterImpl::getSystemFont(), FontMetricData::ImplCalcLineSpacing(), InitHbFont(), and NeedOffsetCorrection().
|
inline |
Definition at line 98 of file LogicalFontInstance.hxx.
Referenced by SalLayoutGlyphsCache::CachedGlyphsKey::CachedGlyphsKey(), vcl::PDFWriterImpl::drawLayout(), ImplFontCache::GetFontInstance(), GenericSalLayout::LayoutText(), and OutputDevice::SetFontOrientation().
bool LogicalFontInstance::GetGlyphBoundRect | ( | sal_GlyphId | nID, |
tools::Rectangle & | rRect, | ||
bool | bVertical | ||
) | const |
Definition at line 169 of file LogicalFontInstance.cxx.
References tools::Rectangle::Bottom(), ImplFontCache::CacheGlyphBoundRect(), ImplFontCache::GetCachedGlyphBoundRect(), GetHbFont(), GetScale(), tools::Rectangle::Left(), mnOrientation, mpFontCache, tools::Rectangle::Right(), tools::Rectangle::SetBottom(), tools::Rectangle::SetLeft(), tools::Rectangle::SetRight(), tools::Rectangle::SetTop(), tools::Rectangle::Top(), and toRadians().
Referenced by GlyphItem::GetGlyphBoundRect(), and GenericSalLayout::LayoutText().
sal_GlyphId LogicalFontInstance::GetGlyphIndex | ( | uint32_t | nUnicode, |
uint32_t | nVariationSelector = 0 |
||
) | const |
Definition at line 212 of file LogicalFontInstance.cxx.
References GetHbFont().
Referenced by GenericSalLayout::ApplyDXArray(), vcl::PDFWriterImpl::createDefaultCheckBoxAppearance(), vcl::PDFWriterImpl::emitSystemFont(), GetKashidaWidth(), and GenericSalLayout::HasVerticalAlternate().
|
pure virtual |
Implemented in vcl::pdf::BuildinFontInstance, QtFont, CoreTextFont, FreetypeFontInstance, and WinFontInstance.
Referenced by GlyphItem::GetGlyphOutline().
basegfx::B2DPolyPolygon LogicalFontInstance::GetGlyphOutlineUntransformed | ( | sal_GlyphId | nGlyph | ) | const |
Definition at line 323 of file LogicalFontInstance.cxx.
References GetHbFontUntransformed(), m_aDrawPolygon, and m_pHbDrawFuncs.
Referenced by vcl::PDFWriterImpl::registerGlyph().
double LogicalFontInstance::GetGlyphWidth | ( | sal_GlyphId | nGlyph, |
bool | bVertical = false , |
||
bool | bScale = true |
||
) | const |
Definition at line 221 of file LogicalFontInstance.cxx.
References GetHbFont(), and GetScale().
Referenced by vcl::PDFWriterImpl::createDefaultCheckBoxAppearance(), vcl::PDFWriterImpl::drawLayout(), vcl::PDFWriterImpl::emitSystemFont(), and GetKashidaWidth().
|
inline |
Definition at line 161 of file LogicalFontInstance.hxx.
References InitHbFont(), and m_pHbFont.
Referenced by GetGlyphBoundRect(), GetGlyphIndex(), GetGlyphWidth(), GetHbFontUntransformed(), FontMetricData::ImplCalcLineSpacing(), FontMetricData::ImplInitBaselines(), FontMetricData::ImplInitTextLineSizeHarfBuzz(), IsGraphiteFont(), and GenericSalLayout::LayoutText().
|
private |
Definition at line 86 of file LogicalFontInstance.cxx.
References GetHbFont(), m_pHbFontUntransformed, and NeedsArtificialItalic().
Referenced by GetGlyphOutlineUntransformed().
double LogicalFontInstance::GetKashidaWidth | ( | ) | const |
Definition at line 105 of file LogicalFontInstance.cxx.
References GetGlyphIndex(), and GetGlyphWidth().
Referenced by GenericSalLayout::ApplyDXArray().
void LogicalFontInstance::GetScale | ( | double * | nXScale, |
double * | nYScale | ||
) | const |
Definition at line 113 of file LogicalFontInstance.cxx.
References GetFontFace(), m_aFontSelData, m_nAveWidthFactor, vcl::font::FontSelectPattern::mnHeight, vcl::font::FontSelectPattern::mnWidth, and vcl::font::PhysicalFontFace::UnitsPerEm().
Referenced by SalLayoutGlyphsCache::CachedGlyphsKey::CachedGlyphsKey(), GenericSalLayout::GetCharWidths(), GetGlyphBoundRect(), GetGlyphWidth(), FontMetricData::ImplCalcLineSpacing(), FontMetricData::ImplInitBaselines(), FontMetricData::ImplInitTextLineSizeHarfBuzz(), and GenericSalLayout::LayoutText().
void LogicalFontInstance::IgnoreFallbackForUnicode | ( | sal_UCS4 | cChar, |
FontWeight | eWeight, | ||
std::u16string_view | rFontName | ||
) |
Definition at line 157 of file LogicalFontInstance.cxx.
References maUnicodeFallbackList, and LogicalFontInstance::MapEntry::sFontName.
Referenced by vcl::font::PhysicalFontCollection::GetGlyphFallbackFont().
|
inlineprotectedvirtual |
Reimplemented in WinFontInstance.
Definition at line 124 of file LogicalFontInstance.hxx.
Referenced by InitHbFont().
|
protected |
Definition at line 61 of file LogicalFontInstance.cxx.
References ARTIFICIAL_ITALIC_SKEW, GetFontFace(), ImplInitHbFont(), and NeedsArtificialItalic().
Referenced by GetHbFont().
bool LogicalFontInstance::IsGraphiteFont | ( | ) |
Definition at line 238 of file LogicalFontInstance.cxx.
References GetHbFont(), and m_xbIsGraphiteFont.
Referenced by GenericSalLayout::LayoutText().
bool LogicalFontInstance::NeedOffsetCorrection | ( | sal_Int32 | nYOffset | ) |
Definition at line 248 of file LogicalFontInstance.cxx.
References DFKaiSB, GetFontFace(), GetName(), m_xeFontFamilyEnum, vcl::font::NAME_ID_FONT_FAMILY, and Unclassified.
bool LogicalFontInstance::NeedsArtificialBold | ( | ) | const |
Definition at line 278 of file LogicalFontInstance.cxx.
References FontAttributes::GetWeight(), m_aFontSelData, m_pFontFace, and WEIGHT_MEDIUM.
Referenced by SalLayoutGlyphsCache::CachedGlyphsKey::CachedGlyphsKey().
bool LogicalFontInstance::NeedsArtificialItalic | ( | ) | const |
Definition at line 283 of file LogicalFontInstance.cxx.
References FontAttributes::GetItalic(), ITALIC_NONE, m_aFontSelData, and m_pFontFace.
Referenced by SalLayoutGlyphsCache::CachedGlyphsKey::CachedGlyphsKey(), GetHbFontUntransformed(), and InitHbFont().
|
inline |
Definition at line 96 of file LogicalFontInstance.hxx.
|
friend |
Definition at line 72 of file LogicalFontInstance.hxx.
|
friend |
Definition at line 71 of file LogicalFontInstance.hxx.
|
private |
Definition at line 158 of file LogicalFontInstance.hxx.
Referenced by GetGlyphOutlineUntransformed().
|
private |
Definition at line 141 of file LogicalFontInstance.hxx.
Referenced by GetScale(), NeedsArtificialBold(), and NeedsArtificialItalic().
|
private |
Definition at line 144 of file LogicalFontInstance.hxx.
Referenced by GetScale().
|
private |
Definition at line 145 of file LogicalFontInstance.hxx.
Referenced by NeedsArtificialBold(), and NeedsArtificialItalic().
|
mutableprivate |
Definition at line 157 of file LogicalFontInstance.hxx.
Referenced by GetGlyphOutlineUntransformed(), and ~LogicalFontInstance().
|
private |
Definition at line 142 of file LogicalFontInstance.hxx.
Referenced by GetHbFont(), and ~LogicalFontInstance().
|
mutableprivate |
Definition at line 143 of file LogicalFontInstance.hxx.
Referenced by GetHbFontUntransformed(), and ~LogicalFontInstance().
|
private |
Definition at line 146 of file LogicalFontInstance.hxx.
Referenced by IsGraphiteFont().
|
private |
Definition at line 155 of file LogicalFontInstance.hxx.
Referenced by NeedOffsetCorrection().
|
private |
Definition at line 139 of file LogicalFontInstance.hxx.
Referenced by AddFallbackForUnicode(), GetFallbackForUnicode(), IgnoreFallbackForUnicode(), and ~LogicalFontInstance().
bool LogicalFontInstance::mbInit |
Definition at line 83 of file LogicalFontInstance.hxx.
Referenced by OutputDevice::ImplNewFont().
tools::Long LogicalFontInstance::mnLineHeight |
Definition at line 80 of file LogicalFontInstance.hxx.
Referenced by vcl::PDFWriterImpl::drawShadow(), and OutputDevice::ImplNewFont().
Degree10 LogicalFontInstance::mnOrientation |
Definition at line 82 of file LogicalFontInstance.hxx.
Referenced by vcl::PDFWriterImpl::drawLayout(), vcl::PDFWriterImpl::drawStrikeoutChar(), GetGlyphBoundRect(), OutputDevice::ImplNewFont(), OutputDevice::SetFontOrientation(), and Printer::SetFontOrientation().
Degree10 LogicalFontInstance::mnOwnOrientation |
Definition at line 81 of file LogicalFontInstance.hxx.
Referenced by OutputDevice::GetFontMetric(), and OutputDevice::SetFontOrientation().
const ConvertChar* LogicalFontInstance::mpConversion |
Definition at line 78 of file LogicalFontInstance.hxx.
|
mutableprivate |
Definition at line 140 of file LogicalFontInstance.hxx.
Referenced by GetGlyphBoundRect(), ImplFontCache::Invalidate(), and ~LogicalFontInstance().
FontMetricDataRef LogicalFontInstance::mxFontMetric |
Definition at line 77 of file LogicalFontInstance.hxx.
Referenced by vcl::PDFWriterImpl::drawStraightTextLine(), vcl::PDFWriterImpl::drawStrikeoutLine(), vcl::PDFWriterImpl::drawTextLine(), OutputDevice::DrawWaveLine(), vcl::PDFWriterImpl::drawWaveTextLine(), OutputDevice::GetFontMetric(), OutputDevice::ImplDrawStraightTextLine(), OutputDevice::ImplDrawStrikeoutLine(), OutputDevice::ImplDrawWaveTextLine(), OutputDevice::ImplNewFont(), OutputDevice::SetFontOrientation(), Printer::SetFontOrientation(), and ~LogicalFontInstance().