1 // Scintilla source code edit control
3 ** Defines the font and colour style for a class of text.
5 // Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
6 // The License.txt file describes the conditions under which this software may be distributed.
14 #include "ScintillaTypes.h"
16 #include "Debugging.h"
22 using namespace Scintilla
;
23 using namespace Scintilla::Internal
;
25 bool FontSpecification::operator==(const FontSpecification
&other
) const noexcept
{
26 return fontName
== other
.fontName
&&
27 weight
== other
.weight
&&
28 italic
== other
.italic
&&
30 characterSet
== other
.characterSet
&&
31 extraFontFlag
== other
.extraFontFlag
&&
32 checkMonospaced
== other
.checkMonospaced
;
35 bool FontSpecification::operator<(const FontSpecification
&other
) const noexcept
{
36 if (fontName
!= other
.fontName
)
37 return fontName
< other
.fontName
;
38 if (weight
!= other
.weight
)
39 return weight
< other
.weight
;
40 if (italic
!= other
.italic
)
42 if (size
!= other
.size
)
43 return size
< other
.size
;
44 if (characterSet
!= other
.characterSet
)
45 return characterSet
< other
.characterSet
;
46 if (extraFontFlag
!= other
.extraFontFlag
)
47 return extraFontFlag
< other
.extraFontFlag
;
48 if (checkMonospaced
!= other
.checkMonospaced
)
49 return checkMonospaced
< other
.checkMonospaced
;
55 // noexcept Platform::DefaultFontSize
56 int DefaultFontSize() noexcept
{
58 return Platform::DefaultFontSize();
66 Style::Style(const char *fontName_
) noexcept
:
67 FontSpecification(fontName_
, DefaultFontSize() * FontSizeMultiplier
),
69 back(0xff, 0xff, 0xff),
72 caseForce(CaseForce::mixed
),
78 void Style::Copy(std::shared_ptr
<Font
> font_
, const FontMeasurements
&fm_
) noexcept
{
79 font
= std::move(font_
);
80 (FontMeasurements
&)(*this) = fm_
;