26#include <com/sun/star/lang/XMultiServiceFactory.hpp>
27#include <com/sun/star/lang/XServiceInfo.hpp>
28#include <com/sun/star/beans/XMaterialHolder.hpp>
29#include <com/sun/star/awt/FontDescriptor.hpp>
30#include <com/sun/star/awt/FontFamily.hpp>
31#include <com/sun/star/awt/FontPitch.hpp>
32#include <com/sun/star/awt/FontWeight.hpp>
33#include <com/sun/star/awt/FontSlant.hpp>
34#include <com/sun/star/lang/XInitialization.hpp>
53 FontIdentificator() {}
61 virtual void SAL_CALL initialize(
const Sequence< Any >& )
override;
64 virtual Any SAL_CALL getMaterial()
override;
70void SAL_CALL FontIdentificator::initialize(
const Sequence<Any>& i_rArgs )
76 for(
const auto& rArg : i_rArgs )
78 if( rArg >>= aFontBuf )
86Any SAL_CALL FontIdentificator::getMaterial()
97 aFD.CharacterWidth = 0;
102 aFD.WordLineMode =
false;
107 case FAMILY_MODERN: aFD.Family = css::awt::FontFamily::MODERN;
break;
108 case FAMILY_ROMAN: aFD.Family = css::awt::FontFamily::ROMAN;
break;
109 case FAMILY_SCRIPT: aFD.Family = css::awt::FontFamily::SCRIPT;
break;
110 case FAMILY_SWISS: aFD.Family = css::awt::FontFamily::SWISS;
break;
111 case FAMILY_SYSTEM: aFD.Family = css::awt::FontFamily::SYSTEM;
break;
113 aFD.Family = css::awt::FontFamily::DONTKNOW;
118 case PITCH_VARIABLE: aFD.Pitch = css::awt::FontPitch::VARIABLE;
break;
119 case PITCH_FIXED: aFD.Pitch = css::awt::FontPitch::FIXED;
break;
121 aFD.Pitch = css::awt::FontPitch::DONTKNOW;
126 case WEIGHT_THIN: aFD.Weight = css::awt::FontWeight::THIN;
break;
128 case WEIGHT_LIGHT: aFD.Weight = css::awt::FontWeight::LIGHT;
break;
131 case WEIGHT_NORMAL: aFD.Weight = css::awt::FontWeight::NORMAL;
break;
132 case WEIGHT_SEMIBOLD: aFD.Weight = css::awt::FontWeight::SEMIBOLD;
break;
133 case WEIGHT_BOLD: aFD.Weight = css::awt::FontWeight::BOLD;
break;
135 case WEIGHT_BLACK: aFD.Weight = css::awt::FontWeight::BLACK;
break;
137 aFD.Weight = css::awt::FontWeight::DONTKNOW;
142 case ITALIC_OBLIQUE: aFD.Slant = css::awt::FontSlant_OBLIQUE;
break;
143 case ITALIC_NORMAL: aFD.Slant = css::awt::FontSlant_ITALIC;
break;
145 aFD.Slant = css::awt::FontSlant_DONTKNOW;
152OUString SAL_CALL FontIdentificator::getImplementationName()
154 return "vcl::FontIdentificator";
157sal_Bool SAL_CALL FontIdentificator::supportsService(
const OUString& i_rServiceName )
162Sequence< OUString > SAL_CALL FontIdentificator::getSupportedServiceNames()
164 return {
"com.sun.star.awt.FontIdentificator" };
169extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
171 css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any>
const&)
173 return cppu::acquire(
new vcl::FontIdentificator());
FontFamily GetFamilyType()
const OUString & GetStyleName() const
const OUString & GetFamilyName() const
static Font identifyFont(const void *pBuffer, sal_uInt32 nLen)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * vcl_FontIdentificator_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
ImplSVData * ImplGetSVData()