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