23#include <hb-graphite2.h>
31 , mpConversion( nullptr )
33 , mnOwnOrientation( 0 )
36 , mpFontCache( nullptr )
37 , m_aFontSelData(rFontSelData)
39 , m_nAveWidthFactor(1.0f)
40 , m_pFontFace(&const_cast<
vcl::font::PhysicalFontFace&>(rFontFace))
57 hb_font_t* pHbFont = hb_font_create(pHbFace);
58 unsigned int nUPEM = hb_face_get_upem(pHbFace);
59 hb_font_set_scale(pHbFont, nUPEM, nUPEM);
60 hb_ot_font_set_funcs(pHbFont);
62 hb_face_destroy(pHbFace);
69 hb_position_t nWidth = 0;
72 if (hb_font_get_glyph(pHbFont, 0x0640, 0, &
nIndex))
76 nWidth = hb_font_get_glyph_h_advance(pHbFont,
nIndex) * nXScale;
85 unsigned int nUPEM = hb_face_get_upem(pHbFace);
96 *nYScale = nHeight / nUPEM;
99 *nXScale = nWidth / nUPEM;
112 OUString* pFontName,
bool* pEmbolden,
ItalicMatrix* pMatrix)
const
114 UnicodeFallbackList::const_iterator it =
maUnicodeFallbackList.find( std::pair< sal_UCS4, FontWeight >(cChar,eWeight) );
118 const MapEntry& rEntry = (*it).second;
127 UnicodeFallbackList::iterator it =
maUnicodeFallbackList.find( std::pair< sal_UCS4,FontWeight >(cChar,eWeight) );
130 const MapEntry& rEntry = (*it).second;
160 unsigned int familyname_size = 10;
164 if (hb_ot_name_get_utf8 (hb_font_get_face(
GetHbFont()),
165 HB_OT_NAME_ID_FONT_FAMILY , HB_LANGUAGE_INVALID, &familyname_size, familyname) == 8)
171 if (!strncmp(
"DFKai-SB", familyname, 8))
182 if (nYOffset == -839)
bool GetCachedGlyphBoundRect(const LogicalFontInstance *, sal_GlyphId, tools::Rectangle &)
void CacheGlyphBoundRect(const LogicalFontInstance *, sal_GlyphId, tools::Rectangle &)
std::optional< bool > m_xbIsGraphiteFont
void GetScale(double *nXScale, double *nYScale) const
LogicalFontInstance(const vcl::font::PhysicalFontFace &, const vcl::font::FontSelectPattern &)
void AddFallbackForUnicode(sal_UCS4 cChar, FontWeight eWeight, const OUString &rFontName, bool bEmbolden, const ItalicMatrix &rMatrix)
bool GetGlyphBoundRect(sal_GlyphId, tools::Rectangle &, bool) const
ImplFontMetricDataRef mxFontMetric
const vcl::font::FontSelectPattern m_aFontSelData
bool GetFallbackForUnicode(sal_UCS4 cInChar, FontWeight eInWeight, OUString *pOutFontName, bool *pOutEmbolden, ItalicMatrix *pOutItalicMatrix) const
ImplFontCache * mpFontCache
virtual bool ImplGetGlyphBoundRect(sal_GlyphId, tools::Rectangle &, bool) const =0
static hb_font_t * InitHbFont(hb_face_t *pHbFace)
std::optional< FontFamilyEnum > m_xeFontFamilyEnum
bool NeedOffsetCorrection(sal_Int32 nYOffset)
void IgnoreFallbackForUnicode(sal_UCS4, FontWeight eWeight, std::u16string_view rFontName)
int GetKashidaWidth() const
UnicodeFallbackList maUnicodeFallbackList
virtual ~LogicalFontInstance() override
abstract base class for physical font faces
ItalicMatrix aItalicMatrix