22#include <com/sun/star/beans/XMultiPropertySet.hpp>
23#include <com/sun/star/beans/PropertyAttribute.hpp>
24#include <com/sun/star/awt/FontSlant.hpp>
25#include <com/sun/star/lang/Locale.hpp>
27#include <com/sun/star/awt/FontUnderline.hpp>
28#include <com/sun/star/awt/FontWeight.hpp>
29#include <com/sun/star/text/FontRelief.hpp>
30#include <com/sun/star/text/FontEmphasis.hpp>
31#include <com/sun/star/awt/FontStrikeout.hpp>
32#include <com/sun/star/text/WritingMode2.hpp>
33#include <com/sun/star/i18n/ScriptType.hpp>
34#include <osl/diagnose.h>
43using ::com::sun::star::beans::Property;
49 std::vector< Property > & rOutProperties )
52 rOutProperties.emplace_back(
"CharFontName",
55 beans::PropertyAttribute::BOUND
56 | beans::PropertyAttribute::MAYBEDEFAULT );
57 rOutProperties.emplace_back(
"CharFontStyleName",
60 beans::PropertyAttribute::BOUND
61 | beans::PropertyAttribute::MAYBEDEFAULT
62 | beans::PropertyAttribute::MAYBEVOID );
64 rOutProperties.emplace_back(
"CharFontFamily",
67 beans::PropertyAttribute::BOUND
68 | beans::PropertyAttribute::MAYBEDEFAULT );
70 rOutProperties.emplace_back(
"CharFontCharSet",
71 PROP_CHAR_FONT_CHAR_SET,
73 beans::PropertyAttribute::BOUND
74 | beans::PropertyAttribute::MAYBEDEFAULT );
76 rOutProperties.emplace_back(
"CharFontPitch",
79 beans::PropertyAttribute::BOUND
80 | beans::PropertyAttribute::MAYBEDEFAULT );
82 rOutProperties.emplace_back(
"CharColor",
85 beans::PropertyAttribute::BOUND
86 | beans::PropertyAttribute::MAYBEDEFAULT );
88 rOutProperties.emplace_back(
"CharEscapement",
91 beans::PropertyAttribute::BOUND
92 | beans::PropertyAttribute::MAYBEVOID );
94 rOutProperties.emplace_back(
"CharHeight",
97 beans::PropertyAttribute::BOUND
98 | beans::PropertyAttribute::MAYBEDEFAULT );
100 rOutProperties.emplace_back(
"CharUnderline",
103 beans::PropertyAttribute::BOUND
104 | beans::PropertyAttribute::MAYBEDEFAULT );
106 rOutProperties.emplace_back(
"CharUnderlineColor",
107 PROP_CHAR_UNDERLINE_COLOR,
109 beans::PropertyAttribute::BOUND
110 | beans::PropertyAttribute::MAYBEDEFAULT
111 | beans::PropertyAttribute::MAYBEVOID );
113 rOutProperties.emplace_back(
"CharUnderlineHasColor",
114 PROP_CHAR_UNDERLINE_HAS_COLOR,
116 beans::PropertyAttribute::BOUND
117 | beans::PropertyAttribute::MAYBEDEFAULT );
119 rOutProperties.emplace_back(
"CharOverline",
122 beans::PropertyAttribute::BOUND
123 | beans::PropertyAttribute::MAYBEDEFAULT );
125 rOutProperties.emplace_back(
"CharOverlineColor",
128 beans::PropertyAttribute::BOUND
129 | beans::PropertyAttribute::MAYBEDEFAULT
130 | beans::PropertyAttribute::MAYBEVOID );
132 rOutProperties.emplace_back(
"CharOverlineHasColor",
135 beans::PropertyAttribute::BOUND
136 | beans::PropertyAttribute::MAYBEDEFAULT );
138 rOutProperties.emplace_back(
"CharWeight",
141 beans::PropertyAttribute::BOUND
142 | beans::PropertyAttribute::MAYBEDEFAULT );
144 rOutProperties.emplace_back(
"CharPosture",
147 beans::PropertyAttribute::BOUND
148 | beans::PropertyAttribute::MAYBEDEFAULT );
149 rOutProperties.emplace_back(
"CharAutoKerning",
150 PROP_CHAR_AUTO_KERNING,
152 beans::PropertyAttribute::BOUND
153 | beans::PropertyAttribute::MAYBEDEFAULT
154 | beans::PropertyAttribute::MAYBEVOID );
155 rOutProperties.emplace_back(
"CharKerning",
158 beans::PropertyAttribute::BOUND
159 | beans::PropertyAttribute::MAYBEDEFAULT
160 | beans::PropertyAttribute::MAYBEVOID );
162 rOutProperties.emplace_back(
"CharEscapementHeight",
163 PROP_CHAR_ESCAPEMENT_HEIGHT,
165 beans::PropertyAttribute::BOUND
166 | beans::PropertyAttribute::MAYBEVOID );
168 rOutProperties.emplace_back(
"CharStrikeout",
171 beans::PropertyAttribute::BOUND
172 | beans::PropertyAttribute::MAYBEDEFAULT );
174 rOutProperties.emplace_back(
"CharWordMode",
177 beans::PropertyAttribute::BOUND
178 | beans::PropertyAttribute::MAYBEDEFAULT );
180 rOutProperties.emplace_back(
"CharLocale",
184 beans::PropertyAttribute::MAYBEDEFAULT );
186 rOutProperties.emplace_back(
"CharShadowed",
189 beans::PropertyAttribute::BOUND
190 | beans::PropertyAttribute::MAYBEDEFAULT );
192 rOutProperties.emplace_back(
"CharContoured",
195 beans::PropertyAttribute::BOUND
196 | beans::PropertyAttribute::MAYBEDEFAULT );
198 rOutProperties.emplace_back(
"CharRelief",
201 beans::PropertyAttribute::BOUND
202 | beans::PropertyAttribute::MAYBEDEFAULT );
205 rOutProperties.emplace_back(
"CharEmphasis",
208 beans::PropertyAttribute::BOUND
209 | beans::PropertyAttribute::MAYBEDEFAULT );
213 rOutProperties.emplace_back(
"CharFontNameAsian",
216 beans::PropertyAttribute::BOUND
217 | beans::PropertyAttribute::MAYBEDEFAULT );
219 rOutProperties.emplace_back(
"CharFontStyleNameAsian",
222 beans::PropertyAttribute::BOUND
223 | beans::PropertyAttribute::MAYBEDEFAULT
224 | beans::PropertyAttribute::MAYBEVOID );
226 rOutProperties.emplace_back(
"CharFontFamilyAsian",
229 beans::PropertyAttribute::BOUND
230 | beans::PropertyAttribute::MAYBEDEFAULT );
232 rOutProperties.emplace_back(
"CharFontCharSetAsian",
235 beans::PropertyAttribute::BOUND
236 | beans::PropertyAttribute::MAYBEDEFAULT );
238 rOutProperties.emplace_back(
"CharFontPitchAsian",
241 beans::PropertyAttribute::BOUND
242 | beans::PropertyAttribute::MAYBEDEFAULT );
244 rOutProperties.emplace_back(
"CharHeightAsian",
247 beans::PropertyAttribute::BOUND
248 | beans::PropertyAttribute::MAYBEDEFAULT );
250 rOutProperties.emplace_back(
"CharWeightAsian",
253 beans::PropertyAttribute::BOUND
254 | beans::PropertyAttribute::MAYBEDEFAULT );
256 rOutProperties.emplace_back(
"CharPostureAsian",
259 beans::PropertyAttribute::BOUND
260 | beans::PropertyAttribute::MAYBEDEFAULT );
262 rOutProperties.emplace_back(
"CharLocaleAsian",
266 beans::PropertyAttribute::MAYBEDEFAULT );
271 rOutProperties.emplace_back(
"CharFontNameComplex",
274 beans::PropertyAttribute::BOUND
275 | beans::PropertyAttribute::MAYBEDEFAULT );
277 rOutProperties.emplace_back(
"CharFontStyleNameComplex",
280 beans::PropertyAttribute::BOUND
281 | beans::PropertyAttribute::MAYBEDEFAULT
282 | beans::PropertyAttribute::MAYBEVOID );
284 rOutProperties.emplace_back(
"CharFontFamilyComplex",
287 beans::PropertyAttribute::BOUND
288 | beans::PropertyAttribute::MAYBEDEFAULT );
290 rOutProperties.emplace_back(
"CharFontCharSetComplex",
293 beans::PropertyAttribute::BOUND
294 | beans::PropertyAttribute::MAYBEDEFAULT );
296 rOutProperties.emplace_back(
"CharFontPitchComplex",
299 beans::PropertyAttribute::BOUND
300 | beans::PropertyAttribute::MAYBEDEFAULT );
302 rOutProperties.emplace_back(
"CharHeightComplex",
305 beans::PropertyAttribute::BOUND
306 | beans::PropertyAttribute::MAYBEDEFAULT );
308 rOutProperties.emplace_back(
"CharWeightComplex",
311 beans::PropertyAttribute::BOUND
312 | beans::PropertyAttribute::MAYBEDEFAULT );
314 rOutProperties.emplace_back(
"CharPostureComplex",
317 beans::PropertyAttribute::BOUND
318 | beans::PropertyAttribute::MAYBEDEFAULT );
320 rOutProperties.emplace_back(
"CharLocaleComplex",
324 beans::PropertyAttribute::MAYBEDEFAULT );
327 rOutProperties.emplace_back(
"WritingMode",
330 beans::PropertyAttribute::BOUND
331 | beans::PropertyAttribute::MAYBEDEFAULT );
333 rOutProperties.emplace_back(
"ParaIsCharacterDistance",
336 beans::PropertyAttribute::BOUND
337 | beans::PropertyAttribute::MAYBEDEFAULT );
343 const float fDefaultFontHeight = 13.0;
346 lang::Locale aDefaultLocale;
347 aLinguConfig.
GetProperty(
u"DefaultLocale") >>= aDefaultLocale;
348 lang::Locale aDefaultLocale_CJK;
349 aLinguConfig.
GetProperty(
u"DefaultLocale_CJK") >>= aDefaultLocale_CJK;
350 lang::Locale aDefaultLocale_CTL;
351 aLinguConfig.
GetProperty(
u"DefaultLocale_CTL") >>= aDefaultLocale_CTL;
353 using namespace ::com::sun::star::i18n::ScriptType;
422 awt::FontDescriptor aResult;
436 uno::Sequence< uno::Any > aValues( xMultiPropSet->getPropertyValues( aPropNameSeq ));
440 aValues[
i++ ] >>= aResult.CharSet;
441 aValues[
i++ ] >>= aResult.Family;
442 aValues[
i++ ] >>= aResult.Name;
443 aValues[
i++ ] >>= aResult.Pitch;
444 aValues[
i++ ] >>= aResult.StyleName;
445 float fCharHeight = 0;
446 aValues[
i++ ] >>= fCharHeight;
447 aResult.Height =
static_cast< sal_Int16
>( fCharHeight );
448 aValues[
i++ ] >>= aResult.Slant;
449 aValues[
i++ ] >>= aResult.Strikeout;
450 aValues[
i++ ] >>= aResult.Underline;
451 aValues[
i++ ] >>= aResult.Weight;
452 aValues[
i++ ] >>= aResult.WordLineMode;
453 OSL_ASSERT( i == aValues.getLength());
static LanguageType convertToLanguageType(const css::lang::Locale &rLocale, bool bResolveSystem=true)
static LanguageType resolveSystemLanguageByScriptType(LanguageType nLang, sal_Int16 nType)
static vcl::Font GetDefaultFont(DefaultFontType nType, LanguageType eLang, GetDefaultFontFlags nFlags, const OutputDevice *pOutDev=nullptr)
css::uno::Any GetProperty(std::u16string_view rPropertyName) const
FontFamily GetFamilyType()
const OUString & GetStyleName() const
const OUString & GetFamilyName() const
rtl_TextEncoding GetCharSet() const
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
OOO_DLLPUBLIC_CHARTTOOLS css::awt::FontDescriptor createFontDescriptorFromPropertySet(const css::uno::Reference< css::beans::XMultiPropertySet > &xMultiPropSet)
OOO_DLLPUBLIC_CHARTTOOLS void AddDefaultsToMap(::chart::tPropertyValueMap &rOutMap)
OOO_DLLPUBLIC_CHARTTOOLS bool IsCharacterPropertyHandle(sal_Int32 nHandle)
@ PROP_CHAR_COMPLEX_CHAR_HEIGHT
@ PROP_CHAR_ASIAN_CHAR_SET
@ PROP_CHAR_COMPLEX_FONT_NAME
@ PROP_CHAR_COMPLEX_LOCALE
@ PROP_CHAR_COMPLEX_FONT_FAMILY
@ PROP_CHAR_ASIAN_FONT_PITCH
@ PROP_CHAR_COMPLEX_FONT_PITCH
@ PROP_CHAR_FONT_STYLE_NAME
@ PROP_CHAR_ASIAN_FONT_STYLE_NAME
@ PROP_CHAR_OVERLINE_HAS_COLOR
@ PROP_CHAR_COMPLEX_FONT_STYLE_NAME
@ PROP_PARA_IS_CHARACTER_DISTANCE
@ PROP_CHAR_ASIAN_FONT_FAMILY
@ PROP_CHAR_ASIAN_POSTURE
@ PROP_CHAR_ASIAN_CHAR_HEIGHT
@ PROP_CHAR_ASIAN_FONT_NAME
@ PROP_CHAR_COMPLEX_POSTURE
@ FAST_PROPERTY_ID_END_CHAR_PROP
@ PROP_CHAR_COMPLEX_WEIGHT
@ PROP_CHAR_OVERLINE_COLOR
@ PROP_CHAR_COMPLEX_CHAR_SET
OOO_DLLPUBLIC_CHARTTOOLS void AddPropertiesToVector(std::vector< css::beans::Property > &rOutProperties)
void setPropertyValueDefault(tPropertyValueMap &rOutMap, tPropertyValueMapKey key, const Value &value)
Calls setPropertyValue() but asserts that the given property hasn't been set before.
@ FAST_PROPERTY_ID_START_CHAR_PROP
std::unordered_map< tPropertyValueMapKey, css::uno::Any > tPropertyValueMap
PROP_CHAR_UNDERLINE_COLOR
PROP_CHAR_UNDERLINE_HAS_COLOR