LibreOffice Module vcl (master) 1
impglyphitem.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <impglyphitem.hxx>
21#include <utility>
23#include <vcl/vcllayout.hxx>
24#include <vcl/lazydelete.hxx>
25#include <tools/stream.hxx>
27#include <TextLayoutCache.hxx>
28#include <officecfg/Office/Common.hxx>
29#include <o3tl/string_view.hxx>
30
31#include <unicode/ubidi.h>
32#include <unicode/uchar.h>
33
34// These need being explicit because of SalLayoutGlyphsImpl being private in vcl.
36
38
40{
41 std::swap(m_pImpl, rOther.m_pImpl);
42 std::swap(m_pExtraImpls, rOther.m_pExtraImpls);
43}
44
46{
47 if (this != &rOther)
48 {
49 std::swap(m_pImpl, rOther.m_pImpl);
50 std::swap(m_pExtraImpls, rOther.m_pExtraImpls);
51 }
52 return *this;
53}
54
56{
57 if (m_pImpl == nullptr)
58 return false;
59 if (!m_pImpl->IsValid())
60 return false;
61 if (m_pExtraImpls)
62 for (std::unique_ptr<SalLayoutGlyphsImpl> const& impl : *m_pExtraImpls)
63 if (!impl->IsValid())
64 return false;
65 return true;
66}
67
69{
70 // Invalidating is in fact simply clearing.
71 m_pImpl.reset();
72 m_pExtraImpls.reset();
73}
74
75SalLayoutGlyphsImpl* SalLayoutGlyphs::Impl(unsigned int nLevel) const
76{
77 if (nLevel == 0)
78 return m_pImpl.get();
79 if (m_pExtraImpls != nullptr && nLevel - 1 < m_pExtraImpls->size())
80 return (*m_pExtraImpls)[nLevel - 1].get();
81 return nullptr;
82}
83
85{
86 if (!m_pImpl)
87 m_pImpl.reset(pImpl);
88 else
89 {
90 if (!m_pExtraImpls)
91 m_pExtraImpls.reset(new std::vector<std::unique_ptr<SalLayoutGlyphsImpl>>);
92 m_pExtraImpls->emplace_back(pImpl);
93 }
94}
95
97
98// Clone, but only glyphs in the given range in the original text string.
99// It is possible the given range may not be cloned, in which case this returns nullptr.
100SalLayoutGlyphsImpl* SalLayoutGlyphsImpl::cloneCharRange(sal_Int32 index, sal_Int32 length) const
101{
102 std::unique_ptr<SalLayoutGlyphsImpl> copy(new SalLayoutGlyphsImpl(*GetFont()));
103 copy->SetFlags(GetFlags());
104 if (empty())
105 return copy.release();
106 bool rtl = front().IsRTLGlyph();
107 // Avoid mixing LTR/RTL or layouts that do not have it set explicitly (BiDiStrong). Otherwise
108 // the subset may not quite match what would a real layout call give (e.g. some characters with neutral
109 // direction such as space might have different LTR/RTL flag). It seems bailing out here mostly
110 // avoid relatively rare corner cases and doesn't matter for performance.
111 // This is also checked in SalLayoutGlyphsCache::GetLayoutGlyphs() below.
113 || rtl != bool(GetFlags() & SalLayoutFlags::BiDiRtl))
114 return nullptr;
115 copy->reserve(std::min<size_t>(size(), length));
116 sal_Int32 beginPos = index;
117 sal_Int32 endPos = index + length;
118 const_iterator pos;
119 if (rtl)
120 {
121 // Glyphs are in reverse order for RTL.
122 beginPos = index + length - 1;
123 endPos = index - 1;
124 // Skip glyphs that are in the string after the given index, i.e. are before the glyphs
125 // we want.
126 pos = std::partition_point(
127 begin(), end(), [beginPos](const GlyphItem& it) { return it.charPos() > beginPos; });
128 }
129 else
130 {
131 // Skip glyphs that are in the string before the given index (glyphs are sorted by charPos()).
132 pos = std::partition_point(
133 begin(), end(), [beginPos](const GlyphItem& it) { return it.charPos() < beginPos; });
134 }
135 if (pos == end())
136 return nullptr;
137 // Require a start at the exact position given, otherwise bail out.
138 if (pos->charPos() != beginPos)
139 return nullptr;
140 // For RTL make sure we're not cutting in the middle of a multi-character glyph,
141 // or in the middle of a cluster
142 // (for non-RTL charPos is always the start of a multi-character glyph).
143 if (rtl && (pos->charPos() + pos->charCount() > beginPos + 1 || pos->IsInCluster()))
144 return nullptr;
145 if (!isSafeToBreak(pos, rtl))
146 return nullptr;
147 // LinearPos needs adjusting to start at xOffset/yOffset for the first item,
148 // that's how it's computed in GenericSalLayout::LayoutText().
149 basegfx::B2DPoint zeroPoint
150 = pos->linearPos() - basegfx::B2DPoint(pos->xOffset(), pos->yOffset());
151 // Add and adjust all glyphs until the given length.
152 // The check is written as 'charPos + charCount <= endPos' rather than 'charPos < endPos'
153 // (or similarly for RTL) to make sure we include complete glyphs. If a glyph is composed
154 // from several characters, we should not cut in the middle of those characters, so this
155 // checks the glyph is entirely in the given character range. If it is not, this will end
156 // the loop and the later 'pos->charPos() != endPos' check will fail and bail out.
157 // CppunitTest_sw_layoutwriter's testCombiningCharacterCursorPosition would fail without this.
158 while (pos != end()
159 && (rtl ? pos->charPos() - pos->charCount() >= endPos
160 : pos->charPos() + pos->charCount() <= endPos))
161 {
162 if (pos->IsRTLGlyph() != rtl)
163 return nullptr; // Don't mix RTL and non-RTL runs.
164 // HACK: When running CppunitTest_sw_uiwriter3's testTdf104649 on Mac there's glyph
165 // with id 1232 that has 0 charCount, 0 origWidth and inconsistent xOffset (sometimes 0,
166 // but sometimes not). Possibly font or Harfbuzz bug? It's extremely rare, so simply bail out.
167 if (pos->charCount() == 0 && pos->origWidth() == 0)
168 return nullptr;
169 copy->push_back(*pos);
170 copy->back().setLinearPos(copy->back().linearPos() - zeroPoint);
171 ++pos;
172 }
173 if (pos != end())
174 {
175 // Fail if the next character is not at the expected past-end position. For RTL check
176 // that we're not cutting in the middle of a multi-character glyph.
177 if (rtl ? pos->charPos() + pos->charCount() != endPos + 1 : pos->charPos() != endPos)
178 return nullptr;
179 if (!isSafeToBreak(pos, rtl))
180 return nullptr;
181 }
182 return copy.release();
183}
184
185bool SalLayoutGlyphsImpl::isSafeToBreak(const_iterator pos, bool rtl) const
186{
187 if (rtl)
188 {
189 // RTL is more complicated, because HB_GLYPH_FLAG_UNSAFE_TO_BREAK talks about beginning
190 // of a cluster, which refers to the text, not glyphs. This function is called
191 // for the first glyph of the subset and the first glyph after the subset, but since
192 // the glyphs are backwards, and we need the beginning of cluster at the start of the text
193 // and beginning of the cluster after the text, we need to check glyphs before this position.
194 if (pos == begin())
195 return true;
196 --pos;
197 }
198 // Don't create a subset if it's not safe to break at the beginning or end of the sequence
199 // (https://harfbuzz.github.io/harfbuzz-hb-buffer.html#hb-glyph-flags-t).
200 if (pos->IsUnsafeToBreak() || (pos->IsInCluster() && !pos->IsClusterStart()))
201 return false;
202 return true;
203}
204
205#ifdef DBG_UTIL
207{
208 if (!GetFont()->mxFontMetric->CompareDeviceIndependentFontAttributes(
209 *other->GetFont()->mxFontMetric))
210 return false;
211 if (GetFlags() != other->GetFlags())
212 return false;
213 if (empty() || other->empty())
214 return empty() == other->empty();
215 if (size() != other->size())
216 return false;
217 for (size_t pos = 0; pos < size(); ++pos)
218 {
219 if (!(*this)[pos].isLayoutEquivalent((*other)[pos]))
220 return false;
221 }
222 return true;
223}
224#endif
225
227{
228 if (!m_rFontInstance.is())
229 return false;
230 return true;
231}
232
234
236{
239 ? officecfg::Office::Common::Cache::Font::GlyphsCacheSize::get()
240 : 20000);
241 return cache.get();
242}
243
244static UBiDiDirection getBiDiDirection(std::u16string_view text, sal_Int32 index, sal_Int32 len)
245{
246 // Return whether all character are LTR, RTL, neutral or whether it's mixed.
247 // This is sort of ubidi_getBaseDirection() and ubidi_getDirection(),
248 // but it's meant to be fast but also check all characters.
249 sal_Int32 end = index + len;
250 UBiDiDirection direction = UBIDI_NEUTRAL;
251 while (index < end)
252 {
253 switch (u_charDirection(o3tl::iterateCodePoints(text, &index)))
254 {
255 // Only characters with strong direction.
256 case U_LEFT_TO_RIGHT:
257 if (direction == UBIDI_RTL)
258 return UBIDI_MIXED;
259 direction = UBIDI_LTR;
260 break;
261 case U_RIGHT_TO_LEFT:
262 case U_RIGHT_TO_LEFT_ARABIC:
263 if (direction == UBIDI_LTR)
264 return UBIDI_MIXED;
265 direction = UBIDI_RTL;
266 break;
267 default:
268 break;
269 }
270 }
271 return direction;
272}
273
275 const OutputDevice* outputDevice, std::u16string_view text,
276 sal_Int32 index, sal_Int32 len)
277{
278 // tdf#149264: We need to check if the text is LTR, RTL or mixed. Apparently
279 // harfbuzz doesn't give reproducible results (or possibly HB_GLYPH_FLAG_UNSAFE_TO_BREAK
280 // is not reliable?) when asked to lay out RTL text as LTR. So require that the whole
281 // subset ir either LTR or RTL.
282 UBiDiDirection direction = getBiDiDirection(text, index, len);
283 if (direction == UBIDI_MIXED)
284 return SalLayoutGlyphs();
285 SalLayoutGlyphs ret;
286 for (int level = 0;; ++level)
287 {
288 const SalLayoutGlyphsImpl* sourceLevel = source.Impl(level);
289 if (sourceLevel == nullptr)
290 break;
291 bool sourceRtl = bool(sourceLevel->GetFlags() & SalLayoutFlags::BiDiRtl);
292 if ((direction == UBIDI_LTR && sourceRtl) || (direction == UBIDI_RTL && !sourceRtl))
293 return SalLayoutGlyphs();
294 SalLayoutGlyphsImpl* cloned = sourceLevel->cloneCharRange(index, len);
295 // If the glyphs range cannot be cloned, bail out.
296 if (cloned == nullptr)
297 return SalLayoutGlyphs();
298 // If the entire string is mixed LTR/RTL but the subset is only LTR,
299 // then make sure the flags match that, otherwise checkGlyphsEqual()
300 // would assert on flags being different.
301 cloned->SetFlags(cloned->GetFlags()
302 | outputDevice->GetBiDiLayoutFlags(text, index, index + len));
303 ret.AppendImpl(cloned);
304 }
305 return ret;
306}
307
308#ifdef DBG_UTIL
309static void checkGlyphsEqual(const SalLayoutGlyphs& g1, const SalLayoutGlyphs& g2)
310{
311 for (int level = 0;; ++level)
312 {
313 const SalLayoutGlyphsImpl* l1 = g1.Impl(level);
314 const SalLayoutGlyphsImpl* l2 = g2.Impl(level);
315 if (l1 == nullptr || l2 == nullptr)
316 {
317 assert(l1 == l2);
318 break;
319 }
320 assert(l1->isLayoutEquivalent(l2));
321 }
322}
323#endif
324
325const SalLayoutGlyphs*
327 sal_Int32 nIndex, sal_Int32 nLen, tools::Long nLogicWidth,
328 const vcl::text::TextLayoutCache* layoutCache)
329{
330 if (nLen == 0)
331 return nullptr;
332 const CachedGlyphsKey key(outputDevice, text, nIndex, nLen, nLogicWidth);
334 if (it != mCachedGlyphs.end())
335 {
336 if (it->second.IsValid())
337 return &it->second;
338 // Do not try to create the layout here. If a cache item exists, it's already
339 // been attempted and the layout was invalid (this happens with MultiSalLayout).
340 // So in that case this is a cached failure.
341 return nullptr;
342 }
343 bool resetLastSubstringKey = true;
344 const sal_Unicode nbSpace = 0xa0; // non-breaking space
345 // SalLayoutGlyphsImpl::cloneCharRange() requires BiDiStrong, so if not set, do not even try.
346 bool skipGlyphSubsets
348 if ((nIndex != 0 || nLen != text.getLength()) && !skipGlyphSubsets)
349 {
350 // The glyphs functions are often called first for an entire string
351 // and then with an increasing starting index until the end of the string.
352 // Which means it's possible to get the glyphs faster by just copying
353 // a subset of the full glyphs and adjusting as necessary.
354 if (mLastTemporaryKey.has_value() && mLastTemporaryKey == key)
355 return &mLastTemporaryGlyphs;
356 const CachedGlyphsKey keyWhole(outputDevice, text, 0, text.getLength(), nLogicWidth);
358 if (itWhole == mCachedGlyphs.end())
359 {
360 // This function may often be called repeatedly for segments of the same string,
361 // in which case it is more efficient to cache glyphs for the entire string
362 // and then return subsets of them. So if a second call either starts at the same
363 // position or starts at the end of the previous call, cache the entire string.
364 // This used to do this only for the first two segments of the string,
365 // but that missed the case when the font slightly changed e.g. because of the first
366 // part being underlined. Doing this for any two segments allows this optimization
367 // even when the prefix of the string would use a different font.
368 // TODO: Can those font differences be ignored?
369 // Writer layouts tests enable SAL_NON_APPLICATION_FONT_USE=abort in order
370 // to make PrintFontManager::Substitute() abort if font fallback happens. When
371 // laying out the entire string the chance this happens increases (e.g. testAbi11870
372 // normally calls this function only for a part of a string, but this optimization
373 // lays out the entire string and causes a fallback). Since this optimization
374 // does not change result of this function, simply disable it for those tests.
375 static const bool bAbortOnFontSubstitute = [] {
376 const char* pEnv = getenv("SAL_NON_APPLICATION_FONT_USE");
377 return pEnv && strcmp(pEnv, "abort") == 0;
378 }();
379 if (mLastSubstringKey.has_value() && !bAbortOnFontSubstitute)
380 {
381 sal_Int32 pos = nIndex;
382 if (mLastSubstringKey->len < pos && text[pos - 1] == nbSpace)
383 --pos; // Writer skips a non-breaking space, so skip that character too.
384 if ((mLastSubstringKey->len == pos || mLastSubstringKey->index == nIndex)
386 == CachedGlyphsKey(outputDevice, text, mLastSubstringKey->index,
387 mLastSubstringKey->len, nLogicWidth))
388 {
389 GetLayoutGlyphs(outputDevice, text, 0, text.getLength(), nLogicWidth,
390 layoutCache);
391 itWhole = mCachedGlyphs.find(keyWhole);
392 }
393 else
394 mLastSubstringKey.reset();
395 }
396 if (!mLastSubstringKey.has_value())
397 {
398 mLastSubstringKey = key;
399 resetLastSubstringKey = false;
400 }
401 }
402 if (itWhole != mCachedGlyphs.end() && itWhole->second.IsValid())
403 {
404 mLastSubstringKey.reset();
406 = makeGlyphsSubset(itWhole->second, outputDevice, text, nIndex, nLen);
408 {
409 mLastTemporaryKey = key;
410#ifdef DBG_UTIL
411 std::shared_ptr<const vcl::text::TextLayoutCache> tmpLayoutCache;
412 if (layoutCache == nullptr)
413 {
415 layoutCache = tmpLayoutCache.get();
416 }
417 // Check if the subset result really matches what we would get normally,
418 // to make sure corner cases are handled well (see SalLayoutGlyphsImpl::cloneCharRange()).
419 std::unique_ptr<SalLayout> layout
420 = outputDevice->ImplLayout(text, nIndex, nLen, Point(0, 0), nLogicWidth, {}, {},
421 SalLayoutFlags::GlyphItemsOnly, layoutCache);
422 assert(layout);
423 checkGlyphsEqual(mLastTemporaryGlyphs, layout->GetGlyphs());
424#endif
425 return &mLastTemporaryGlyphs;
426 }
427 }
428 }
429 if (resetLastSubstringKey)
430 {
431 // Writer does non-breaking space differently (not as part of the string), so in that
432 // case ignore that call and still allow finding two adjacent substrings that have
433 // the non-breaking space between them.
434 if (nLen != 1 || text[nIndex] != nbSpace)
435 mLastSubstringKey.reset();
436 }
437
438 std::shared_ptr<const vcl::text::TextLayoutCache> tmpLayoutCache;
439 if (layoutCache == nullptr)
440 {
442 layoutCache = tmpLayoutCache.get();
443 }
444 std::unique_ptr<SalLayout> layout
445 = outputDevice->ImplLayout(text, nIndex, nLen, Point(0, 0), nLogicWidth, {}, {},
446 SalLayoutFlags::GlyphItemsOnly, layoutCache);
447 if (layout)
448 {
449 SalLayoutGlyphs glyphs = layout->GetGlyphs();
450 if (glyphs.IsValid())
451 {
452 // TODO: Fallbacks do not work reliably (fallback font not included in the key),
453 // so do not cache (but still return once, using the temporary without a key set).
454 if (!mbCacheGlyphsWhenDoingFallbackFonts && glyphs.Impl(1) != nullptr)
455 {
456 mLastTemporaryGlyphs = std::move(glyphs);
457 mLastTemporaryKey.reset();
458 return &mLastTemporaryGlyphs;
459 }
460 mCachedGlyphs.insert(std::make_pair(key, std::move(glyphs)));
461 assert(mCachedGlyphs.find(key)
462 == mCachedGlyphs.begin()); // newly inserted item is first
463 return &mCachedGlyphs.begin()->second;
464 }
465 }
466 // Failure, cache it too as invalid glyphs.
467 mCachedGlyphs.insert(std::make_pair(key, SalLayoutGlyphs()));
468 return nullptr;
469}
470
472{
474 if (!bOK)
475 clear();
476}
477
479 const VclPtr<const OutputDevice>& outputDevice, OUString t, sal_Int32 i, sal_Int32 l,
480 tools::Long w)
481 : text(std::move(t))
482 , index(i)
483 , len(l)
484 , logicWidth(w)
485 // we also need to save things used in OutputDevice::ImplPrepareLayoutArgs(), in case they
486 // change in the output device, plus mapMode affects the sizes.
487 , fontMetric(outputDevice->GetFontMetric())
488 // TODO It would be possible to get a better hit ratio if mapMode wasn't part of the key
489 // and results that differ only in mapmode would have coordinates adjusted based on that.
490 // That would occasionally lead to rounding errors (at least differences that would
491 // make checkGlyphsEqual() fail).
492 , mapMode(outputDevice->GetMapMode())
493 , rtl(outputDevice->IsRTLEnabled())
494 , layoutMode(outputDevice->GetLayoutMode())
495 , digitLanguage(outputDevice->GetDigitLanguage())
496{
497 const LogicalFontInstance* fi = outputDevice->GetFontInstance();
499
504
505 hashValue = 0;
510 o3tl::hash_combine(hashValue, outputDevice.get());
511 // Need to use IgnoreColor, because sometimes the color changes, but it's irrelevant
512 // for text layout (and also obsolete in vcl::Font).
514 // For some reason font scale may differ even if vcl::Font is the same,
515 // so explicitly check it too.
525}
526
528{
529 return hashValue == other.hashValue && index == other.index && len == other.len
530 && logicWidth == other.logicWidth && mapMode == other.mapMode && rtl == other.rtl
531 && disabledLigatures == other.disabledLigatures
532 && artificialItalic == other.artificialItalic && artificialBold == other.artificialBold
533 && layoutMode == other.layoutMode && digitLanguage == other.digitLanguage
534 && fontScaleX == other.fontScaleX && fontScaleY == other.fontScaleY
535 && fontMetric.EqualIgnoreColor(other.fontMetric)
537 // Slower things last in the comparison.
538}
539
541{
542 size_t cost = 0;
543 for (int level = 0;; ++level)
544 {
545 const SalLayoutGlyphsImpl* impl = glyphs.Impl(level);
546 if (impl == nullptr)
547 break;
548 // Count size in bytes, both the SalLayoutGlyphsImpl instance and contained GlyphItem's.
549 cost += sizeof(*impl);
550 cost += impl->size() * sizeof(impl->front());
551 }
552 return cost;
553}
554
555/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::std::unique_ptr< XmlIdRegistry_Impl > m_pImpl
XPropertyListType t
FontPitch GetPitch() const
size_t GetHashValueIgnoreColor() const
Definition: fontmetric.cxx:126
int charPos() const
void GetScale(double *nXScale, double *nYScale) const
bool NeedsArtificialItalic() const
const vcl::font::FontSelectPattern & GetFontSelectPattern() const
size_t GetHashValue() const
Definition: mapmod.cxx:170
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:170
LogicalFontInstance const * GetFontInstance() const
SAL_DLLPRIVATE SalLayoutFlags GetBiDiLayoutFlags(std::u16string_view rStr, const sal_Int32 nMinIndex, const sal_Int32 nEndIndex) const
Definition: text.cxx:1211
vcl::text::ComplexTextLayoutFlags GetLayoutMode() const
Definition: outdev.hxx:490
std::unique_ptr< SalLayout > ImplLayout(const OUString &, sal_Int32 nIndex, sal_Int32 nLen, const Point &rLogicPos=Point(0, 0), tools::Long nLogicWidth=0, KernArraySpan aKernArray=KernArraySpan(), o3tl::span< const sal_Bool > pKashidaArray={}, SalLayoutFlags flags=SalLayoutFlags::NONE, vcl::text::TextLayoutCache const *=nullptr, const SalLayoutGlyphs *pGlyphs=nullptr) const
Definition: text.cxx:1292
A cache for SalLayoutGlyphs objects.
std::optional< CachedGlyphsKey > mLastTemporaryKey
void SetCacheGlyphsWhenDoingFallbackFonts(bool bOK)
Normally, we cannot cache glyphs when doing font fallback, because the font fallbacks can cache durin...
SalLayoutGlyphs mLastTemporaryGlyphs
static SalLayoutGlyphsCache * self()
std::optional< CachedGlyphsKey > mLastSubstringKey
const SalLayoutGlyphs * GetLayoutGlyphs(VclPtr< const OutputDevice > outputDevice, const OUString &text, const vcl::text::TextLayoutCache *layoutCache=nullptr)
SalLayoutGlyphsImpl(LogicalFontInstance &rFontInstance)
void SetFlags(SalLayoutFlags flags)
SalLayoutFlags GetFlags() const
rtl::Reference< LogicalFontInstance > m_rFontInstance
SalLayoutGlyphsImpl * clone() const
bool IsValid() const
bool isSafeToBreak(const_iterator pos, bool rtl) const
bool isLayoutEquivalent(const SalLayoutGlyphsImpl *other) const
SalLayoutGlyphsImpl * cloneCharRange(sal_Int32 index, sal_Int32 length) const
const rtl::Reference< LogicalFontInstance > & GetFont() const
SalLayoutGlyphsImpl * Impl(unsigned int nLevel) const
void AppendImpl(SalLayoutGlyphsImpl *pImpl)
SalLayoutGlyphs & operator=(const SalLayoutGlyphs &)=delete
std::unique_ptr< SalLayoutGlyphsImpl > m_pImpl
Definition: glyphitem.hxx:33
std::unique_ptr< std::vector< std::unique_ptr< SalLayoutGlyphsImpl > > > m_pExtraImpls
Definition: glyphitem.hxx:37
bool IsValid() const
reference_type * get() const
Get the body.
Definition: vclptr.hxx:143
void insert(key_value_pair_t &rPair)
list_const_iterator_t end() const
list_const_iterator_t begin() const
list_const_iterator_t find(const Key &key)
static bool IsFuzzing()
static std::shared_ptr< const vcl::text::TextLayoutCache > Create(OUString const &)
PITCH_FIXED
static SalLayoutGlyphs makeGlyphsSubset(const SalLayoutGlyphs &source, const OutputDevice *outputDevice, std::u16string_view text, sal_Int32 index, sal_Int32 len)
static void checkGlyphsEqual(const SalLayoutGlyphs &g1, const SalLayoutGlyphs &g2)
static UBiDiDirection getBiDiDirection(std::u16string_view text, sal_Int32 index, sal_Int32 len)
sal_Int32 nIndex
def text(shape, orig_st)
size
void copy(const fs::path &src, const fs::path &dest)
int i
index
std::enable_if_t<(sizeof(N)==4)> hash_combine(N &nSeed, T const *pValue, size_t nCount)
enumrange< T >::Iterator begin(enumrange< T >)
sal_uInt32 iterateCodePoints(std::u16string_view string, sal_Int32 *indexUtf16, sal_Int32 incrementCodePoints=1)
end
long Long
sal_Int32 w
bool operator==(const CachedGlyphsKey &other) const
vcl::text::ComplexTextLayoutFlags layoutMode
CachedGlyphsKey(const VclPtr< const OutputDevice > &dev, OUString t, sal_Int32 i, sal_Int32 l, tools::Long w)
size_t operator()(const SalLayoutGlyphs &) const
UNDERLYING_TYPE get() const
sal_uInt16 sal_Unicode
size_t pos