LibreOffice Module vcl (master) 1
fontmetric.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 <sal/config.h>
21
23#include <officecfg/Office/Common.hxx>
24#include <sal/log.hxx>
25#include <tools/stream.hxx>
27#include <vcl/metric.hxx>
28#include <vcl/outdev.hxx>
29
34#include <sft.hxx>
35
36#include <com/sun/star/uno/Sequence.hxx>
38#include <hb-ot.h>
39
40using namespace ::com::sun::star;
41using namespace ::com::sun::star::uno;
42using namespace ::rtl;
43using namespace ::utl;
44
46: mnAscent( 0 ),
47 mnDescent( 0 ),
48 mnIntLeading( 0 ),
49 mnExtLeading( 0 ),
50 mnLineHeight( 0 ),
51 mnSlant( 0 ),
52 mnBulletOffset( 0 ),
53 mnHangingBaseline( 0 ),
54 mbFullstopCentered( false )
55{}
56
57FontMetric::FontMetric( const FontMetric& rFontMetric ) = default;
58
60 : FontMetric()
61{
64 SetCharSet(rFace.IsMicrosoftSymbolEncoded() ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE);
65 SetFamily(rFace.GetFamilyType());
66 SetPitch(rFace.GetPitch());
67 SetWeight(rFace.GetWeight());
68 SetItalic(rFace.GetItalic());
69 SetAlignment(TextAlign::ALIGN_TOP);
71 SetQuality(rFace.GetQuality() );
72}
73
75{
76}
77
78FontMetric& FontMetric::operator=(const FontMetric& rFontMetric) = default;
79
80FontMetric& FontMetric::operator=(FontMetric&& rFontMetric) = default;
81
82bool FontMetric::EqualNoBase( const FontMetric& r ) const
83{
85 return false;
86 if( mnAscent != r.mnAscent )
87 return false;
88 if( mnDescent != r.mnDescent )
89 return false;
90 if( mnIntLeading != r.mnIntLeading )
91 return false;
92 if( mnExtLeading != r.mnExtLeading )
93 return false;
94 if( mnSlant != r.mnSlant )
95 return false;
96
97 return true;
98}
99
100bool FontMetric::operator==( const FontMetric& r ) const
101{
102 if( Font::operator!=(r) )
103 return false;
104 return EqualNoBase(r);
105}
106
108{
109 if( !Font::EqualIgnoreColor(r) )
110 return false;
111 return EqualNoBase(r);
112}
113
115{
116 size_t hash = 0;
123 return hash;
124}
125
127{
128 size_t hash = GetHashValueNoBase();
129 o3tl::hash_combine( hash, Font::GetHashValueIgnoreColor());
130 return hash;
131}
132
134 : FontAttributes( rFontSelData )
135 , mnHeight ( rFontSelData.mnHeight )
136 , mnWidth ( rFontSelData.mnWidth )
137 , mnOrientation( static_cast<short>(rFontSelData.mnOrientation) )
138 , mnAscent( 0 )
139 , mnDescent( 0 )
140 , mnIntLeading( 0 )
141 , mnExtLeading( 0 )
142 , mnSlant( 0 )
143 , mnMinKashida( 0 )
144 , mnHangingBaseline( 0 )
145 , mbFullstopCentered( false )
146 , mnBulletOffset( 0 )
147 , mnUnderlineSize( 0 )
148 , mnUnderlineOffset( 0 )
149 , mnBUnderlineSize( 0 )
150 , mnBUnderlineOffset( 0 )
151 , mnDUnderlineSize( 0 )
152 , mnDUnderlineOffset1( 0 )
153 , mnDUnderlineOffset2( 0 )
154 , mnWUnderlineSize( 0 )
155 , mnWUnderlineOffset( 0 )
156 , mnAboveUnderlineSize( 0 )
157 , mnAboveUnderlineOffset( 0 )
158 , mnAboveBUnderlineSize( 0 )
159 , mnAboveBUnderlineOffset( 0 )
160 , mnAboveDUnderlineSize( 0 )
161 , mnAboveDUnderlineOffset1( 0 )
162 , mnAboveDUnderlineOffset2( 0 )
163 , mnAboveWUnderlineSize( 0 )
164 , mnAboveWUnderlineOffset( 0 )
165 , mnStrikeoutSize( 0 )
166 , mnStrikeoutOffset( 0 )
167 , mnBStrikeoutSize( 0 )
168 , mnBStrikeoutOffset( 0 )
169 , mnDStrikeoutSize( 0 )
170 , mnDStrikeoutOffset1( 0 )
171 , mnDStrikeoutOffset2( 0 )
172{
173 // initialize the used font name
174 sal_Int32 nTokenPos = 0;
175 SetFamilyName( OUString(GetNextFontToken( rFontSelData.GetFamilyName(), nTokenPos )) );
176 SetStyleName( rFontSelData.GetStyleName() );
177}
178
180{
182 return false;
183
184 css::uno::Sequence<OUString> rNoUnderlineMetricsList(
185 officecfg::Office::Common::Misc::FontsDontUseUnderlineMetrics::get());
186 if (comphelper::findValue(rNoUnderlineMetricsList, GetFamilyName()) != -1)
187 {
188 SAL_INFO("vcl.gdi.fontmetric", "Not using underline metrics for: " << GetFamilyName());
189 return true;
190 }
191 return false;
192}
193
195{
197 return false;
198
199 auto* pHbFont = pFont->GetHbFont();
200
201 hb_position_t nUnderlineSize;
202 if (!hb_ot_metrics_get_position(pHbFont, HB_OT_METRICS_TAG_UNDERLINE_SIZE, &nUnderlineSize))
203 return false;
204 hb_position_t nUnderlineOffset;
205 if (!hb_ot_metrics_get_position(pHbFont, HB_OT_METRICS_TAG_UNDERLINE_OFFSET, &nUnderlineOffset))
206 return false;
207 hb_position_t nStrikeoutSize;
208 if (!hb_ot_metrics_get_position(pHbFont, HB_OT_METRICS_TAG_STRIKEOUT_SIZE, &nStrikeoutSize))
209 return false;
210 hb_position_t nStrikeoutOffset;
211 if (!hb_ot_metrics_get_position(pHbFont, HB_OT_METRICS_TAG_STRIKEOUT_OFFSET, &nStrikeoutOffset))
212 return false;
213
214 double fScale = 0;
215 pFont->GetScale(nullptr, &fScale);
216
217 double nOffset = -nUnderlineOffset * fScale;
218 double nSize = nUnderlineSize * fScale;
219 double nSize2 = nSize / 2.;
220 double nBSize = nSize * 2.;
221 double n2Size = nBSize / 3.;
222
223 mnUnderlineSize = std::ceil(nSize);
224 mnUnderlineOffset = std::ceil(nOffset);
225
226 mnBUnderlineSize = std::ceil(nBSize);
227 mnBUnderlineOffset = std::ceil(nOffset - nSize2);
228
229 mnDUnderlineSize = std::ceil(n2Size);
232
234 mnWUnderlineOffset = std::ceil(nOffset + nSize);
235
236 nOffset = -nStrikeoutOffset * fScale;
237 nSize = nStrikeoutSize * fScale;
238 nSize2 = nSize / 2.;
239 nBSize = nSize * 2.;
240 n2Size = nBSize / 3.;
241
242 mnStrikeoutSize = std::ceil(nSize);
243 mnStrikeoutOffset = std::ceil(nOffset);
244
245 mnBStrikeoutSize = std::ceil(nBSize);
246 mnBStrikeoutOffset = std::round(nOffset - nSize2);
247
248 mnDStrikeoutSize = std::ceil(n2Size);
251
252 return true;
253}
254
256{
257 mnBulletOffset = ( pDev->GetTextWidth( OUString( u' ' ) ) - pDev->GetTextWidth( OUString( u'\x00b7' ) ) ) >> 1 ;
258
260 return;
261
262 tools::Long nDescent = mnDescent;
263 if ( nDescent <= 0 )
264 {
265 nDescent = mnAscent / 10;
266 if ( !nDescent )
267 nDescent = 1;
268 }
269
270 // #i55341# for some fonts it is not a good idea to calculate
271 // their text line metrics from the real font descent
272 // => work around this problem just for these fonts
273 if( 3*nDescent > mnAscent )
274 nDescent = mnAscent / 3;
275
276 tools::Long nLineHeight = ((nDescent*25)+50) / 100;
277 if ( !nLineHeight )
278 nLineHeight = 1;
279 tools::Long nLineHeight2 = nLineHeight / 2;
280 if ( !nLineHeight2 )
281 nLineHeight2 = 1;
282
283 tools::Long nBLineHeight = ((nDescent*50)+50) / 100;
284 if ( nBLineHeight == nLineHeight )
285 nBLineHeight++;
286 tools::Long nBLineHeight2 = nBLineHeight/2;
287 if ( !nBLineHeight2 )
288 nBLineHeight2 = 1;
289
290 tools::Long n2LineHeight = ((nDescent*16)+50) / 100;
291 if ( !n2LineHeight )
292 n2LineHeight = 1;
293 tools::Long n2LineDY = n2LineHeight;
294 /* #117909#
295 * add some pixels to minimum double line distance on higher resolution devices
296 */
297 tools::Long nMin2LineDY = 1 + pDev->GetDPIY()/150;
298 if ( n2LineDY < nMin2LineDY )
299 n2LineDY = nMin2LineDY;
300 tools::Long n2LineDY2 = n2LineDY/2;
301 if ( !n2LineDY2 )
302 n2LineDY2 = 1;
303
304 const vcl::Font& rFont ( pDev->GetFont() );
305 bool bCJKVertical = MsLangId::isCJK(rFont.GetLanguage()) && rFont.IsVertical();
306 tools::Long nUnderlineOffset = bCJKVertical ? mnDescent : (mnDescent/2 + 1);
307 tools::Long nStrikeoutOffset = rFont.IsVertical() ? -((mnAscent - mnDescent) / 2) : -((mnAscent - mnIntLeading) / 3);
308
309 mnUnderlineSize = nLineHeight;
310 mnUnderlineOffset = nUnderlineOffset - nLineHeight2;
311
312 mnBUnderlineSize = nBLineHeight;
313 mnBUnderlineOffset = nUnderlineOffset - nBLineHeight2;
314
315 mnDUnderlineSize = n2LineHeight;
316 mnDUnderlineOffset1 = nUnderlineOffset - n2LineDY2 - n2LineHeight;
317 mnDUnderlineOffset2 = mnDUnderlineOffset1 + n2LineDY + n2LineHeight;
318
319 tools::Long nWCalcSize = mnDescent;
320 if ( nWCalcSize < 6 )
321 {
322 if ( (nWCalcSize == 1) || (nWCalcSize == 2) )
323 mnWUnderlineSize = nWCalcSize;
324 else
326 }
327 else
328 mnWUnderlineSize = ((nWCalcSize*50)+50) / 100;
329
330
331 // Don't assume that wavelines are never placed below the descent, because for most fonts the waveline
332 // is drawn into the text
333 mnWUnderlineOffset = nUnderlineOffset;
334
335 mnStrikeoutSize = nLineHeight;
336 mnStrikeoutOffset = nStrikeoutOffset - nLineHeight2;
337
338 mnBStrikeoutSize = nBLineHeight;
339 mnBStrikeoutOffset = nStrikeoutOffset - nBLineHeight2;
340
341 mnDStrikeoutSize = n2LineHeight;
342 mnDStrikeoutOffset1 = nStrikeoutOffset - n2LineDY2 - n2LineHeight;
343 mnDStrikeoutOffset2 = mnDStrikeoutOffset1 + n2LineDY + n2LineHeight;
344
345}
346
347
349{
351
352 tools::Long nIntLeading = mnIntLeading;
353 // TODO: assess usage of nLeading below (changed in extleading CWS)
354 // if no leading is available, we assume 15% of the ascent
355 if ( nIntLeading <= 0 )
356 {
357 nIntLeading = mnAscent*15/100;
358 if ( !nIntLeading )
359 nIntLeading = 1;
360 }
361
362 tools::Long nCeiling = -mnAscent;
363
365 mnAboveUnderlineOffset = nCeiling + (nIntLeading - mnUnderlineSize + 1) / 2;
366
368 mnAboveBUnderlineOffset = nCeiling + (nIntLeading - mnBUnderlineSize + 1) / 2;
369
371 mnAboveDUnderlineOffset1 = nCeiling + (nIntLeading - 3*mnDUnderlineSize + 1) / 2;
372 mnAboveDUnderlineOffset2 = nCeiling + (nIntLeading + mnDUnderlineSize + 1) / 2;
373
375 mnAboveWUnderlineOffset = nCeiling + (nIntLeading + 1) / 2;
376}
377
379{
380 const vcl::Font& rFont ( pDev->GetFont() );
381 bool bCentered = true;
382 if (MsLangId::isCJK(rFont.GetLanguage()))
383 {
384 tools::Rectangle aRect;
385 pDev->GetTextBoundRect( aRect, u"\x3001" ); // Fullwidth fullstop
386 const auto nH = rFont.GetFontSize().Height();
387 const auto nB = aRect.Left();
388 // Use 18.75% as a threshold to define a centered fullwidth fullstop.
389 // In general, nB/nH < 5% for most Japanese fonts.
390 bCentered = nB > (((nH >> 1)+nH)>>3);
391 }
392 SetFullstopCenteredFlag( bCentered );
393}
394
395bool FontMetricData::ShouldUseWinMetrics(int nAscent, int nDescent, int nTypoAscent,
396 int nTypoDescent, int nWinAscent,
397 int nWinDescent) const
398{
400 return false;
401
402 OUString aFontIdentifier(
403 GetFamilyName() + ","
404 + OUString::number(nAscent) + "," + OUString::number(nDescent) + ","
405 + OUString::number(nTypoAscent) + "," + OUString::number(nTypoDescent) + ","
406 + OUString::number(nWinAscent) + "," + OUString::number(nWinDescent));
407
408 css::uno::Sequence<OUString> rWinMetricFontList(
409 officecfg::Office::Common::Misc::FontsUseWinMetrics::get());
410 if (comphelper::findValue(rWinMetricFontList, aFontIdentifier) != -1)
411 {
412 SAL_INFO("vcl.gdi.fontmetric", "Using win metrics for: " << aFontIdentifier);
413 return true;
414 }
415 return false;
416}
417
418// These are “private” HarfBuzz metrics tags, they are supported by not exposed
419// in the public header. They are safe to use, HarfBuzz just does not want to
420// advertise them.
421constexpr auto ASCENT_OS2 = static_cast<hb_ot_metrics_tag_t>(HB_TAG('O', 'a', 's', 'c'));
422constexpr auto DESCENT_OS2 = static_cast<hb_ot_metrics_tag_t>(HB_TAG('O', 'd', 's', 'c'));
423constexpr auto LINEGAP_OS2 = static_cast<hb_ot_metrics_tag_t>(HB_TAG('O', 'l', 'g', 'p'));
424constexpr auto ASCENT_HHEA = static_cast<hb_ot_metrics_tag_t>(HB_TAG('H', 'a', 's', 'c'));
425constexpr auto DESCENT_HHEA = static_cast<hb_ot_metrics_tag_t>(HB_TAG('H', 'd', 's', 'c'));
426constexpr auto LINEGAP_HHEA = static_cast<hb_ot_metrics_tag_t>(HB_TAG('H', 'l', 'g', 'p'));
427
429{
431 auto* pFace = pFontInstance->GetFontFace();
432 auto* pHbFont = pFontInstance->GetHbFont();
433
434 double fScale = 0;
435 pFontInstance->GetScale(nullptr, &fScale);
436 double fAscent = 0, fDescent = 0, fExtLeading = 0;
437
438 auto aFvar(pFace->GetRawFontData(HB_TAG('f', 'v', 'a', 'r')));
439 if (!aFvar.empty())
440 {
441 // This is a variable font, trust HarfBuzz to give us the right metrics
442 // and apply variations to them.
443 hb_position_t nAscent, nDescent, nLineGap;
444 if (hb_ot_metrics_get_position(pHbFont, HB_OT_METRICS_TAG_HORIZONTAL_ASCENDER, &nAscent)
445 && hb_ot_metrics_get_position(pHbFont, HB_OT_METRICS_TAG_HORIZONTAL_DESCENDER,
446 &nDescent)
447 && hb_ot_metrics_get_position(pHbFont, HB_OT_METRICS_TAG_HORIZONTAL_LINE_GAP,
448 &nLineGap))
449 {
450 fAscent = nAscent * fScale;
451 fDescent = -nDescent * fScale;
452 fExtLeading = nLineGap * fScale;
453 }
454 }
455 else
456 {
457 // This is not a variable font, we try to choose the best metrics
458 // ourselves for backward comparability:
459 //
460 // - hhea metrics should be used, since hhea is a mandatory font table
461 // and should always be present.
462 // - But if OS/2 is present, it should be used since it is mandatory in
463 // Windows.
464 // OS/2 has Typo and Win metrics, but the later was meant to control
465 // text clipping not line spacing and can be ridiculously large.
466 // Unfortunately many Windows application incorrectly use the Win
467 // metrics (thanks to GDI’s TEXTMETRIC) and old fonts might be
468 // designed with this in mind, so OpenType introduced a flag for
469 // fonts to indicate that they really want to use Typo metrics. So
470 // for best backward compatibility:
471 // - Use Win metrics if available.
472 // - Unless USE_TYPO_METRICS flag is set, in which case use Typo
473 // metrics.
474
475 // Try hhea table first.
476 hb_position_t nAscent = 0, nDescent = 0, nLineGap = 0;
477 if (hb_ot_metrics_get_position(pHbFont, ASCENT_HHEA, &nAscent)
478 && hb_ot_metrics_get_position(pHbFont, DESCENT_HHEA, &nDescent)
479 && hb_ot_metrics_get_position(pHbFont, LINEGAP_HHEA, &nLineGap))
480 {
481 // tdf#107605: Some fonts have weird values here, so check that
482 // ascender is +ve and descender is -ve as they normally should.
483 if (nAscent >= 0 && nDescent <= 0)
484 {
485 fAscent = nAscent * fScale;
486 fDescent = -nDescent * fScale;
487 fExtLeading = nLineGap * fScale;
488 }
489 }
490
491 // But if OS/2 is present, prefer it.
492 hb_position_t nTypoAscent, nTypoDescent, nTypoLineGap, nWinAscent, nWinDescent;
493 if (hb_ot_metrics_get_position(pHbFont, ASCENT_OS2, &nTypoAscent)
494 && hb_ot_metrics_get_position(pHbFont, DESCENT_OS2, &nTypoDescent)
495 && hb_ot_metrics_get_position(pHbFont, LINEGAP_OS2, &nTypoLineGap)
496 && hb_ot_metrics_get_position(pHbFont, HB_OT_METRICS_TAG_HORIZONTAL_CLIPPING_ASCENT,
497 &nWinAscent)
498 && hb_ot_metrics_get_position(pHbFont, HB_OT_METRICS_TAG_HORIZONTAL_CLIPPING_DESCENT,
499 &nWinDescent))
500 {
501 if ((fAscent == 0.0 && fDescent == 0.0)
502 || ShouldUseWinMetrics(nAscent, nDescent, nTypoAscent, nTypoDescent, nWinAscent,
503 nWinDescent))
504 {
505 fAscent = nWinAscent * fScale;
506 fDescent = nWinDescent * fScale;
507 fExtLeading = 0;
508 }
509
510 bool bUseTypoMetrics = false;
511 {
512 // TODO: Use HarfBuzz API instead of raw access
513 // https://github.com/harfbuzz/harfbuzz/issues/1920
514 sal_uInt16 fsSelection = 0;
515 auto aOS2(pFace->GetRawFontData(HB_TAG('O', 'S', '/', '2')));
516 SvMemoryStream aStream(const_cast<uint8_t*>(aOS2.data()), aOS2.size(),
517 StreamMode::READ);
518 // Font data are big endian.
519 aStream.SetEndian(SvStreamEndian::BIG);
521 aStream.ReadUInt16(fsSelection);
522 bUseTypoMetrics = fsSelection & (1 << 7);
523 }
524 if (bUseTypoMetrics && nTypoAscent >= 0 && nTypoDescent <= 0)
525 {
526 fAscent = nTypoAscent * fScale;
527 fDescent = -nTypoDescent * fScale;
528 fExtLeading = nTypoLineGap * fScale;
529 }
530 }
531 }
532
533 mnAscent = round(fAscent);
534 mnDescent = round(fDescent);
535 mnExtLeading = round(fExtLeading);
536
537 if (mnAscent || mnDescent)
539}
540
542{
543 hb_font_t* pHbFont = pFontInstance->GetHbFont();
544 double fScale = 0;
545 pFontInstance->GetScale(nullptr, &fScale);
546 hb_position_t nBaseline = 0;
547
548 if (hb_ot_layout_get_baseline(pHbFont,
549 HB_OT_LAYOUT_BASELINE_TAG_HANGING,
550 HB_DIRECTION_INVALID,
551 HB_SCRIPT_UNKNOWN,
552 HB_TAG_NONE,
553 &nBaseline))
554 {
555 mnHangingBaseline = nBaseline * fScale;
556 }
557 else
558 {
560 }
561}
562
563/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
int GetQuality() const
bool IsMicrosoftSymbolEncoded() const
FontFamily GetFamilyType() const
FontItalic GetItalic() const
FontWeight GetWeight() const
void SetStyleName(const OUString &sStyleName)
const OUString & GetFamilyName() const
void SetFamilyName(const OUString &sFamilyName)
FontPitch GetPitch() const
const OUString & GetStyleName() const
FontWidth GetWidthType() const
void ImplInitTextLineSize(const OutputDevice *pDev)
Definition: fontmetric.cxx:255
tools::Long mnDUnderlineSize
tools::Long mnAboveUnderlineSize
tools::Long mnUnderlineSize
tools::Long mnAboveDUnderlineSize
tools::Long mnStrikeoutSize
bool ImplInitTextLineSizeHarfBuzz(LogicalFontInstance *pFontInstance)
Definition: fontmetric.cxx:194
tools::Long mnWUnderlineSize
tools::Long mnBUnderlineOffset
tools::Long mnAboveUnderlineOffset
tools::Long mnAboveBUnderlineOffset
bool ShouldNotUseUnderlineMetrics() const
Definition: fontmetric.cxx:179
tools::Long mnAboveDUnderlineOffset2
tools::Long mnDStrikeoutOffset1
void SetFullstopCenteredFlag(bool bFullstopCentered)
tools::Long mnBulletOffset
tools::Long mnAboveWUnderlineSize
tools::Long mnBStrikeoutSize
tools::Long mnDStrikeoutSize
tools::Long mnBUnderlineSize
tools::Long mnIntLeading
void ImplInitAboveTextLineSize(const OutputDevice *pDev)
Definition: fontmetric.cxx:348
tools::Long mnAboveWUnderlineOffset
void ImplInitFlags(const OutputDevice *pDev)
Definition: fontmetric.cxx:378
void ImplInitBaselines(LogicalFontInstance *pFontInstance)
Definition: fontmetric.cxx:541
tools::Long mnExtLeading
tools::Long mnWUnderlineOffset
tools::Long mnDStrikeoutOffset2
tools::Long mnDUnderlineOffset1
tools::Long mnStrikeoutOffset
tools::Long mnAboveDUnderlineOffset1
tools::Long mnHeight
tools::Long mnBStrikeoutOffset
tools::Long mnDescent
tools::Long mnHangingBaseline
FontMetricData(const vcl::font::FontSelectPattern &)
Definition: fontmetric.cxx:133
tools::Long mnUnderlineOffset
bool ShouldUseWinMetrics(int, int, int, int, int, int) const
Definition: fontmetric.cxx:395
tools::Long mnAboveBUnderlineSize
tools::Long mnAscent
void ImplCalcLineSpacing(LogicalFontInstance *pFontInstance)
Definition: fontmetric.cxx:428
tools::Long mnDUnderlineOffset2
FontMetric & operator=(const FontMetric &rMetric)
size_t GetHashValueNoBase() const
Definition: fontmetric.cxx:114
bool operator==(const FontMetric &rMetric) const
Definition: fontmetric.cxx:100
tools::Long mnAscent
Definition: metric.hxx:80
tools::Long mnDescent
Definition: metric.hxx:81
tools::Long mnSlant
Definition: metric.hxx:85
tools::Long mnExtLeading
Definition: metric.hxx:83
size_t GetHashValueIgnoreColor() const
Definition: fontmetric.cxx:126
tools::Long mnIntLeading
Definition: metric.hxx:82
bool EqualIgnoreColor(const FontMetric &) const
Definition: fontmetric.cxx:107
bool mbFullstopCentered
Definition: metric.hxx:89
bool EqualNoBase(const FontMetric &) const
Definition: fontmetric.cxx:82
~FontMetric() override
Definition: fontmetric.cxx:74
void GetScale(double *nXScale, double *nYScale) const
const vcl::font::PhysicalFontFace * GetFontFace() const
static bool isCJK(LanguageType nLang)
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:170
LogicalFontInstance const * GetFontInstance() const
const vcl::Font & GetFont() const
Definition: outdev.hxx:529
SAL_DLLPRIVATE sal_Int32 GetDPIY() const
Get the output device's DPI y-axis value.
Definition: outdev.hxx:391
bool GetTextBoundRect(tools::Rectangle &rRect, const OUString &rStr, sal_Int32 nBase=0, sal_Int32 nIndex=0, sal_Int32 nLen=-1, sal_uLong nLayoutWidth=0, KernArraySpan aDXArray=KernArraySpan(), o3tl::span< const sal_Bool > pKashidaArray={}, const SalLayoutGlyphs *pGlyphs=nullptr) const
Return the exact bounding rectangle of rStr.
Definition: text.cxx:2307
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
Width of the text.
Definition: text.cxx:886
constexpr tools::Long Height() const
void SetEndian(SvStreamEndian SvStreamEndian)
sal_uInt64 Seek(sal_uInt64 nPos)
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
constexpr tools::Long Left() const
static bool IsFuzzing()
void SetWidthType(FontWidth)
Definition: font/font.cxx:242
void SetStyleName(const OUString &rStyleName)
Definition: font/font.cxx:143
void SetQuality(int)
Definition: font/font.cxx:937
void SetPitch(FontPitch ePitch)
Definition: font/font.cxx:191
void SetItalic(FontItalic)
Definition: font/font.cxx:248
void SetWeight(FontWeight)
Definition: font/font.cxx:236
void SetFamily(FontFamily)
Definition: font/font.cxx:155
void SetCharSet(rtl_TextEncoding)
Definition: font/font.cxx:161
const Size & GetFontSize() const
Definition: font/font.cxx:907
LanguageType GetLanguage() const
Definition: font/font.cxx:917
void SetAlignment(TextAlign)
Definition: font/font.cxx:131
void SetFamilyName(const OUString &rFamilyName)
Definition: font/font.cxx:137
bool IsVertical() const
Definition: font/font.cxx:921
abstract base class for physical font faces
float u
UNOTOOLS_DLLPUBLIC std::u16string_view GetNextFontToken(std::u16string_view rTokenStr, sal_Int32 &rIndex)
constexpr auto ASCENT_OS2
Definition: fontmetric.cxx:421
constexpr auto LINEGAP_HHEA
Definition: fontmetric.cxx:426
constexpr auto ASCENT_HHEA
Definition: fontmetric.cxx:424
constexpr auto DESCENT_OS2
Definition: fontmetric.cxx:422
constexpr auto LINEGAP_OS2
Definition: fontmetric.cxx:423
constexpr auto DESCENT_HHEA
Definition: fontmetric.cxx:425
#define SAL_INFO(area, stream)
sal_Int32 findValue(const css::uno::Sequence< T1 > &_rList, const T2 &_rValue)
std::enable_if_t<(sizeof(N)==4)> hash_combine(N &nSeed, T const *pValue, size_t nCount)
long Long
constexpr int OS2_fsSelection_offset
Definition: sft.hxx:275
Sun Font Tools.
double mnWidth
double mnHeight