X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=text%2Fdali%2Finternal%2Ftext-abstraction%2Ffont-client-impl.cpp;h=1bed788f4386b25ce44908b15ee07eddbc6bc45b;hb=cc06bc9577950bea77b30f1482980b1e52131562;hp=94d8bd361a2bc9a5f62850f656a8a61e25363cd0;hpb=60150a51219828430a58d5fabfc48371971ffe18;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/text/dali/internal/text-abstraction/font-client-impl.cpp b/text/dali/internal/text-abstraction/font-client-impl.cpp index 94d8bd3..1bed788 100644 --- a/text/dali/internal/text-abstraction/font-client-impl.cpp +++ b/text/dali/internal/text-abstraction/font-client-impl.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -18,6 +18,11 @@ // CLASS HEADER #include +// EXTERNAL INCLUDES +#ifndef DALI_PROFILE_UBUNTU +#include +#endif + // INTERNAL INCLUDES #include #include @@ -86,6 +91,17 @@ void FontClient::GetDpi( unsigned int& horizontalDpi, unsigned int& verticalDpi 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(); @@ -121,6 +137,13 @@ PointSize26Dot6 FontClient::GetPointSize( FontId id ) return mPlugin->GetPointSize( id ); } +bool FontClient::IsCharacterSupportedByFont( FontId fontId, Character character ) +{ + CreatePlugin(); + + return mPlugin->IsCharacterSupportedByFont( fontId, character ); +} + void FontClient::GetSystemFonts( FontList& systemFonts ) { CreatePlugin(); @@ -128,18 +151,28 @@ void FontClient::GetSystemFonts( FontList& systemFonts ) mPlugin->GetSystemFonts( systemFonts ); } -FontId FontClient::FindDefaultFont( Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor ) +FontId FontClient::FindDefaultFont( Character charcode, + PointSize26Dot6 requestedPointSize, + bool preferColor ) { CreatePlugin(); - return mPlugin->FindDefaultFont( charcode, requestedPointSize, preferColor ); + return mPlugin->FindDefaultFont( charcode, + requestedPointSize, + preferColor ); } -FontId FontClient::FindFallbackFont( FontId preferredFont, Character charcode, PointSize26Dot6 requestedPointSize, bool preferColor ) +FontId FontClient::FindFallbackFont( Character charcode, + const FontDescription& preferredFontDescription, + PointSize26Dot6 requestedPointSize, + bool preferColor ) { CreatePlugin(); - return mPlugin->FindFallbackFont( preferredFont, charcode, requestedPointSize, preferColor ); + return mPlugin->FindFallbackFont( charcode, + preferredFontDescription, + requestedPointSize, + preferColor ); } bool FontClient::IsScalable( const FontPath& path ) @@ -177,8 +210,8 @@ FontId FontClient::GetFontId( const FontPath& path, PointSize26Dot6 requestedPoi return mPlugin->GetFontId( path, requestedPointSize, - requestedPointSize, - faceIndex ); + faceIndex, + true ); } FontId FontClient::GetFontId( const FontDescription& fontDescription, @@ -189,7 +222,6 @@ FontId FontClient::GetFontId( const FontDescription& fontDescription, return mPlugin->GetFontId( fontDescription, requestedPointSize, - requestedPointSize, faceIndex ); } @@ -214,11 +246,18 @@ bool FontClient::GetGlyphMetrics( GlyphInfo* array, uint32_t size, GlyphType typ return mPlugin->GetGlyphMetrics( array, size, type, horizontal ); } -BufferImage FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex ) +void FontClient::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, Dali::TextAbstraction::FontClient::GlyphBufferData& data, int outlineWidth ) { CreatePlugin(); - return mPlugin->CreateBitmap( fontId, glyphIndex ); + 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 ) @@ -235,6 +274,20 @@ const GlyphInfo& FontClient::GetEllipsisGlyph( PointSize26Dot6 requestedPointSiz 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->AddCustomFontDirectory( path ); +} + void FontClient::CreatePlugin() { if( !mPlugin )