/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// CLASS HEADER
#include <dali/internal/text-abstraction/font-client-impl.h>
+// EXTERNAL INCLUDES
+#ifndef DALI_PROFILE_UBUNTU
+#include <vconf.h>
+#endif
+
// INTERNAL INCLUDES
#include <singleton-service.h>
#include <dali/internal/text-abstraction/font-client-plugin-impl.h>
verticalDpi = mDpiVertical;
}
-void FontClient::SetDefaultFontFamily( const std::string& fontFamilyName,
- const std::string& fontStyle )
+int FontClient::GetDefaultFontSize()
+{
+ int fontSize( -1 );
+
+#ifndef DALI_PROFILE_UBUNTU
+ vconf_get_int( VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, &fontSize );
+#endif // DALI_PROFILE_UBUNTU
+
+ return fontSize;
+}
+
+void FontClient::ResetSystemDefaults()
{
CreatePlugin();
- mPlugin->SetDefaultFontFamily( fontFamilyName, fontStyle );
+ mPlugin->ResetSystemDefaults();
}
void FontClient::GetDefaultFonts( FontList& defaultFonts )
mPlugin->GetDefaultFonts( defaultFonts );
}
+void FontClient::GetDefaultPlatformFontDescription( FontDescription& fontDescription )
+{
+ CreatePlugin();
+
+ mPlugin->GetDefaultPlatformFontDescription( fontDescription );
+}
+
void FontClient::GetDescription( FontId id, FontDescription& fontDescription )
{
CreatePlugin();
return mPlugin->GetPointSize( id );
}
+bool FontClient::IsCharacterSupportedByFont( FontId fontId, Character character )
+{
+ CreatePlugin();
+
+ return mPlugin->IsCharacterSupportedByFont( fontId, character );
+}
+
void FontClient::GetSystemFonts( FontList& systemFonts )
{
CreatePlugin();
mPlugin->GetSystemFonts( systemFonts );
}
-FontId FontClient::FindDefaultFont( Character charcode, PointSize26Dot6 pointSize, bool preferColor )
+FontId FontClient::FindDefaultFont( Character charcode,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor )
{
CreatePlugin();
- return mPlugin->FindDefaultFont( charcode, pointSize, preferColor );
+ return mPlugin->FindDefaultFont( charcode,
+ requestedPointSize,
+ preferColor );
+}
+
+FontId FontClient::FindFallbackFont( Character charcode,
+ const FontDescription& preferredFontDescription,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor )
+{
+ CreatePlugin();
+
+ return mPlugin->FindFallbackFont( charcode,
+ preferredFontDescription,
+ requestedPointSize,
+ preferColor );
}
bool FontClient::IsScalable( const FontPath& path )
return mPlugin->IsScalable( path );
}
-bool FontClient::IsScalable( const FontFamily& fontFamily, const FontStyle& style )
+bool FontClient::IsScalable( const FontDescription& fontDescription )
{
CreatePlugin();
- return mPlugin->IsScalable( fontFamily, style );
+ return mPlugin->IsScalable( fontDescription );
}
void FontClient::GetFixedSizes( const FontPath& path, Dali::Vector< PointSize26Dot6>& sizes )
mPlugin->GetFixedSizes( path, sizes );
}
-void FontClient::GetFixedSizes( const FontFamily& fontFamily,
- const FontStyle& style,
+void FontClient::GetFixedSizes( const FontDescription& fontDescription,
Dali::Vector< PointSize26Dot6 >& sizes )
{
CreatePlugin();
- mPlugin->GetFixedSizes( fontFamily, style, sizes );
+ mPlugin->GetFixedSizes( fontDescription, sizes );
}
-FontId FontClient::GetFontId( const FontPath& path, PointSize26Dot6 pointSize, FaceIndex faceIndex )
+FontId FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPointSize, FaceIndex faceIndex )
{
CreatePlugin();
- return mPlugin->GetFontId( path, pointSize, faceIndex );
+ return mPlugin->GetFontId( path,
+ requestedPointSize,
+ faceIndex,
+ true );
}
-FontId FontClient::GetFontId( const FontFamily& fontFamily,
- const FontStyle& fontStyle,
- PointSize26Dot6 pointSize,
+FontId FontClient::GetFontId( const FontDescription& fontDescription,
+ PointSize26Dot6 requestedPointSize,
FaceIndex faceIndex )
{
CreatePlugin();
- return mPlugin->GetFontId( fontFamily,
- fontStyle,
- pointSize,
+ return mPlugin->GetFontId( fontDescription,
+ requestedPointSize,
faceIndex );
}
return mPlugin->GetGlyphIndex( fontId, charcode );
}
-bool FontClient::GetGlyphMetrics( GlyphInfo* array, uint32_t size, bool horizontal )
+bool FontClient::GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal )
+{
+ CreatePlugin();
+
+ return mPlugin->GetGlyphMetrics( array, size, type, horizontal );
+}
+
+void FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data, int outlineWidth )
+{
+ CreatePlugin();
+
+ mPlugin->CreateBitmap( fontId, glyphIndex, data, outlineWidth );
+}
+
+PixelData FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, int outlineWidth )
+{
+ CreatePlugin();
+
+ return mPlugin->CreateBitmap( fontId, glyphIndex, outlineWidth );
+}
+
+void FontClient::CreateVectorBlob( FontId fontId, GlyphIndex glyphIndex, VectorBlob*& blob, unsigned int& blobLength, unsigned int& nominalWidth, unsigned int& nominalHeight )
+{
+ CreatePlugin();
+
+ return mPlugin->CreateVectorBlob( fontId, glyphIndex, blob, blobLength, nominalWidth, nominalHeight );
+}
+
+const GlyphInfo& FontClient::GetEllipsisGlyph( PointSize26Dot6 requestedPointSize )
+{
+ CreatePlugin();
+
+ return mPlugin->GetEllipsisGlyph( requestedPointSize );
+}
+
+bool FontClient::IsColorGlyph( FontId fontId, GlyphIndex glyphIndex )
{
CreatePlugin();
- return mPlugin->GetGlyphMetrics( array, size, horizontal );
+ return mPlugin->IsColorGlyph( fontId, glyphIndex );
}
-BufferImage FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex )
+bool FontClient::AddCustomFontDirectory( const char* path )
{
CreatePlugin();
- return mPlugin->CreateBitmap( fontId, glyphIndex );
+ return mPlugin->AddCustomFontDirectory( path );
}
void FontClient::CreatePlugin()