/*
- * 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;
}
+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();
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( FontId preferredFont, Character charcode, PointSize26Dot6 pointSize, bool preferColor )
+FontId FontClient::FindFallbackFont( Character charcode,
+ const FontDescription& preferredFontDescription,
+ PointSize26Dot6 requestedPointSize,
+ bool preferColor )
{
CreatePlugin();
- return mPlugin->FindFallbackFont( preferredFont, charcode, pointSize, preferColor );
+ return mPlugin->FindFallbackFont( charcode,
+ preferredFontDescription,
+ requestedPointSize,
+ preferColor );
}
bool FontClient::IsScalable( const FontPath& path )
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 FontDescription& fontDescription,
- PointSize26Dot6 pointSize,
+ PointSize26Dot6 requestedPointSize,
FaceIndex faceIndex )
{
CreatePlugin();
return mPlugin->GetFontId( fontDescription,
- pointSize,
+ requestedPointSize,
faceIndex );
}
-void FontClient::GetFontMetrics( FontId fontId, FontMetrics& metrics, int desiredFixedSize )
+void FontClient::GetFontMetrics( FontId fontId, FontMetrics& metrics )
{
CreatePlugin();
- return mPlugin->GetFontMetrics( fontId, metrics, desiredFixedSize );
+ return mPlugin->GetFontMetrics( fontId, metrics );
}
GlyphIndex FontClient::GetGlyphIndex( FontId fontId, Character charcode )
return mPlugin->GetGlyphIndex( fontId, charcode );
}
-bool FontClient::GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType type, bool horizontal, int desiredFixedSize )
+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();
- return mPlugin->GetGlyphMetrics( array, size, type, horizontal, desiredFixedSize );
+ mPlugin->CreateBitmap( fontId, glyphIndex, data, outlineWidth );
}
-BufferImage FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex )
+PixelData FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, int outlineWidth )
{
CreatePlugin();
- return mPlugin->CreateBitmap( fontId, glyphIndex );
+ return mPlugin->CreateBitmap( fontId, glyphIndex, outlineWidth );
}
void FontClient::CreateVectorBlob( FontId fontId, GlyphIndex glyphIndex, VectorBlob*& blob, unsigned int& blobLength, unsigned int& nominalWidth, unsigned int& nominalHeight )
return mPlugin->CreateVectorBlob( fontId, glyphIndex, blob, blobLength, nominalWidth, nominalHeight );
}
-const GlyphInfo& FontClient::GetEllipsisGlyph( PointSize26Dot6 pointSize )
+const GlyphInfo& FontClient::GetEllipsisGlyph( PointSize26Dot6 requestedPointSize )
+{
+ CreatePlugin();
+
+ return mPlugin->GetEllipsisGlyph( requestedPointSize );
+}
+
+bool FontClient::IsColorGlyph( FontId fontId, GlyphIndex glyphIndex )
+{
+ CreatePlugin();
+
+ return mPlugin->IsColorGlyph( fontId, glyphIndex );
+}
+
+bool FontClient::AddCustomFontDirectory( const char* path )
{
CreatePlugin();
- return mPlugin->GetEllipsisGlyph( pointSize );
+ return mPlugin->AddCustomFontDirectory( path );
}
void FontClient::CreatePlugin()