LibreOffice Module svx (master) 1
fntctrl.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 <sfx2/dialoghelper.hxx>
21#include <sfx2/viewsh.hxx>
22#include <sfx2/printer.hxx>
23#include <vcl/metric.hxx>
24#include <vcl/svapp.hxx>
25#include <vcl/settings.hxx>
26#include <unicode/uchar.h>
27#include <com/sun/star/uno/Reference.h>
28#include <com/sun/star/i18n/BreakIterator.hpp>
30
31#include <com/sun/star/i18n/ScriptType.hpp>
32
33#include <vector>
34#include <deque>
35#include <optional>
36#include <svtools/colorcfg.hxx>
38
39#include <svx/fntctrl.hxx>
40#include <svx/svxids.hrc>
41
42// Item set includes
43#include <svl/itemset.hxx>
44#include <svl/itempool.hxx>
45#include <svl/stritem.hxx>
46#include <svl/cjkoptions.hxx>
47#include <svl/ctloptions.hxx>
48
49#include <editeng/colritem.hxx>
50#include <editeng/fontitem.hxx>
51#include <editeng/editids.hrc>
52#include <editeng/postitem.hxx>
53#include <editeng/udlnitem.hxx>
56#include <editeng/wghtitem.hxx>
57#include <editeng/fhgtitem.hxx>
58#include <editeng/shdditem.hxx>
60#include <editeng/wrlmitem.hxx>
61#include <editeng/cmapitem.hxx>
62#include <editeng/kernitem.hxx>
63#include <editeng/brushitem.hxx>
67#include <editeng/langitem.hxx>
68
69//TODO: remove this and calculate off the actual size of text, not
70//an arbitrary number of characters
71#define TEXT_WIDTH 80
72
73using namespace ::com::sun::star::uno;
74using namespace ::com::sun::star::lang;
75using ::com::sun::star::i18n::XBreakIterator;
76using ::com::sun::star::i18n::BreakIterator;
77
78
79// small helper functions to set fonts
80
81namespace
82{
83void scaleFontWidth(vcl::Font& rFont, vcl::RenderContext const & rRenderContext,tools::Long& n100PercentFont)
84{
85 rFont.SetAverageFontWidth(0);
86 n100PercentFont = rRenderContext.GetFontMetric(rFont).GetAverageFontWidth();
87}
88
89void initFont(vcl::Font& rFont)
90{
91 rFont.SetTransparent(true);
93}
94
95void setFontSize(vcl::Font& rFont)
96{
97 Size aSize(rFont.GetFontSize());
98 aSize.setHeight( (aSize.Height() * 3) / 5 );
99 aSize.setWidth( (aSize.Width() * 3) / 5 );
100 rFont.SetFontSize(aSize);
101}
102
103void calcFontHeightAnyAscent(vcl::RenderContext& rRenderContext, const vcl::Font& rFont, tools::Long& nHeight, tools::Long& nAscent)
104{
105 if (!nHeight)
106 {
107 rRenderContext.SetFont(rFont);
108 FontMetric aMetric(rRenderContext.GetFontMetric());
109 nHeight = aMetric.GetLineHeight();
110 nAscent = aMetric.GetAscent();
111 }
112}
113
114void setFont(const SvxFont& rNewFont, SvxFont& rImplFont)
115{
116 rImplFont = rNewFont;
117 rImplFont.SetTransparent(true);
118 rImplFont.SetAlignment(ALIGN_BASELINE);
119}
120
121/*
122 * removes line feeds and carriage returns from string
123 * returns if param is empty
124 */
125bool CleanAndCheckEmpty(OUString& rText)
126{
127 bool bEmpty = true;
128 for (sal_Int32 i = 0; i < rText.getLength(); ++i)
129 {
130 if (0xa == rText[i] || 0xd == rText[i])
131 rText = rText.replaceAt(i, 1, u" ");
132 else
133 bEmpty = false;
134 }
135 return bEmpty;
136}
137} // end anonymous namespace
138
140{
141 friend class SvxFontPrevWindow;
142
146
147 Reference <XBreakIterator> mxBreak;
148 std::vector<tools::Long> maTextWidth;
149 std::deque<sal_Int32> maScriptChg;
150 std::vector<sal_uInt16> maScriptType;
153 OUString maText;
154 OUString maScriptText;
155 std::optional<Color> mxColor;
156 std::optional<Color> mxBackColor;
157 std::optional<Color> mxTextLineColor;
158 std::optional<Color> mxOverlineColor;
162
163 tools::Long mn100PercentFontWidth; // initial -1 -> not set yet
167
168 bool mbSelection : 1;
170 bool mbTwoLines : 1;
172 bool mbTextInited : 1;
173
176
177
178public:
180 mpPrinter(nullptr),
181 mbDelPrinter(false),
182 mnAscent(0),
184 mcEndBracket(0),
185 mnFontWidthScale(100),
186 mbSelection(false),
187 mbGetSelection(false),
188 mbTwoLines(false),
189 mbUseFontNameAsText(false),
190 mbTextInited(false)
191 {
196 }
197
199 {
200 if (mbDelPrinter)
202 }
203
204 void CheckScript();
205 Size CalcTextSize(vcl::RenderContext& rRenderContext, OutputDevice const * pPrinter, const SvxFont& rFont);
206 void DrawPrev(vcl::RenderContext& rRenderContext, Printer* pPrinter, Point& rPt, const SvxFont& rFont);
207
208 bool SetFontWidthScale(sal_uInt16 nScaleInPercent);
209 inline void Invalidate100PercentFontWidth();
210 inline bool Is100PercentFontWidthValid() const;
211 void ScaleFontWidth(vcl::RenderContext const & rRenderContext);
212 // scales rNonCJKFont and aCJKFont depending on nFontWidthScale and
213 // sets the 100%-Font-Widths
214};
215
217{
219}
220
222{
227 "*FontPrevWin_Impl::Is100PercentFontWidthValid(): 100PercentFontWidth's not synchronous" );
228 return mn100PercentFontWidth != -1;
229}
230
231/*
232 * evaluates the scripttypes of the actual string.
233 * Afterwards the positions of script change are notified in aScriptChg,
234 * the scripttypes in aScriptType.
235 * The aTextWidth array will be filled with zero.
236 */
238{
239 assert(!maText.isEmpty()); // must have a preview text here!
240 if (maText == maScriptText)
241 {
242 return; // already initialized
243 }
244
246
247 maScriptChg.clear();
248 maScriptType.clear();
249 maTextWidth.clear();
250
251 if (!mxBreak.is())
252 {
253 Reference<XComponentContext> xContext = ::comphelper::getProcessComponentContext();
254 mxBreak = BreakIterator::create(xContext);
255 }
256
257 sal_uInt16 nScript = 0;
258 sal_Int32 nChg = 0;
259
260 while (nChg < maText.getLength())
261 {
262 nScript = mxBreak->getScriptType(maText, nChg);
263 nChg = mxBreak->endOfScript(maText, nChg, nScript);
264 if (nChg < maText.getLength() && nChg > 0 &&
265 (css::i18n::ScriptType::WEAK ==
266 mxBreak->getScriptType(maText, nChg - 1)))
267 {
268 int8_t nType = u_charType(maText[nChg]);
269 if (nType == U_NON_SPACING_MARK || nType == U_ENCLOSING_MARK ||
270 nType == U_COMBINING_SPACING_MARK)
271 {
272 maScriptChg.push_back(nChg - 1);
273 }
274 else
275 {
276 maScriptChg.push_back(nChg);
277 }
278 }
279 else
280 {
281 maScriptChg.push_back(nChg);
282 }
283 maScriptType.push_back(nScript);
284 maTextWidth.push_back(0);
285 }
286}
287
288/*
289 * Size FontPrevWin_Impl::CalcTextSize(..)
290 * fills the aTextWidth array with the text width of every part
291 * of the actual string without a script change inside.
292 * For Latin parts the given rFont will be used,
293 * for Asian parts the aCJKFont.
294 * The returned size contains the whole string.
295 * The member nAscent is calculated to the maximal ascent of all used fonts.
296 */
297
298Size FontPrevWin_Impl::CalcTextSize(vcl::RenderContext& rRenderContext, OutputDevice const * _pPrinter, const SvxFont& rInFont)
299{
300 sal_uInt16 nScript;
301 sal_uInt16 nIdx = 0;
302 sal_Int32 nStart = 0;
303 sal_Int32 nEnd;
304 size_t nCnt = maScriptChg.size();
305
306 if (nCnt)
307 {
308 nEnd = maScriptChg[nIdx];
309 nScript = maScriptType[nIdx];
310 }
311 else
312 {
313 nEnd = maText.getLength();
314 nScript = css::i18n::ScriptType::LATIN;
315 }
316 tools::Long nTxtWidth = 0;
317 tools::Long nCJKHeight = 0;
318 tools::Long nCTLHeight = 0;
319 tools::Long nHeight = 0;
320 mnAscent = 0;
321 tools::Long nCJKAscent = 0;
322 tools::Long nCTLAscent = 0;
323
324 do
325 {
326 const SvxFont& rFont = (nScript == css::i18n::ScriptType::ASIAN) ?
327 maCJKFont :
328 ((nScript == css::i18n::ScriptType::COMPLEX) ?
329 maCTLFont :
330 rInFont);
331 tools::Long nWidth = rFont.GetTextSize(*_pPrinter, maText, nStart, nEnd - nStart).Width();
332 if (nIdx >= maTextWidth.size())
333 break;
334
335 maTextWidth[nIdx++] = nWidth;
336 nTxtWidth += nWidth;
337
338 switch (nScript)
339 {
340 case css::i18n::ScriptType::ASIAN:
341 calcFontHeightAnyAscent(rRenderContext, maCJKFont, nCJKHeight, nCJKAscent);
342 break;
343 case css::i18n::ScriptType::COMPLEX:
344 calcFontHeightAnyAscent(rRenderContext, maCTLFont, nCTLHeight, nCTLAscent);
345 break;
346 default:
347 calcFontHeightAnyAscent(rRenderContext, rFont, nHeight, mnAscent);
348 }
349
350 if (nEnd < maText.getLength() && nIdx < nCnt)
351 {
352 nStart = nEnd;
353 nEnd = maScriptChg[nIdx];
354 nScript = maScriptType[nIdx];
355 }
356 else
357 break;
358 }
359 while(true);
360
361 nHeight -= mnAscent;
362 nCJKHeight -= nCJKAscent;
363 nCTLHeight -= nCTLAscent;
364
365 if (nHeight < nCJKHeight)
366 nHeight = nCJKHeight;
367
368 if (mnAscent < nCJKAscent)
369 mnAscent = nCJKAscent;
370
371 if (nHeight < nCTLHeight)
372 nHeight = nCTLHeight;
373
374 if (mnAscent < nCTLAscent)
375 mnAscent = nCTLAscent;
376
377 nHeight += mnAscent;
378
379 Size aTxtSize(nTxtWidth, nHeight);
380 return aTxtSize;
381}
382
383/*
384 * void FontPrevWin_Impl::DrawPrev(..)
385 * calls SvxFont::DrawPrev(..) for every part of the string without a script
386 * change inside, for Asian parts the aCJKFont will be used, otherwise the
387 * given rFont.
388 */
389
390void FontPrevWin_Impl::DrawPrev(vcl::RenderContext& rRenderContext, Printer* _pPrinter, Point &rPt, const SvxFont& rInFont)
391{
392 vcl::Font aOldFont = _pPrinter->GetFont();
393 sal_uInt16 nScript;
394 sal_uInt16 nIdx = 0;
395 sal_Int32 nStart = 0;
396 sal_Int32 nEnd;
397 size_t nCnt = maScriptChg.size();
398 if (nCnt)
399 {
400 nEnd = maScriptChg[nIdx];
401 nScript = maScriptType[nIdx];
402 }
403 else
404 {
405 nEnd = maText.getLength();
406 nScript = css::i18n::ScriptType::LATIN;
407 }
408 do
409 {
410 const SvxFont& rFont = (nScript == css::i18n::ScriptType::ASIAN)
411 ? maCJKFont
412 : ((nScript == css::i18n::ScriptType::COMPLEX)
413 ? maCTLFont
414 : rInFont);
415 _pPrinter->SetFont(rFont);
416
417 rFont.DrawPrev(&rRenderContext, _pPrinter, rPt, maText, nStart, nEnd - nStart);
418
419 rPt.AdjustX(maTextWidth[nIdx++] );
420 if (nEnd < maText.getLength() && nIdx < nCnt)
421 {
422 nStart = nEnd;
423 nEnd = maScriptChg[nIdx];
424 nScript = maScriptType[nIdx];
425 }
426 else
427 break;
428 }
429 while(true);
430 _pPrinter->SetFont(aOldFont);
431}
432
433
435{
436 if (mnFontWidthScale != nScale)
437 {
438 mnFontWidthScale = nScale;
439 return true;
440 }
441
442 return false;
443}
444
446{
448 {
449 scaleFontWidth(maFont, rOutDev, mn100PercentFontWidth);
450 scaleFontWidth(maCJKFont, rOutDev, mn100PercentFontWidthCJK);
451 scaleFontWidth(maCTLFont, rOutDev, mn100PercentFontWidthCTL);
452 }
453
454 maFont.SetAverageFontWidth(mn100PercentFontWidth * mnFontWidthScale / 100);
455 maCJKFont.SetAverageFontWidth(mn100PercentFontWidthCJK * mnFontWidthScale / 100);
456 maCTLFont.SetAverageFontWidth(mn100PercentFontWidthCTL * mnFontWidthScale / 100);
457}
458
459static bool GetWhich (const SfxItemSet& rSet, sal_uInt16 nSlot, sal_uInt16& rWhich)
460{
461 rWhich = rSet.GetPool()->GetWhich(nSlot);
462 return rSet.GetItemState(rWhich) >= SfxItemState::DEFAULT;
463}
464
465static void SetPrevFont(const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont)
466{
467 sal_uInt16 nWhich;
468 if (GetWhich(rSet, nSlot, nWhich))
469 {
470 const SvxFontItem& rFontItem = static_cast<const SvxFontItem&>(rSet.Get(nWhich));
471 rFont.SetFamily(rFontItem.GetFamily());
472 rFont.SetFamilyName(rFontItem.GetFamilyName());
473 rFont.SetPitch(rFontItem.GetPitch());
474 rFont.SetCharSet(rFontItem.GetCharSet());
475 rFont.SetStyleName(rFontItem.GetStyleName());
476 }
477}
478
479static void SetPrevFontStyle( const SfxItemSet& rSet, sal_uInt16 nPosture, sal_uInt16 nWeight, SvxFont& rFont )
480{
481 sal_uInt16 nWhich;
482 if( GetWhich( rSet, nPosture, nWhich ) )
483 {
484 const SvxPostureItem& rItem = static_cast<const SvxPostureItem&>( rSet.Get( nWhich ) );
485 rFont.SetItalic( rItem.GetValue() != ITALIC_NONE ? ITALIC_NORMAL : ITALIC_NONE );
486 }
487
488 if( GetWhich( rSet, nWeight, nWhich ) )
489 {
490 const SvxWeightItem& rItem = static_cast<const SvxWeightItem&>( rSet.Get( nWhich ) );
491 rFont.SetWeight( rItem.GetValue() != WEIGHT_NORMAL ? WEIGHT_BOLD : WEIGHT_NORMAL );
492 }
493}
494
495static void SetPrevFontEscapement(SvxFont& rFont, sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc)
496{
497 rFont.SetPropr(nProp);
498 rFont.SetProprRel(nEscProp);
499 rFont.SetEscapement(nEsc);
500}
501
503{
504 rRenderContext.SetTextColor( svtools::ColorConfig().GetColorValue(svtools::FONTCOLOR).nColor );
505 rRenderContext.SetBackground( svtools::ColorConfig().GetColorValue(svtools::DOCCOLOR).nColor );
506}
507
509{
510 CustomWidgetController::SetDrawingArea(pDrawingArea);
511 Size aPrefSize(getPreviewStripSize(pDrawingArea->get_ref_device()));
512 pDrawingArea->set_size_request(aPrefSize.Width(), aPrefSize.Height());
513
514 pImpl.reset(new FontPrevWin_Impl);
516
517 if (pSh)
518 pImpl->mpPrinter = pSh->GetPrinter();
519
520 if (!pImpl->mpPrinter)
521 {
522 pImpl->mpPrinter = VclPtr<Printer>::Create();
523 pImpl->mbDelPrinter = true;
524 }
525 initFont(pImpl->maFont);
526 initFont(pImpl->maCJKFont);
527 initFont(pImpl->maCTLFont);
528
529 Invalidate();
530}
531
533{
534}
535
537{
538}
539
541{
542 return pImpl->maCTLFont;
543}
544
546{
547 return pImpl->maCJKFont;
548}
549
551{
552 pImpl->Invalidate100PercentFontWidth(); // because the user might change the size
553 return pImpl->maFont;
554}
555
557{
558 return pImpl->maFont;
559}
560
561void SvxFontPrevWindow::SetPreviewText( const OUString& rString )
562{
563 pImpl->maText = rString;
564 pImpl->mbTextInited = true;
565}
566
568{
569 pImpl->mbUseFontNameAsText = true;
570}
571
572void SvxFontPrevWindow::SetFont( const SvxFont& rNormalOutFont, const SvxFont& rCJKOutFont, const SvxFont& rCTLFont )
573{
574 setFont(rNormalOutFont, pImpl->maFont);
575 setFont(rCJKOutFont, pImpl->maCJKFont);
576 setFont(rCTLFont, pImpl->maCTLFont);
577
578 pImpl->Invalidate100PercentFontWidth();
579 Invalidate();
580}
581
583{
584 pImpl->mxColor = rColor;
585 Invalidate();
586}
587
589{
590 pImpl->mxColor.reset();
591 Invalidate();
592}
593
595{
596 pImpl->mxTextLineColor = rColor;
597 Invalidate();
598}
599
601{
602 pImpl->mxOverlineColor = rColor;
603 Invalidate();
604}
605
607{
608 rRenderContext.Push(vcl::PushFlags::ALL);
609 rRenderContext.SetMapMode(MapMode(MapUnit::MapTwip));
610
611 ApplySettings(rRenderContext);
612
613 Printer* pPrinter = pImpl->mpPrinter;
614 const SvxFont& rFont = pImpl->maFont;
615 const SvxFont& rCJKFont = pImpl->maCJKFont;
616 const SvxFont& rCTLFont = pImpl->maCTLFont;
617
618 if (!IsEnabled())
619 {
620 const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
621 const Size aLogSize(rRenderContext.GetOutputSize());
622
623 tools::Rectangle aRect(Point(0, 0), aLogSize);
624 rRenderContext.SetLineColor();
625 rRenderContext.SetFillColor(rStyleSettings.GetWindowColor());
626 rRenderContext.DrawRect(aRect);
627 }
628 else
629 {
630 if (!pImpl->mbSelection && !pImpl->mbTextInited)
631 {
632 using namespace css::i18n::ScriptType;
633
635
636 if (pSh && !pImpl->mbGetSelection && !pImpl->mbUseFontNameAsText)
637 {
638 pImpl->maText = pSh->GetSelectionText();
639 pImpl->mbGetSelection = true;
640 pImpl->mbSelection = !CleanAndCheckEmpty(pImpl->maText);
641 }
642
643 if (!pImpl->mbSelection || pImpl->mbUseFontNameAsText)
644 {
645 //If we're showing multiple sample texts, then they're all
646 //sample texts. If only showing Latin, continue to use
647 //the fontname as the preview
648 if ((pImpl->m_bCJKEnabled) || (pImpl->m_bCTLEnabled))
649 pImpl->maText = makeRepresentativeTextForFont(LATIN, rFont);
650 else
651 pImpl->maText = rFont.GetFamilyName();
652
653 if (pImpl->m_bCJKEnabled)
654 {
655 if (!pImpl->maText.isEmpty())
656 pImpl->maText += " ";
657 pImpl->maText += makeRepresentativeTextForFont(ASIAN, rCJKFont);
658
659 }
660 if (pImpl->m_bCTLEnabled)
661 {
662 if (!pImpl->maText.isEmpty())
663 pImpl->maText += " ";
664 pImpl->maText += makeRepresentativeTextForFont(COMPLEX, rCTLFont);
665 }
666 }
667
668 if (pImpl->maText.isEmpty())
669 { // fdo#58427: still no text? let's try that one...
670 pImpl->maText = makeRepresentativeTextForFont(LATIN, rFont);
671 }
672
673 bool bEmpty = CleanAndCheckEmpty(pImpl->maText);
674 if (bEmpty)
675 pImpl->maText = OUString();
676
677 if (pImpl->maText.getLength() > (TEXT_WIDTH - 1))
678 {
679 const sal_Int32 nSpaceIdx = pImpl->maText.indexOf(" ", TEXT_WIDTH);
680 if (nSpaceIdx != -1)
681 pImpl->maText = pImpl->maText.copy(0, nSpaceIdx);
682 else
683 pImpl->maText = pImpl->maText.copy(0, (TEXT_WIDTH - 1));
684 }
685 }
686
687 // calculate text width scaling
688 pImpl->ScaleFontWidth(rRenderContext);
689
690 pImpl->CheckScript();
691 Size aTxtSize = pImpl->CalcTextSize(rRenderContext, pPrinter, rFont);
692
693 const Size aLogSize(rRenderContext.GetOutputSize());
694
695 tools::Long nX = aLogSize.Width() / 2 - aTxtSize.Width() / 2;
696 tools::Long nY = aLogSize.Height() / 2 - aTxtSize.Height() / 2;
697
698 if (nY + pImpl->mnAscent > aLogSize.Height())
699 nY = aLogSize.Height() - pImpl->mnAscent;
700
701 if (pImpl->mxBackColor)
702 {
703 tools::Rectangle aRect(Point(0, 0), aLogSize);
704 Color aLineCol = rRenderContext.GetLineColor();
705 Color aFillCol = rRenderContext.GetFillColor();
706 rRenderContext.SetLineColor();
707 rRenderContext.SetFillColor(*pImpl->mxBackColor);
708 rRenderContext.DrawRect(aRect);
709 rRenderContext.SetLineColor(aLineCol);
710 rRenderContext.SetFillColor(aFillCol);
711 }
712 if (pImpl->mxColor)
713 {
714 tools::Rectangle aRect(Point(nX, nY), aTxtSize);
715 Color aLineCol = rRenderContext.GetLineColor();
716 Color aFillCol = rRenderContext.GetFillColor();
717 rRenderContext.SetLineColor();
718 rRenderContext.SetFillColor(*pImpl->mxColor);
719 rRenderContext.DrawRect(aRect);
720 rRenderContext.SetLineColor(aLineCol);
721 rRenderContext.SetFillColor(aFillCol);
722 }
723
724 if (pImpl->mxTextLineColor)
725 {
726 rRenderContext.SetTextLineColor(*pImpl->mxTextLineColor);
727 }
728
729 if (pImpl->mxOverlineColor)
730 {
731 rRenderContext.SetOverlineColor(*pImpl->mxOverlineColor);
732 }
733
734 tools::Long nStdAscent = pImpl->mnAscent;
735 nY += nStdAscent;
736
737 if (IsTwoLines())
738 {
739 SvxFont aSmallFont(rFont);
740 Size aOldSize = pImpl->maCJKFont.GetFontSize();
741 setFontSize(aSmallFont);
742 setFontSize(pImpl->maCJKFont);
743
744 tools::Long nStartBracketWidth = 0;
745 tools::Long nEndBracketWidth = 0;
746 tools::Long nTextWidth = 0;
747 if (pImpl->mcStartBracket)
748 {
749 OUString sBracket(pImpl->mcStartBracket);
750 nStartBracketWidth = rFont.GetTextSize(*pPrinter, sBracket).Width();
751 }
752 if (pImpl->mcEndBracket)
753 {
754 OUString sBracket(pImpl->mcEndBracket);
755 nEndBracketWidth = rFont.GetTextSize(*pPrinter, sBracket).Width();
756 }
757 nTextWidth = pImpl->CalcTextSize(rRenderContext, pPrinter, aSmallFont).Width();
758 tools::Long nResultWidth = nStartBracketWidth;
759 nResultWidth += nEndBracketWidth;
760 nResultWidth += nTextWidth;
761
762 tools::Long _nX = (aLogSize.Width() - nResultWidth) / 2;
763 rRenderContext.DrawLine(Point(0, nY), Point(_nX, nY));
764 rRenderContext.DrawLine(Point(_nX + nResultWidth, nY), Point(aLogSize.Width(), nY));
765
766 tools::Long nSmallAscent = pImpl->mnAscent;
767 tools::Long nOffset = (nStdAscent - nSmallAscent) / 2;
768
769 if (pImpl->mcStartBracket)
770 {
771 OUString sBracket(pImpl->mcStartBracket);
772 rFont.DrawPrev(&rRenderContext, pPrinter, Point(_nX, nY - nOffset - 4), sBracket);
773 _nX += nStartBracketWidth;
774 }
775
776 Point aTmpPoint1(_nX, nY - nSmallAscent - 2);
777 Point aTmpPoint2(_nX, nY);
778 pImpl->DrawPrev(rRenderContext, pPrinter, aTmpPoint1, aSmallFont);
779 pImpl->DrawPrev(rRenderContext, pPrinter, aTmpPoint2, aSmallFont);
780
781 _nX += nTextWidth;
782 if (pImpl->mcEndBracket)
783 {
784 Point aTmpPoint( _nX + 1, nY - nOffset - 4);
785 OUString sBracket(pImpl->mcEndBracket);
786 rFont.DrawPrev(&rRenderContext, pPrinter, aTmpPoint, sBracket);
787 }
788 pImpl->maCJKFont.SetFontSize(aOldSize);
789 }
790 else
791 {
792
793 Color aLineCol = rRenderContext.GetLineColor();
794
795 rRenderContext.SetLineColor(rFont.GetColor());
796 rRenderContext.DrawLine(Point(0, nY), Point(nX, nY));
797 rRenderContext.DrawLine(Point(nX + aTxtSize.Width(), nY), Point(aLogSize.Width(), nY));
798 rRenderContext.SetLineColor(aLineCol);
799
800 Point aTmpPoint(nX, nY);
801 pImpl->DrawPrev(rRenderContext, pPrinter, aTmpPoint, rFont);
802 }
803 }
804 rRenderContext.Pop();
805}
806
808{
809 return pImpl->mbTwoLines;
810}
811
813{
814 pImpl->mbTwoLines = bSet;
815}
816
818{
819 pImpl->mcStartBracket = cStart;
820 pImpl->mcEndBracket = cEnd;
821}
822
824{
825 if (pImpl->SetFontWidthScale(n))
826 Invalidate();
827}
828
830{
831 Color aColor(COL_AUTO);
832 if ( pImpl->mxBackColor ) aColor = *pImpl->mxBackColor;
833 const bool bIsDark(aColor.IsDark());
834
835 aColor = pImpl->maFont.GetColor();
836 if (aColor == COL_AUTO)
837 pImpl->maFont.SetColor( bIsDark ? COL_WHITE : COL_BLACK );
838 aColor = pImpl->maCJKFont.GetColor();
839 if (aColor == COL_AUTO)
840 pImpl->maCJKFont.SetColor( bIsDark ? COL_WHITE : COL_BLACK );
841 aColor = pImpl->maCTLFont.GetColor();
842 if (aColor == COL_AUTO)
843 pImpl->maCTLFont.SetColor( bIsDark ? COL_WHITE : COL_BLACK );
844}
845
846void SvxFontPrevWindow::SetFontSize( const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont )
847{
848 sal_uInt16 nWhich;
849 tools::Long nH;
850 if (GetWhich(rSet, nSlot, nWhich))
851 {
852 nH = OutputDevice::LogicToLogic(static_cast<const SvxFontHeightItem&>(rSet.Get(nWhich)).GetHeight(),
853 rSet.GetPool()->GetMetric(nWhich),
854 MapUnit::MapTwip);
855 }
856 else
857 nH = 240;// as default 12pt
858
859 rFont.SetFontSize(Size(0, nH));
860}
861
862void SvxFontPrevWindow::SetFontLang(const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont)
863{
864 sal_uInt16 nWhich;
865 LanguageType nLang;
866 if( GetWhich( rSet, nSlot, nWhich ) )
867 nLang = static_cast<const SvxLanguageItem&>(rSet.Get(nWhich)).GetLanguage();
868 else
869 nLang = LANGUAGE_NONE;
870 rFont.SetLanguage(nLang);
871}
872
873void SvxFontPrevWindow::SetFromItemSet(const SfxItemSet &rSet, bool bPreviewBackgroundToCharacter)
874{
875 sal_uInt16 nWhich;
876 SvxFont& rFont = GetFont();
877 SvxFont& rCJKFont = GetCJKFont();
878 SvxFont& rCTLFont = GetCTLFont();
879
880 // Preview string
881 if( GetWhich( rSet, SID_CHAR_DLG_PREVIEW_STRING, nWhich ) )
882 {
883 const SfxStringItem& rItem = static_cast<const SfxStringItem&>( rSet.Get( nWhich ) );
884 const OUString& aString = rItem.GetValue();
885 if( !aString.isEmpty() )
886 SetPreviewText( aString );
887 else
889 }
890
891 // Underline
892 FontLineStyle eUnderline;
893 if( GetWhich( rSet, SID_ATTR_CHAR_UNDERLINE, nWhich ) )
894 {
895 const SvxUnderlineItem& rItem = static_cast<const SvxUnderlineItem&>( rSet.Get( nWhich ) );
896 eUnderline = rItem.GetValue();
897 }
898 else
899 eUnderline = LINESTYLE_NONE;
900
901 rFont.SetUnderline( eUnderline );
902 rCJKFont.SetUnderline( eUnderline );
903 rCTLFont.SetUnderline( eUnderline );
904
905 // Overline
906 FontLineStyle eOverline;
907 if( GetWhich( rSet, SID_ATTR_CHAR_OVERLINE, nWhich ) )
908 {
909 const SvxOverlineItem& rItem = static_cast<const SvxOverlineItem&>( rSet.Get( nWhich ) );
910 eOverline = rItem.GetValue();
911 }
912 else
913 eOverline = LINESTYLE_NONE;
914
915 rFont.SetOverline( eOverline );
916 rCJKFont.SetOverline( eOverline );
917 rCTLFont.SetOverline( eOverline );
918
919 // Strikeout
920 FontStrikeout eStrikeout;
921 if( GetWhich( rSet, SID_ATTR_CHAR_STRIKEOUT, nWhich ) )
922 {
923 const SvxCrossedOutItem& rItem = static_cast<const SvxCrossedOutItem&>( rSet.Get( nWhich ) );
924 eStrikeout = rItem.GetValue();
925 }
926 else
927 eStrikeout = STRIKEOUT_NONE;
928
929 rFont.SetStrikeout( eStrikeout );
930 rCJKFont.SetStrikeout( eStrikeout );
931 rCTLFont.SetStrikeout( eStrikeout );
932
933 // WordLineMode
934 if( GetWhich( rSet, SID_ATTR_CHAR_WORDLINEMODE, nWhich ) )
935 {
936 const SvxWordLineModeItem& rItem = static_cast<const SvxWordLineModeItem&>( rSet.Get( nWhich ) );
937 rFont.SetWordLineMode( rItem.GetValue() );
938 rCJKFont.SetWordLineMode( rItem.GetValue() );
939 rCTLFont.SetWordLineMode( rItem.GetValue() );
940 }
941
942 // Emphasis
943 if( GetWhich( rSet, SID_ATTR_CHAR_EMPHASISMARK, nWhich ) )
944 {
945 const SvxEmphasisMarkItem& rItem = static_cast<const SvxEmphasisMarkItem&>( rSet.Get( nWhich ) );
946 FontEmphasisMark eMark = rItem.GetEmphasisMark();
947 rFont.SetEmphasisMark( eMark );
948 rCJKFont.SetEmphasisMark( eMark );
949 rCTLFont.SetEmphasisMark( eMark );
950 }
951
952 // Relief
953 if( GetWhich( rSet, SID_ATTR_CHAR_RELIEF, nWhich ) )
954 {
955 const SvxCharReliefItem& rItem = static_cast<const SvxCharReliefItem&>( rSet.Get( nWhich ) );
956 FontRelief eFontRelief = rItem.GetValue();
957 rFont.SetRelief( eFontRelief );
958 rCJKFont.SetRelief( eFontRelief );
959 rCTLFont.SetRelief( eFontRelief );
960 }
961
962 // Effects
963 if( GetWhich( rSet, SID_ATTR_CHAR_CASEMAP, nWhich ) )
964 {
965 const SvxCaseMapItem& rItem = static_cast<const SvxCaseMapItem&>( rSet.Get( nWhich ) );
966 SvxCaseMap eCaseMap = rItem.GetValue();
967 rFont.SetCaseMap( eCaseMap );
968 rCJKFont.SetCaseMap( eCaseMap );
969 // #i78474# small caps do not exist in CTL fonts
970 rCTLFont.SetCaseMap( eCaseMap == SvxCaseMap::SmallCaps ? SvxCaseMap::NotMapped : eCaseMap );
971 }
972
973 // Outline
974 if( GetWhich( rSet, SID_ATTR_CHAR_CONTOUR, nWhich ) )
975 {
976 const SvxContourItem& rItem = static_cast<const SvxContourItem&>( rSet.Get( nWhich ) );
977 bool bOutline = rItem.GetValue();
978 rFont.SetOutline( bOutline );
979 rCJKFont.SetOutline( bOutline );
980 rCTLFont.SetOutline( bOutline );
981 }
982
983 // Shadow
984 if( GetWhich( rSet, SID_ATTR_CHAR_SHADOWED, nWhich ) )
985 {
986 const SvxShadowedItem& rItem = static_cast<const SvxShadowedItem&>( rSet.Get( nWhich ) );
987 bool bShadow = rItem.GetValue();
988 rFont.SetShadow( bShadow );
989 rCJKFont.SetShadow( bShadow );
990 rCTLFont.SetShadow( bShadow );
991 }
992
993 // Background
994 bool bTransparent;
995 if( GetWhich( rSet, bPreviewBackgroundToCharacter ? SID_ATTR_BRUSH : SID_ATTR_BRUSH_CHAR, nWhich ) )
996 {
997 const SvxBrushItem& rBrush = static_cast<const SvxBrushItem&>( rSet.Get( nWhich ) );
998 const Color& rColor = rBrush.GetColor();
999 bTransparent = rColor.IsTransparent();
1000 rFont.SetFillColor( rColor );
1001 rCJKFont.SetFillColor( rColor );
1002 rCTLFont.SetFillColor( rColor );
1003 }
1004 else
1005 bTransparent = true;
1006
1007 rFont.SetTransparent( bTransparent );
1008 rCJKFont.SetTransparent( bTransparent );
1009 rCTLFont.SetTransparent( bTransparent );
1010
1011 if( !bPreviewBackgroundToCharacter )
1012 {
1013 if( GetWhich( rSet, SID_ATTR_BRUSH, nWhich ) )
1014 {
1015 const SvxBrushItem& rBrush = static_cast<const SvxBrushItem&>( rSet.Get( nWhich ) );
1016 if( GPOS_NONE == rBrush.GetGraphicPos() )
1017 pImpl->mxBackColor = rBrush.GetColor();
1018 }
1019 }
1020
1021 // Font
1022 SetPrevFont( rSet, SID_ATTR_CHAR_FONT, rFont );
1023 SetPrevFont( rSet, SID_ATTR_CHAR_CJK_FONT, rCJKFont );
1024 SetPrevFont( rSet, SID_ATTR_CHAR_CTL_FONT, rCTLFont );
1025
1026 // Style
1027 SetPrevFontStyle( rSet, SID_ATTR_CHAR_POSTURE, SID_ATTR_CHAR_WEIGHT, rFont );
1028 SetPrevFontStyle( rSet, SID_ATTR_CHAR_CJK_POSTURE, SID_ATTR_CHAR_CJK_WEIGHT, rCJKFont );
1029 SetPrevFontStyle( rSet, SID_ATTR_CHAR_CTL_POSTURE, SID_ATTR_CHAR_CTL_WEIGHT, rCTLFont );
1030
1031 // Size
1032 SetFontSize( rSet, SID_ATTR_CHAR_FONTHEIGHT, rFont );
1033 SetFontSize( rSet, SID_ATTR_CHAR_CJK_FONTHEIGHT, rCJKFont );
1034 SetFontSize( rSet, SID_ATTR_CHAR_CTL_FONTHEIGHT, rCTLFont );
1035
1036 // Language
1037 SetFontLang( rSet, SID_ATTR_CHAR_LANGUAGE, rFont );
1038 SetFontLang( rSet, SID_ATTR_CHAR_CJK_LANGUAGE, rCJKFont );
1039 SetFontLang( rSet, SID_ATTR_CHAR_CTL_LANGUAGE, rCTLFont );
1040
1041 // Color
1042 if( GetWhich( rSet, SID_ATTR_CHAR_COLOR, nWhich ) )
1043 {
1044 const SvxColorItem& rItem = static_cast<const SvxColorItem&>( rSet.Get( nWhich ) );
1045 Color aCol( rItem.GetValue() );
1046 rFont.SetColor( aCol );
1047
1048 rCJKFont.SetColor( aCol );
1049 rCTLFont.SetColor( aCol );
1050
1051 AutoCorrectFontColor(); // handle color COL_AUTO
1052 }
1053
1054 // Kerning
1055 if( GetWhich( rSet, SID_ATTR_CHAR_KERNING, nWhich ) )
1056 {
1057 const SvxKerningItem& rItem = static_cast<const SvxKerningItem&>( rSet.Get( nWhich ) );
1058 short nKern = static_cast<short>(OutputDevice::LogicToLogic(rItem.GetValue(), rSet.GetPool()->GetMetric(nWhich), MapUnit::MapTwip));
1059 rFont.SetFixKerning( nKern );
1060 rCJKFont.SetFixKerning( nKern );
1061 rCTLFont.SetFixKerning( nKern );
1062 }
1063
1064 // Escapement
1065 const sal_uInt8 nProp = 100;
1066 short nEsc;
1067 sal_uInt8 nEscProp;
1068 if( GetWhich( rSet, SID_ATTR_CHAR_ESCAPEMENT, nWhich ) )
1069 {
1070 const SvxEscapementItem& rItem = static_cast<const SvxEscapementItem&>( rSet.Get( nWhich ) );
1071 nEsc = rItem.GetEsc();
1072 nEscProp = rItem.GetProportionalHeight();
1073
1074 if( nEsc == DFLT_ESC_AUTO_SUPER )
1075 nEsc = DFLT_ESC_SUPER;
1076 else if( nEsc == DFLT_ESC_AUTO_SUB )
1077 nEsc = DFLT_ESC_SUB;
1078 }
1079 else
1080 {
1081 nEsc = 0;
1082 nEscProp = 100;
1083 }
1084 SetPrevFontEscapement( rFont, nProp, nEscProp, nEsc );
1085 SetPrevFontEscapement( rCJKFont, nProp, nEscProp, nEsc );
1086 SetPrevFontEscapement( rCTLFont, nProp, nEscProp, nEsc );
1087
1088 // Font width scale
1089 if( GetWhich( rSet, SID_ATTR_CHAR_SCALEWIDTH, nWhich ) )
1090 {
1091 const SvxCharScaleWidthItem&rItem = static_cast<const SvxCharScaleWidthItem&>( rSet.Get( nWhich ) );
1092 SetFontWidthScale( rItem.GetValue() );
1093 }
1094
1095 Invalidate();
1096}
1097
1098/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define COMPLEX
#define ASIAN
GPOS_NONE
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
const OUString & GetValue() const
bool IsDark() const
bool IsTransparent() const
tools::Long GetLineHeight() const
tools::Long GetAscent() const
bool SetFontWidthScale(sal_uInt16 nScaleInPercent)
Definition: fntctrl.cxx:434
Size CalcTextSize(vcl::RenderContext &rRenderContext, OutputDevice const *pPrinter, const SvxFont &rFont)
Definition: fntctrl.cxx:298
sal_Unicode mcStartBracket
Definition: fntctrl.cxx:160
tools::Long mn100PercentFontWidthCTL
Definition: fntctrl.cxx:165
bool Is100PercentFontWidthValid() const
Definition: fntctrl.cxx:221
std::optional< Color > mxBackColor
Definition: fntctrl.cxx:156
void Invalidate100PercentFontWidth()
Definition: fntctrl.cxx:216
bool mbUseFontNameAsText
Definition: fntctrl.cxx:171
tools::Long mnAscent
Definition: fntctrl.cxx:159
std::optional< Color > mxOverlineColor
Definition: fntctrl.cxx:158
void CheckScript()
Definition: fntctrl.cxx:237
OUString maScriptText
Definition: fntctrl.cxx:154
sal_uInt16 mnFontWidthScale
Definition: fntctrl.cxx:166
SvxFont maFont
Definition: fntctrl.cxx:143
tools::Long mn100PercentFontWidth
Definition: fntctrl.cxx:163
std::vector< tools::Long > maTextWidth
Definition: fntctrl.cxx:148
OUString maText
Definition: fntctrl.cxx:153
sal_Unicode mcEndBracket
Definition: fntctrl.cxx:161
void DrawPrev(vcl::RenderContext &rRenderContext, Printer *pPrinter, Point &rPt, const SvxFont &rFont)
Definition: fntctrl.cxx:390
std::optional< Color > mxTextLineColor
Definition: fntctrl.cxx:157
Reference< XBreakIterator > mxBreak
Definition: fntctrl.cxx:147
SvxFont maCTLFont
Definition: fntctrl.cxx:152
std::optional< Color > mxColor
Definition: fntctrl.cxx:155
SvxFont maCJKFont
Definition: fntctrl.cxx:151
std::vector< sal_uInt16 > maScriptType
Definition: fntctrl.cxx:150
VclPtr< Printer > mpPrinter
Definition: fntctrl.cxx:144
std::deque< sal_Int32 > maScriptChg
Definition: fntctrl.cxx:149
void ScaleFontWidth(vcl::RenderContext const &rRenderContext)
Definition: fntctrl.cxx:445
tools::Long mn100PercentFontWidthCJK
Definition: fntctrl.cxx:164
Size GetOutputSize() const
const vcl::Font & GetFont() const
void SetFont(const vcl::Font &rNewFont)
void DrawRect(const tools::Rectangle &rRect)
void DrawLine(const Point &rStartPt, const Point &rEndPt)
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
void SetLineColor()
void SetMapMode()
void SetTextColor(const Color &rColor)
void SetFillColor()
FontMetric GetFontMetric() const
const Color & GetLineColor() const
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
void SetBackground()
void SetOverlineColor()
void SetTextLineColor()
const Color & GetFillColor() const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
SfxItemPool * GetPool() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual SfxPrinter * GetPrinter(bool bCreate=false)
virtual OUString GetSelectionText(bool bCompleteWords=false)
static SfxViewShell * Current()
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
const Color & GetWindowColor() const
bool IsCTLFontEnabled() const
const Color & GetColor() const
SvxGraphicPosition GetGraphicPos() const
const Color & GetValue() const
FontEmphasisMark GetEmphasisMark() const
sal_uInt8 & GetProportionalHeight()
sal_uInt32 GetHeight() const
FontFamily GetFamily() const
FontPitch GetPitch() const
const OUString & GetStyleName() const
rtl_TextEncoding GetCharSet() const
const OUString & GetFamilyName() const
SvxFont & GetFont()
Definition: fntctrl.cxx:550
void SetBrackets(sal_Unicode cStart, sal_Unicode cEnd)
Definition: fntctrl.cxx:817
SvxFont & GetCTLFont()
Definition: fntctrl.cxx:540
static SVX_DLLPRIVATE void SetFontSize(const SfxItemSet &rSet, sal_uInt16 nSlot, SvxFont &rFont)
Definition: fntctrl.cxx:846
void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &) override
Definition: fntctrl.cxx:606
void SetTwoLines(bool bSet)
Definition: fntctrl.cxx:812
static SVX_DLLPRIVATE void ApplySettings(vcl::RenderContext &rRenderContext)
Definition: fntctrl.cxx:502
void SetPreviewText(const OUString &rString)
Definition: fntctrl.cxx:561
void SetColor(const Color &rColor)
Definition: fntctrl.cxx:582
bool IsTwoLines() const
Definition: fntctrl.cxx:807
void SetFontNameAsPreviewText()
Definition: fntctrl.cxx:567
void AutoCorrectFontColor()
Definition: fntctrl.cxx:829
void SetFont(const SvxFont &rNormalFont, const SvxFont &rCJKFont, const SvxFont &rCTLFont)
Definition: fntctrl.cxx:572
void SetTextLineColor(const Color &rColor)
Definition: fntctrl.cxx:594
SvxFont & GetCJKFont()
Definition: fntctrl.cxx:545
void SetOverlineColor(const Color &rColor)
Definition: fntctrl.cxx:600
std::unique_ptr< FontPrevWin_Impl > pImpl
Definition: fntctrl.hxx:34
static SVX_DLLPRIVATE void SetFontLang(const SfxItemSet &rSet, sal_uInt16 nSlot, SvxFont &rFont)
Definition: fntctrl.cxx:862
void SetFontWidthScale(sal_uInt16 nScaleInPercent)
Definition: fntctrl.cxx:823
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: fntctrl.cxx:508
void SetFromItemSet(const SfxItemSet &rSet, bool bPreviewBackgroundToCharacter)
Definition: fntctrl.cxx:873
virtual ~SvxFontPrevWindow() override
Definition: fntctrl.cxx:536
Size GetTextSize(const OutputDevice &rOut, const OUString &rTxt, const sal_Int32 nIdx=0, const sal_Int32 nLen=SAL_MAX_INT32) const
void SetPropr(const sal_uInt8 nNewPropr)
void SetEscapement(const short nNewEsc)
void SetFixKerning(const short nNewKern)
void SetProprRel(const sal_uInt8 nNewPropr)
void DrawPrev(OutputDevice *pOut, Printer *pPrinter, const Point &rPos, const OUString &rTxt, const sal_Int32 nIdx=0, const sal_Int32 nLen=SAL_MAX_INT32) const
void SetCaseMap(const SvxCaseMap eNew)
void disposeAndClear()
static VclPtr< reference_type > Create(Arg &&... arg)
ColorConfigValue GetColorValue(ColorConfigEntry eEntry, bool bSmart=true) const
void SetFontSize(const Size &)
void SetAverageFontWidth(tools::Long nWidth)
void SetTransparent(bool bTransparent)
const Size & GetFontSize() const
void SetAlignment(TextAlign)
tools::Long GetAverageFontWidth() const
virtual OutputDevice & get_ref_device()=0
virtual void set_size_request(int nWidth, int nHeight)=0
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
#define DBG_ASSERT(sCon, aError)
Size SFX2_DLLPUBLIC getPreviewStripSize(const OutputDevice &rReference)
float u
#define DFLT_ESC_SUB
#define DFLT_ESC_SUPER
#define DFLT_ESC_AUTO_SUB
#define DFLT_ESC_AUTO_SUPER
static bool GetWhich(const SfxItemSet &rSet, sal_uInt16 nSlot, sal_uInt16 &rWhich)
Definition: fntctrl.cxx:459
static void SetPrevFont(const SfxItemSet &rSet, sal_uInt16 nSlot, SvxFont &rFont)
Definition: fntctrl.cxx:465
static void SetPrevFontStyle(const SfxItemSet &rSet, sal_uInt16 nPosture, sal_uInt16 nWeight, SvxFont &rFont)
Definition: fntctrl.cxx:479
#define TEXT_WIDTH
Definition: fntctrl.cxx:71
static void SetPrevFontEscapement(SvxFont &rFont, sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc)
Definition: fntctrl.cxx:495
FontRelief
FontLineStyle
LINESTYLE_NONE
FontStrikeout
STRIKEOUT_NONE
ITALIC_NORMAL
ITALIC_NONE
FontEmphasisMark
ALIGN_BASELINE
WEIGHT_BOLD
WEIGHT_NORMAL
sal_Int64 n
#define LANGUAGE_NONE
bool IsAnyEnabled()
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
int i
long Long
QPRO_FUNC_TYPE nType
SVT_DLLPUBLIC OUString makeRepresentativeTextForFont(sal_Int16 nScriptType, const vcl::Font &rFont)
static SfxItemSet & rSet
SvxCaseMap
unsigned char sal_uInt8
sal_uInt16 sal_Unicode